Examples of JavaParser


Examples of org.freud.analysed.javasource.parser.JavaParser

        Document root = parseJavaSourceToDocument(reader);
        return new JavaSourceJdom(root, identifier);
    }

    private static Document parseJavaSourceToDocument(final Reader javaSourceReader) throws RecognitionException, IOException {
        JavaParser parser = new JavaParser(new CommonTokenStream(new JavaLexer(new ANTLRReaderStream(javaSourceReader))));
        final JdomTreeAdaptor treeAdaptor = new JdomTreeAdaptor(JAVA_SOURCE_ROOT_ELEMENT_NAME, JAVA_SOURCE_TOKEN_TYPES);
        parser.setTreeAdaptor(treeAdaptor);
        parser.compilationUnit();
        return treeAdaptor.getDocument();
    }
View Full Code Here

Examples of org.z.lexer.JavaParser

    String base = file.substring(0, file.lastIndexOf("/"));

    lex = new JavaLexer(new ANTLRFileStream(file, "UTF8"));
    CommonTokenStream tokens = new CommonTokenStream(lex);

    JavaParser g = new JavaParser(tokens);
    try {
      // parse
      File f = g.run().result;
      f.setFileName(file);

      if(g.failed()) {
        throw new CompilerException("Error parsing file.");
      }
     
      // always compile imports
      for(String importName : f.getImports()) {
View Full Code Here

Examples of soot.JastAddJ.JavaParser

        program = new Program();
  program.state().reset();

        program.initBytecodeReader(new BytecodeParser());
        program.initJavaParser(
          new JavaParser() {
            public CompilationUnit parse(InputStream is, String fileName) throws IOException, beaver.Parser.Exception {
              return new JastAddJavaParser().parse(is, fileName);
            }
          }
        );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.