Examples of compilationUnit()


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) {
            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.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()

                            }
                            return;
                        }

            // start parsing at the compilationUnit rule
            parser.compilationUnit();
           
            System.out.println("parseFile "+f+" => "+parser.getAST());

            // do something with the tree
            doTreeAction(f, parser.getAST(), parser.getTokenNames());
View Full Code Here

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

        GroovyLexer lexer = new GroovyLexer(unicodeReader);
        unicodeReader.setLexer(lexer);
        parser = GroovyRecognizer.make(lexer);
        parser.setSourceBuffer(sourceBuffer);
        String[] tokenNames = parser.getTokenNames();
        parser.compilationUnit();
        AST ast = parser.getAST();
        Class[] paramTypes;
        Object[] params;
        if (extraParam == null) {
            paramTypes = new Class[]{PrintStream.class, String[].class};
View Full Code Here

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

        GroovyLexer lexer = new GroovyLexer(unicodeReader);
        unicodeReader.setLexer(lexer);
        parser = GroovyRecognizer.make(lexer);
        parser.setSourceBuffer(sourceBuffer);
        String[] tokenNames = parser.getTokenNames();
        parser.compilationUnit();
        AST ast = parser.getAST();
        AntlrASTProcessor snippets = new AntlrASTProcessSnippets();
        ast = snippets.process(ast);
        Visitor visitor = new LineColumnChecker(sourceBuffer, tokenNames);
        AntlrASTProcessor traverser = new SourceCodeTraversal(visitor);
View Full Code Here

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

        GroovyLexer lexer = new GroovyLexer(unicodeReader);
        unicodeReader.setLexer(lexer);
        parser = GroovyRecognizer.make(lexer);
        parser.setSourceBuffer(sourceBuffer);
        String[] tokenNames = parser.getTokenNames();
        parser.compilationUnit();
        AST ast = parser.getAST();

        // determine direct result
        Visitor directVisitor = new SourcePrinter(new PrintStream(baos), tokenNames, false);
        AntlrASTProcessor traverser = new SourceCodeTraversal(directVisitor);
View Full Code Here

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

                            }
                            return;
                        }

      // start parsing at the compilationUnit rule
      parser.compilationUnit();
     
      System.out.println("parseFile "+f+" => "+parser.getAST());

      // do something with the tree
      doTreeAction(f, parser.getAST(), parser.getTokenNames());
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()

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

        // now do the business
        Visitor visitor = new SimpleGroovyClassDocAssembler(packagePath, file, sourceBuffer, links);
        AntlrASTProcessor traverser = new SourceCodeTraversal(visitor);
View Full Code Here

Examples of org.drools.compiler.lang.DRLParser.compilationUnit()

    @SuppressWarnings("unchecked")
    public CompletionContext(String backText) {
        DRLParser parser = getParser(backText);

        try {
            parser.compilationUnit();
        } catch (Exception ex) {
        }
        parserList = parser.getEditorInterface().get(0).getContent();
        deriveLocation();
        determineDialect(backText);
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.