Replies: 2 comments 1 reply
-
The generated code is correct. You will get additional classes and methods defined for the alt labels. Alt labels serve as a convenience in identifying which alt is used in the parse. They come in handy in avoiding But, they aren't necessary. One can usually find some identifying structure of the children that quickly sort out what alt applies. For tree traverse engines like XPath, it's not necessary. Further, you are constrained to define a label for all alts whether you need them or not. |
Beta Was this translation helpful? Give feedback.
-
Generally I don't call VisitChildren(). The problem is that VisitChildren() will call AggregateResult(), and you would then have to override the default implementation. You may as well just call VisitXXXXX(), get the result as you do already, and deal with the aggregation yourself which you already do. Less assumptions, less chance of it breaking. |
Beta Was this translation helpful? Give feedback.
-
Take a look at this grammar snippet:
When I run this through Antler to gen C# Visitor/Listener, I see these two classes:
and
I'm not really clear on what I should expect but seeing a class named after
declareStmt
and another after it's labelDeclaration
is driving my brain crazy trying to make sense of it!Beta Was this translation helpful? Give feedback.
All reactions