Hello everyone
First of all, a very big thank you for the Python2 target and runtime.
The basic listener interface works fine but I am having some trouble with the visitor and I am wondering if some things operate differently in this target, please see below:
1) I thought that the default behaviour for each visitor's rules is to visit its children (?) The way the abstract [grammar]Visitor is set-up none of its descendants will be called automatically. (There is simply a pass) (?)
2) A look at the super of my visitor's class does not seem to contain anything hinting at visitChildren or visit([sometree]). Should i be carrying out the checks on which rule method to call next myself?
3) I thought about substituting the "pass" of my abstract visitor's methods with calls to ParseTreeVisitor.someMethod (anything hinting towards visit or visitChildren) but ParseTreeVisitor does not seem to have any relevant methods :/
My test case is a very simple grammar that parses nested lists like:
"[1,2,3,4,5,[11,12,13,14,15,[21,22,23,24,25],17],7]"
Ultimately, I would like to have the visitor return a Python object of the same structure rather than having a listener create objects but at the moment, all I want to do is retrieve the numbers (i.e. override just 1 of the two rules in my grammar and have the other one call its standard implementation).
Any ideas?
Looking forward to hearing from you
AA