Examples of compilationUnit()


Examples of org.asdt.core.internal.antlr.AS3Parser.compilationUnit()

  public ASCompilationUnit parse(Reader in) {
    AS3Parser parser = ASTUtils.parse(in);
    LinkedListTree cu;
    try {
      cu = AS3FragmentParser.tree(parser.compilationUnit());
    } catch (RecognitionException e) {
      throw ASTUtils.buildSyntaxException(null, parser, e);
    }
    return new AS3ASTCompilationUnit(cu);
  }
View Full Code Here

Examples of org.codehaus.groovy.antlr.java.JavaRecognizer.compilationUnit()

            throws RecognitionException, TokenStreamException {
        SourceBuffer sourceBuffer = new SourceBuffer();
        JavaRecognizer parser = getJavaParser(src, sourceBuffer);
        String[] tokenNames = parser.getTokenNames();
        try {
            parser.compilationUnit();
        } catch (OutOfMemoryError e) {
            log.error("Out of memory while processing: " + packagePath + "/" + file);
            throw e;
        }
        AST ast = parser.getAST();
View Full Code Here

Examples of org.codehaus.groovy.antlr.java.JavaRecognizer.compilationUnit()

            throws RecognitionException, TokenStreamException {
        SourceBuffer sourceBuffer = new SourceBuffer();
        JavaRecognizer parser = getJavaParser(src, sourceBuffer);
        String[] tokenNames = parser.getTokenNames();
        try {
            parser.compilationUnit();
        } catch (OutOfMemoryError e) {
            System.out.println("Out of memory while processing: " + packagePath + "/" + file);
            throw e;
        }
        AST ast = parser.getAST();
View Full Code Here

Examples of org.codehaus.groovy.antlr.java.JavaRecognizer.compilationUnit()

  private Map parseJava(String packagePath, String file, String src) throws RecognitionException, TokenStreamException {
        SourceBuffer sourceBuffer = new SourceBuffer();
        JavaRecognizer parser = getJavaParser(src, sourceBuffer);
        String[] tokenNames = parser.getTokenNames();
        parser.compilationUnit();
        AST ast = parser.getAST();

        // modify the Java AST into a Groovy AST (just token types)
    Visitor java2groovyConverter = new Java2GroovyConverter(tokenNames);
        AntlrASTProcessor java2groovyTraverser = new PreOrderTraversal(java2groovyConverter);
View Full Code Here

Examples of org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit()

    private Map<String, GroovyClassDoc> parseGroovy(String packagePath, String file, String src)
            throws RecognitionException, TokenStreamException {
        SourceBuffer sourceBuffer = new SourceBuffer();
        GroovyRecognizer parser = getGroovyParser(src, sourceBuffer);
        try {
            parser.compilationUnit();
        } catch (OutOfMemoryError e) {
            log.error("Out of memory while processing: " + packagePath + "/" + file);
            throw e;
        }
        AST ast = parser.getAST();
View Full Code Here

Examples of org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit()

        tokenNames = parser.getTokenNames();
        parser.setFilename(sourceUnit.getName());

        // start parsing at the compilationUnit rule
        try {
            parser.compilationUnit();
        }
        catch (TokenStreamRecognitionException tsre) {
            RecognitionException e = tsre.recog;
            SyntaxException se = new SyntaxException(e.getMessage(),e,e.getLine(),e.getColumn());
            se.setFatal(true);
View Full Code Here

Examples of org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit()

        tokenNames = parser.getTokenNames();
        parser.setFilename(sourceUnit.getName());

        // start parsing at the compilationUnit rule
        try {
            parser.compilationUnit();
        }
        catch (TokenStreamRecognitionException tsre) {
            RecognitionException e = tsre.recog;
            SyntaxException se = new SyntaxException(e.getMessage(),e,e.getLine(),e.getColumn());
            se.setFatal(true);
View Full Code Here

Examples of org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit()

        tokenNames = parser.getTokenNames();
        parser.setFilename(sourceUnit.getName());

        // start parsing at the compilationUnit rule
        try {
            parser.compilationUnit();
        }
        catch (TokenStreamRecognitionException tsre) {
            RecognitionException e = tsre.recog;
            SyntaxException se = new SyntaxException(e.getMessage(), e, e.getLine(), e.getColumn());
            se.setFatal(true);
View Full Code Here

Examples of org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit()

        System.out.println("  " + testName);
        System.out.println("-------------------------------");
        try {
            Reader reader = new BufferedReader(new StringReader(theSrcText));
            GroovyRecognizer recognizer = GroovyRecognizer.make(reader);
            recognizer.compilationUnit();
            System.out.println(decorateWithLineNumbers(theSrcText));

        } catch (RecognitionException parseException) {
            System.out.println(decorateWithLineNumbersAndErrorMessage(theSrcText,parseException));
            throw parseException;
View Full Code Here

Examples of org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit()

        parser.setSourceBuffer(sourceBuffer);
        parser.setFilename(name);

        // start parsing at the compilationUnit rule
        try {
            parser.compilationUnit();
        }
        catch (Exception ex) {
            StringWriter out = new StringWriter();
            out.write(ex.getMessage());
            out.write("\n");
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.