/** Manually get option node from tree; return null if no defined. */ public static GrammarAST findOptionValueAST(GrammarRootAST root, String option) { GrammarAST options = (GrammarAST)root.getFirstChildWithType(ANTLRParser.OPTIONS); if ( options!=null && options.getChildCount() > 0 ) { for (Object o : options.getChildren()) { GrammarAST c = (GrammarAST)o; if ( c.getType() == ANTLRParser.ASSIGN && c.getChild(0).getText().equals(option) ) { return (GrammarAST)c.getChild(1); } } } return null; }
/** Manually get option node from tree; return null if no defined. */ public static GrammarAST findOptionValueAST(GrammarRootAST root, String option) { GrammarAST options = (GrammarAST)root.getFirstChildWithType(ANTLRParser.OPTIONS); if ( options!=null && options.getChildCount() > 0 ) { for (Object o : options.getChildren()) { GrammarAST c = (GrammarAST)o; if ( c.getType() == ANTLRParser.ASSIGN && c.getChild(0).getText().equals(option) ) { return (GrammarAST)c.getChild(1); } } } return null; }
/** Manually get option node from tree; return null if no defined. */ public static GrammarAST findOptionValueAST(GrammarRootAST root, String option) { GrammarAST options = (GrammarAST)root.getFirstChildWithType(ANTLRParser.OPTIONS); if ( options!=null && options.getChildCount() > 0 ) { for (Object o : options.getChildren()) { GrammarAST c = (GrammarAST)o; if ( c.getType() == ANTLRParser.ASSIGN && c.getChild(0).getText().equals(option) ) { return (GrammarAST)c.getChild(1); } } } return null; }
/** Manually get option node from tree; return null if no defined. */ public static GrammarAST findOptionValueAST(GrammarRootAST root, String option) { GrammarAST options = (GrammarAST)root.getFirstChildWithType(ANTLRParser.OPTIONS); if ( options!=null && options.getChildCount() > 0 ) { for (Object o : options.getChildren()) { GrammarAST c = (GrammarAST)o; if ( c.getType() == ANTLRParser.ASSIGN && c.getChild(0).getText().equals(option) ) { return (GrammarAST)c.getChild(1); } } } return null; }
/** Manually get option node from tree; return null if no defined. */ public static GrammarAST findOptionValueAST(GrammarRootAST root, String option) { GrammarAST options = (GrammarAST)root.getFirstChildWithType(ANTLRParser.OPTIONS); if ( options!=null && options.getChildCount() > 0 ) { for (Object o : options.getChildren()) { GrammarAST c = (GrammarAST)o; if ( c.getType() == ANTLRParser.ASSIGN && c.getChild(0).getText().equals(option) ) { return (GrammarAST)c.getChild(1); } } } return null; }
public void loadImportedGrammars() { if ( ast==null ) return; GrammarAST i = (GrammarAST)ast.getFirstChildWithType(ANTLRParser.IMPORT); if ( i==null ) return; Set<String> visited = new HashSet<>();
public void loadImportedGrammars() { if ( ast==null ) return; GrammarAST i = (GrammarAST)ast.getFirstChildWithType(ANTLRParser.IMPORT); if ( i==null ) return; Set<String> visited = new HashSet<>();
public void loadImportedGrammars() { if ( ast==null ) return; GrammarAST i = (GrammarAST)ast.getFirstChildWithType(ANTLRParser.IMPORT); if ( i==null ) return; Set<String> visited = new HashSet<String>();
GrammarAST RULES = (GrammarAST)g.ast.getFirstChildWithType(ANTLRParser.RULES); List<GrammarAST> rules = new ArrayList<GrammarAST>(RULES.getAllChildrenWithType(ANTLRParser.RULE)); for (GrammarAST mode : g.ast.getAllChildrenWithType(ANTLRParser.MODE)) {
GrammarAST RULES = (GrammarAST)g.ast.getFirstChildWithType(ANTLRParser.RULES); List<GrammarAST> rules = new ArrayList<GrammarAST>(RULES.getAllChildrenWithType(ANTLRParser.RULE)); for (GrammarAST mode : g.ast.getAllChildrenWithType(ANTLRParser.MODE)) {
GrammarAST RULES = (GrammarAST)g.ast.getFirstChildWithType(ANTLRParser.RULES); List<GrammarAST> rules = new ArrayList<GrammarAST>(RULES.getAllChildrenWithType(ANTLRParser.RULE)); for (GrammarAST mode : g.ast.getAllChildrenWithType(ANTLRParser.MODE)) {
GrammarAST RULES = (GrammarAST)g.ast.getFirstChildWithType(ANTLRParser.RULES); List<GrammarAST> rules = new ArrayList<GrammarAST>(RULES.getAllChildrenWithType(ANTLRParser.RULE)); for (GrammarAST mode : g.ast.getAllChildrenWithType(ANTLRParser.MODE)) {
GrammarAST RULES = (GrammarAST)g.ast.getFirstChildWithType(ANTLRParser.RULES); List<GrammarAST> rules = new ArrayList<GrammarAST>(RULES.getAllChildrenWithType(ANTLRParser.RULE)); for (GrammarAST mode : g.ast.getAllChildrenWithType(ANTLRParser.MODE)) {
public void loadImportedGrammars() { if ( ast==null ) return; GrammarAST i = (GrammarAST)ast.getFirstChildWithType(ANTLRParser.IMPORT); if ( i==null ) return; importedGrammars = new ArrayList<Grammar>();
public void loadImportedGrammars() { if ( ast==null ) return; GrammarAST i = (GrammarAST)ast.getFirstChildWithType(ANTLRParser.IMPORT); if ( i==null ) return; importedGrammars = new ArrayList<Grammar>();
GrammarAST RULES = (GrammarAST)ast.getFirstChildWithType(ANTLRParser.RULES); String newRuleText = leftRecursiveRuleWalker.getArtificialOpPrecRule();
GrammarAST RULES = (GrammarAST)ast.getFirstChildWithType(ANTLRParser.RULES); String newRuleText = leftRecursiveRuleWalker.getArtificialOpPrecRule();
GrammarAST RULES = (GrammarAST)ast.getFirstChildWithType(ANTLRParser.RULES); String newRuleText = leftRecursiveRuleWalker.getArtificialOpPrecRule();
GrammarAST RULES = (GrammarAST)ast.getFirstChildWithType(ANTLRParser.RULES); String newRuleText = leftRecursiveRuleWalker.getArtificialOpPrecRule();
GrammarAST RULES = (GrammarAST)ast.getFirstChildWithType(ANTLRParser.RULES); String newRuleText = leftRecursiveRuleWalker.getArtificialOpPrecRule();