boolean rootAlreadyHasRule = rootRuleNames.contains(name); if ( !rootAlreadyHasRule ) { RULES.addChild(r); // merge in if not overridden rootRuleNames.add(name);
lexerOptionsRoot.addChild(optionTree); lexerAST.setOption(optionName, (GrammarAST)optionTree.getChild(1)); String ruleName = r.getChild(0).getText(); if (Grammar.isTokenName(ruleName)) { lexerRulesRoot.addChild((Tree)adaptor.dupTree(r)); rulesWeMoved.add(r); blk.addChild(alt); CommonToken idToken = new CommonToken(ANTLRParser.TOKEN_REF, rname); litRule.addChild(new TerminalAST(idToken)); litRule.addChild(blk); lexerRulesRoot.insertChild(insertIndex, litRule);
channelsRoot.addChild(imp_channelRoot.getChild(c).dupNode()); destinationAST.addChild(m.getChild(0).dupNode()); boolean rootAlreadyHasRule = rootRuleNames.contains(ruleName); if (!rootAlreadyHasRule) { destinationAST.addChild(r); addedRules++; rootRuleNames.add(ruleName); boolean rootAlreadyHasRule = rootRuleNames.contains(name); if ( !rootAlreadyHasRule ) { RULES.addChild(r); // merge in if not overridden rootRuleNames.add(name);
lexerOptionsRoot.addChild(optionTree); lexerAST.setOption(optionName, (GrammarAST)optionTree.getChild(1)); String ruleName = r.getChild(0).getText(); if (Grammar.isTokenName(ruleName)) { lexerRulesRoot.addChild((Tree)adaptor.dupTree(r)); rulesWeMoved.add(r); blk.addChild(alt); CommonToken idToken = new CommonToken(ANTLRParser.TOKEN_REF, rname); litRule.addChild(new TerminalAST(idToken)); litRule.addChild(blk); lexerRulesRoot.insertChild(insertIndex, litRule);
channelsRoot.addChild(imp_channelRoot.getChild(c).dupNode()); destinationAST.addChild(m.getChild(0).dupNode()); boolean rootAlreadyHasRule = rootRuleNames.contains(ruleName); if (!rootAlreadyHasRule) { destinationAST.addChild(r); addedRules++; rootRuleNames.add(ruleName); boolean rootAlreadyHasRule = rootRuleNames.contains(name); if ( !rootAlreadyHasRule ) { RULES.addChild(r); // merge in if not overridden rootRuleNames.add(name);
lexerOptionsRoot.addChild(optionTree); lexerAST.setOption(optionName, (GrammarAST)optionTree.getChild(1)); String ruleName = r.getChild(0).getText(); if (Grammar.isTokenName(ruleName)) { lexerRulesRoot.addChild((Tree)adaptor.dupTree(r)); rulesWeMoved.add(r); blk.addChild(alt); CommonToken idToken = new CommonToken(ANTLRParser.TOKEN_REF, rname); litRule.addChild(new TerminalAST(idToken)); litRule.addChild(blk); lexerRulesRoot.insertChild(insertIndex, litRule);
boolean rootAlreadyHasRule = rootRuleNames.contains(name); if ( !rootAlreadyHasRule ) { RULES.addChild(r); // merge in if not overridden rootRuleNames.add(name);
lexerOptionsRoot.addChild(optionTree); lexerAST.setOption(optionName, (GrammarAST)optionTree.getChild(1)); String ruleName = r.getChild(0).getText(); if (Grammar.isTokenName(ruleName)) { lexerRulesRoot.addChild((Tree)adaptor.dupTree(r)); rulesWeMoved.add(r); blk.addChild(alt); CommonToken idToken = new CommonToken(ANTLRParser.TOKEN_REF, rname); litRule.addChild(new TerminalAST(idToken)); litRule.addChild(blk); lexerRulesRoot.insertChild(insertIndex, litRule);
channelsRoot.addChild(imp_channelRoot.getChild(c).dupNode()); destinationAST.addChild(m.getChild(0).dupNode()); boolean rootAlreadyHasRule = rootRuleNames.contains(ruleName); if (!rootAlreadyHasRule) { destinationAST.addChild(r); addedRules++; rootRuleNames.add(ruleName); boolean rootAlreadyHasRule = rootRuleNames.contains(name); if ( !rootAlreadyHasRule ) { RULES.addChild(r); // merge in if not overridden rootRuleNames.add(name);
lexerOptionsRoot.addChild(optionTree); lexerAST.setOption(optionName, (GrammarAST)optionTree.getChild(1)); String ruleName = r.getChild(0).getText(); if (Grammar.isTokenName(ruleName)) { lexerRulesRoot.addChild((Tree)adaptor.dupTree(r)); rulesWeMoved.add(r); blk.addChild(alt); CommonToken idToken = new CommonToken(ANTLRParser.TOKEN_REF, rname); litRule.addChild(new TerminalAST(idToken)); litRule.addChild(blk); lexerRulesRoot.insertChild(insertIndex, litRule);
root.addChild(adaptor.create(Token.EPSILON, "EPSILON")); root.deleteChild(0); return root;