Package tool.model.grammar

Examples of tool.model.grammar.ForteParser


      String source = document.get();
      CharStream stream =
          new NoCaseStringStream(source);
      ToolSQLLexer lexer = new ToolSQLLexer(stream);
      TokenStream tokens = new CommonTokenStream(lexer);
      ForteParser parser = new ForteParser(tokens);
//      parser.setErrorReporter(this);
      parser.setTreeAdaptor(adaptor);
      cursorDeclaration_return result = parser.cursorDeclaration();
      if (parser.getNumberOfSyntaxErrors() > 0){
        ToolPlugin.showError(parser.getNumberOfSyntaxErrors() + " Syntax error in cursor " + getFile().getName() + "\n"
            + this.parseErrors.toString(), null);
      } else {
        CommonTree tree = (CommonTree) result.getTree();
        System.out.println(tree.toStringTree());
        CommonTreeNodeStream nodes = new CommonTreeNodeStream(tree);
View Full Code Here


  public int testPEXFile(File pex, boolean failOnError) throws IOException, RecognitionException {
    CharStream stream =
        new NoCaseFileStream(pex.getAbsolutePath());
    ForteLexer lexer = new ForteLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    ForteParser parser = new ForteParser(tokenStream);
   
    CommonTree tree = (CommonTree) parser.projectFile().getTree();
    printTree(tree);
    int errors = parser.getNumberOfSyntaxErrors();
    System.out.println(pex.getName() + " parse errors: " + errors );
    errors+= createPRXTree(tree, tokenStream, pex);
//    errors += createJavaProxy(tree, tokenStream, pex);
//    System.out.println(pex.getName() + "  tree errors: " + treeerrors);
    if (failOnError && (errors) > 0Assert.fail() ;
View Full Code Here

  NoCaseStringStream stream;
  ForteLexer lexer;
  TokenStream tokenStream;
  public MethodAutoEditStrategy() {
    super();
    parser = new ForteParser(null);
   
  }
View Full Code Here

      String source = document.get();
      CharStream stream =
          new NoCaseStringStream(source);
      ToolSQLLexer lexer = new ToolSQLLexer(stream);
      TokenStream tokens = new CommonTokenStream(lexer);
      ForteParser parser = new ForteParser(tokens);
//      parser.setErrorReporter(this);
      parser.setTreeAdaptor(new CommonTreeAdaptor(){
        public Object create(Token payload){
          return new CommonTree(payload);
        }
      });
      cursorDeclaration_return result = parser.cursorDeclaration();
      if (parser.getNumberOfSyntaxErrors() > 0){
        ToolModelActivator.showError(parser.getNumberOfSyntaxErrors() + " Syntax error in cursor " + getFile().getName() + "\n"
            + this.parseErrors.toString(), null);
      } else {
        CommonTree tree = (CommonTree) result.getTree();
        System.out.println(tree.toStringTree());
        CommonTreeNodeStream nodes = new CommonTreeNodeStream(tree);
View Full Code Here

TOP

Related Classes of tool.model.grammar.ForteParser

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.