As the question says, inside an action visitor I have method overloads of the type:
public override void OnVariableDefinition(Symbol head, SemanticBody body)
But neither head or body[i] where i is an integer seem to link to the AST nodes, only to the symbols (ie what kind of node it is). That's not useful for me, because I'm trying to parse something like:
var a = 10;
And all this tells me is that there is an expression, but not what the expression actually is. The expression is actually parsed correctly after the parser finishes and I inspect the AST, but I don't see how to get the AST nodes from my action while it's still parsing.
As the question says, inside an action visitor I have method overloads of the type:
But neither
head
orbody[i]
wherei
is an integer seem to link to the AST nodes, only to the symbols (ie what kind of node it is). That's not useful for me, because I'm trying to parse something like:And all this tells me is that there is an expression, but not what the expression actually is. The expression is actually parsed correctly after the parser finishes and I inspect the AST, but I don't see how to get the AST nodes from my action while it's still parsing.