List of usage examples for org.antlr.v4.tool.ast GrammarAST getChildrenAsArray
public GrammarAST[] getChildrenAsArray()
From source file:org.opencypher.tools.grammar.Antlr4ToolFacade.java
License:Apache License
private static RuleAST lastGoodRule(GrammarAST ast) { ast = (GrammarAST) ast.getFirstChildWithType(GrammarTreeVisitor.RULES); if (ast == null) { return null; }//from ww w .j a v a2 s . c o m RuleAST last = null; for (GrammarAST rule : ast.getChildrenAsArray()) { if (rule instanceof RuleAST) { last = (RuleAST) rule; } else { return last; } } return null; }