Package

Examples of JavaRecognizer


      // Create a scanner that reads from the input stream passed to us
      JavaLexer lexer = new JavaLexer(r);
      lexer.setFilename(f);

      // Create a parser that reads from the scanner
      JavaRecognizer parser = new JavaRecognizer(lexer);
      parser.setFilename(f);

      // start parsing at the compilationUnit rule
      parser.compilationUnit();
     
      // do something with the tree
      doTreeAction(f, parser.getAST(), parser.getTokenNames());
    }
    catch (Exception e) {
      System.err.println("parser exception: "+e);
      e.printStackTrace();   // so we can get stack trace   
    }
View Full Code Here

TOP

Related Classes of JavaRecognizer

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.