I have some problem with traversing the AST, produced by ANTLR. I Have some grammar like
{{{
definition : classType Identifier ('=' expression)?
| classType classMethod;
get : (KW_GET definition (from)? (where)?)
| (KW_GET aggregation '(' definition ')' (from)? (where)?)
| (aggregation '(' KW_GET definition (from)? (where)?')');
}}}
The point is that visitor finds the second level definitions, but doesn't visit sub definitions in the get rule.
{{{
public class DefinitionVisitor extends SMLGrammarBaseListener {
@Override
public void exitDefinition(DefinitionContext ctx) {
String id = ctx.Identifier().getText();
String type = ctx.classType().getText();
}
}}}
Tree from TestRig is fine.
Thanks for your help!