Examples of dupTree()


Examples of org.antlr.v4.parse.GrammarASTAdaptor.dupTree()

      for (GrammarAST o : options) {
        String optionName = o.getChild(0).getText();
        if ( Grammar.lexerOptions.contains(optionName) &&
           !Grammar.doNotCopyOptionsToLexer.contains(optionName) )
        {
          GrammarAST optionTree = (GrammarAST)adaptor.dupTree(o);
          lexerOptionsRoot.addChild(optionTree);
          lexerAST.setOption(optionName, (GrammarAST)optionTree.getChild(1));
        }
      }
    }
View Full Code Here

Examples of org.antlr.v4.parse.GrammarASTAdaptor.dupTree()

    // COPY all named actions, but only move those with lexer:: scope
    List<GrammarAST> actionsWeMoved = new ArrayList<GrammarAST>();
    for (GrammarAST e : elements) {
      if ( e.getType()==ANTLRParser.AT ) {
        lexerAST.addChild((Tree)adaptor.dupTree(e));
        if ( e.getChild(0).getText().equals("lexer") ) {
          actionsWeMoved.add(e);
        }
      }
    }
View Full Code Here

Examples of org.antlr.v4.parse.GrammarASTAdaptor.dupTree()

    }

    for (GrammarASTWithOptions r : rules) {
      String ruleName = r.getChild(0).getText();
      if (Grammar.isTokenName(ruleName)) {
        lexerRulesRoot.addChild((Tree)adaptor.dupTree(r));
        rulesWeMoved.add(r);
      }
    }
    for (GrammarAST r : rulesWeMoved) {
      combinedRulesRoot.deleteChild( r );
View Full Code Here

Examples of org.antlr.v4.parse.GrammarASTAdaptor.dupTree()

  public GrammarAST dupTree() {
    GrammarAST t = this;
    CharStream input = this.token.getInputStream();
    GrammarASTAdaptor adaptor = new GrammarASTAdaptor(input);
    return (GrammarAST)adaptor.dupTree(t);
  }

  public String toTokenString() {
    CharStream input = this.token.getInputStream();
    GrammarASTAdaptor adaptor = new GrammarASTAdaptor(input);
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.