Package org.antlr.grammar.v2

Examples of org.antlr.grammar.v2.AssignTokenTypesWalker


  }

  public void assignTokenTypes() throws antlr.RecognitionException {
    // ASSIGN TOKEN TYPES for all delegates (same walker)
    //System.out.println("### assign types");
    AssignTokenTypesWalker ttypesWalker = new AssignTokenTypesBehavior();
    ttypesWalker.setASTNodeClass("org.antlr.tool.GrammarAST");
    List<Grammar> grammars = delegateGrammarTreeRoot.getPostOrderedGrammarList();
    for (int i = 0; grammars!=null && i < grammars.size(); i++) {
      Grammar g = (Grammar)grammars.get(i);
      try {
        //System.out.println("    walking "+g.name);
        ttypesWalker.grammar(g.getGrammarTree(), g);
      }
      catch (RecognitionException re) {
        ErrorManager.error(ErrorManager.MSG_BAD_AST_STRUCTURE,
                   re);
      }
    }
    // the walker has filled literals, tokens, and alias tables.
    // now tell it to define them in the root grammar
    ttypesWalker.defineTokens(delegateGrammarTreeRoot.grammar);
  }
View Full Code Here


  }

  public void assignTokenTypes() throws RecognitionException {
    // ASSIGN TOKEN TYPES for all delegates (same walker)
    //System.out.println("### assign types");
    AssignTokenTypesWalker ttypesWalker = new AssignTokenTypesBehavior();
    List<Grammar> grammars = delegateGrammarTreeRoot.getPostOrderedGrammarList();
    for (int i = 0; grammars!=null && i < grammars.size(); i++) {
      Grammar g = grammars.get(i);
      ttypesWalker.setTreeNodeStream(new CommonTreeNodeStream(g.getGrammarTree()));
      try {
        //System.out.println("    walking "+g.name);
        ttypesWalker.grammar_(g);
      }
      catch (RecognitionException re) {
        ErrorManager.error(ErrorManager.MSG_BAD_AST_STRUCTURE,
                   re);
      }
    }
    // the walker has filled literals, tokens, and alias tables.
    // now tell it to define them in the root grammar
    ttypesWalker.defineTokens(delegateGrammarTreeRoot.grammar);
  }
View Full Code Here

  }

  public void assignTokenTypes() throws RecognitionException {
    // ASSIGN TOKEN TYPES for all delegates (same walker)
    //System.out.println("### assign types");
    AssignTokenTypesWalker ttypesWalker = new AssignTokenTypesBehavior();
    List<Grammar> grammars = delegateGrammarTreeRoot.getPostOrderedGrammarList();
    for (int i = 0; grammars!=null && i < grammars.size(); i++) {
      Grammar g = (Grammar)grammars.get(i);
      ttypesWalker.setTreeNodeStream(new CommonTreeNodeStream(g.getGrammarTree()));
      try {
        //System.out.println("    walking "+g.name);
        ttypesWalker.grammar_(g);
      }
      catch (RecognitionException re) {
        ErrorManager.error(ErrorManager.MSG_BAD_AST_STRUCTURE,
                   re);
      }
    }
    // the walker has filled literals, tokens, and alias tables.
    // now tell it to define them in the root grammar
    ttypesWalker.defineTokens(delegateGrammarTreeRoot.grammar);
  }
View Full Code Here

  }

  public void assignTokenTypes() throws RecognitionException {
    // ASSIGN TOKEN TYPES for all delegates (same walker)
    //System.out.println("### assign types");
    AssignTokenTypesWalker ttypesWalker = new AssignTokenTypesBehavior();
    List<Grammar> grammars = delegateGrammarTreeRoot.getPostOrderedGrammarList();
    for (int i = 0; grammars!=null && i < grammars.size(); i++) {
      Grammar g = grammars.get(i);
      ttypesWalker.setTreeNodeStream(new CommonTreeNodeStream(g.getGrammarTree()));
      try {
        //System.out.println("    walking "+g.name);
        ttypesWalker.grammar_(g);
      }
      catch (RecognitionException re) {
        ErrorManager.error(ErrorManager.MSG_BAD_AST_STRUCTURE,
                   re);
      }
    }
    // the walker has filled literals, tokens, and alias tables.
    // now tell it to define them in the root grammar
    ttypesWalker.defineTokens(delegateGrammarTreeRoot.grammar);
  }
View Full Code Here

TOP

Related Classes of org.antlr.grammar.v2.AssignTokenTypesWalker

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.