Package com.google.code.vimsztool.compiler

Examples of com.google.code.vimsztool.compiler.CompilerContext


   
    String serverName = params.get("serverName");
    debugger.setVimServerName(serverName);
   
    CompilerContextManager ccm = CompilerContextManager.getInstnace();
    CompilerContext ctx = ccm.getCompilerContext(classPathXml);
    debugger.setCompilerContext(ctx);
   
    if (debugCmdArgs == null || debugCmdArgs.trim().equals("")) {
      return "";
    }
View Full Code Here


    return compilerContext;
  }
 
  private String getClassPath(String classPathXml) {
    CompilerContextManager ccm = CompilerContextManager.getInstnace();
    CompilerContext ctx = ccm.getCompilerContext(classPathXml);

    List<URL> urls = ctx.getClassPathUrls();
    StringBuilder sb = new StringBuilder();
    for (URL url : urls) {
      sb.append(url.getPath()).append(File.pathSeparator);
    }
    return sb.toString();
View Full Code Here

    return sb.toString();
  }
 
  public void verifyBreakpoint(String mainClass) {
    Debugger debugger = Debugger.getInstance();
    CompilerContext ctx = debugger.getCompilerContext();
    if (ctx == null) return ;
   
    ClassMetaInfoManager cmm =ctx.getClassMetaInfoManager();
   
    List<Breakpoint> invalidBreakPoints = new ArrayList<Breakpoint>();
   
    for (Breakpoint bp : allBreakpoints) {
      if (bp.getMainClass().equals(mainClass)) {
View Full Code Here

    return false;
  }

  public String addBreakpoint(String mainClass, int lineNum,String conExp) {
    Debugger debugger = Debugger.getInstance();
    CompilerContext ctx = debugger.getCompilerContext();
    ClassMetaInfoManager cmm = ctx.getClassMetaInfoManager();
   
    ClassInfo metaInfo = cmm.getMetaInfo(mainClass);
    if (metaInfo == null) return "failure";
    Breakpoint breakpoint = null;
    if (!metaInfo.getLineNums().contains(lineNum)) {
View Full Code Here

    try {
      ThreadReference threadRef = checkAndGetCurrentThread();
      Debugger debugger = Debugger.getInstance();
      SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
      CompilerContext ctx = debugger.getCompilerContext();
      VirtualMachine vm = debugger.getVm();
      List<ReferenceType> refTypes = vm.classesByName("java.lang."+className);
      if (refTypes !=null && refTypes.size() >0 ) {
        return refTypes.get(0);
      }
      String locSourcePath = stackFrame.location().sourcePath();
      String abPath = ctx.findSourceFile(locSourcePath);
      BufferedReader br = new BufferedReader(new FileReader(abPath));
      Pattern pat = Pattern.compile("import\\s+(.*\\."+className+")\\s*;\\s*$");
      String qualifiedClass = null;
     
      int pkgIndex = locSourcePath.lastIndexOf(File.separator);
View Full Code Here

  private static JdeLogger log = JdeLogger.getLogger("SzjdeTypeHierarchyCommand");
 
  public String execute() {
    String classPathXml = params.get(SzjdeConstants.PARAM_CLASSPATHXML);
    String sourceFile = params.get(SzjdeConstants.PARAM_SOURCEFILE);
    CompilerContext cc=getCompilerContext(classPathXml);
    String className = cc.buildClassName(sourceFile);
    ClassMetaInfoManager cmm = cc.getClassMetaInfoManager();
    List<String> result = cmm.getTypeHierarchy(className);
    StringBuilder sb = new StringBuilder();
    for (String line : result) {
      sb.append(line).append("\n");
    }
View Full Code Here

  public String execute() {
    String classPathXml = params.get(SzjdeConstants.PARAM_CLASSPATHXML);
    String className = params.get(SzjdeConstants.PARAM_CLASS_NAME);
    String sourceType = params.get(SzjdeConstants.PARAM_SOURCE_TYPE);
    CompilerContext cc = getCompilerContext(classPathXml);
    ClassMetaInfoManager cmm = cc.getClassMetaInfoManager();

    if (sourceType != null && sourceType.equals("impl")) {
      ClassInfo classInfo = cmm.getMetaInfo(className);
      if (classInfo != null) {
        Set<String> subNames = classInfo.getSubNames();
        if (subNames.size() == 1) {
          className = subNames.toArray(new String[]{})[0];
        }
      }
    }
    String sourcePath = cc.findSourceClass(className);
    if (sourcePath.equals("None")) return sourcePath;
   
    StringBuilder sb = new StringBuilder();
    sb.append(sourcePath).append("\n");
    if (className.indexOf(".") > -1) {
View Full Code Here

  }

  public String execute() {
    String classPathXml = params.get(SzjdeConstants.PARAM_CLASSPATHXML);
    String sourceFile = params.get(SzjdeConstants.PARAM_SOURCEFILE);
    CompilerContext cc = getCompilerContext(classPathXml);
    List<URL> urls = cc.getClassPathUrls();
    StringBuilder cmd = new StringBuilder("java::-cp::");
    for (URL url : urls) {
      cmd.append(url.getPath()).append(File.pathSeparator);
    }

    cmd.append(" ::");
    if (runAsUnitTest) {
      cmd.append("org.junit.runner.JUnitCore::");
    }
    String className = cc.buildClassName(sourceFile);
    cmd.append(className);
    String uuid=UUID.randomUUID().toString();
    String vimServerName = params.get(SzjdeConstants.PARAM_VIM_SERVER);
    String bufname = params.get(SzjdeConstants.PARAM_BUF_NAME);
    String origCmdLine = "Run " + className;
    SystemJob job = new SystemJob(cmd.toString(),
        vimServerName,"false",uuid,bufname,cc.getProjectRoot(),origCmdLine);
    job.start();
    return "";
   
  }
View Full Code Here

  public String execute() {
    String classPathXml = params.get(PARAM_CLASSPATHXML);
    String dumpClass = params.get(PARAM_DUMP_CLASS);
    String[] classNameList = dumpClass.split(",");

    CompilerContext ctx = getCompilerContext(classPathXml);
    ReflectAbleClassLoader classLoader = ctx.getClassLoader();

    Class aClass = null;
    for (String className : classNameList) {
      try {
        aClass = classLoader.loadClass(className);
View Full Code Here

  @SuppressWarnings("unchecked")
  public String execute() {
   
    String classPathXml = params.get(SzjdeConstants.PARAM_CLASSPATHXML);
    String varNamesStr = params.get(SzjdeConstants.PARAM_VAR_NAMES);
    CompilerContext cc = getCompilerContext(classPathXml);
    ReflectAbleClassLoader classLoader = cc.getClassLoader();
    String[] varNames = varNamesStr.split(",");
    StringBuilder sb=new StringBuilder();
    LinkedList<Class> superClassList = new LinkedList<Class>();
    for (String name : varNames ) {
      Class aClass = null;
View Full Code Here

TOP

Related Classes of com.google.code.vimsztool.compiler.CompilerContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.