antlr4 - Building custom Parse Trees in ANTLR v4 -



antlr4 - Building custom Parse Trees in ANTLR v4 -

question: there (more straightforward) way of building custom parse trees @ parse time in antlr v4?

i guess 1 traverse , rewrite automatically built tree wondering if can still manual tree building (or tweaking, matter) @ parse time (similar antlr v3 , ealier). thought that, depending on how 1 writes his/her grammar, lot of useless nodes in antlr-built tree , while can override listener methods involvement you, 1 still has check , skip useless token types, etc.

no, our experience antlr 3 manual ast feature inevitably resulted in code more hard maintain , understand, leading high rate of regression bugs developers making alter grammar. tokens no longer omitted tree since it's hard tell terminals needed future releases of application, , don't want have change/verify of code operating on parse tree if terminal unused required new component or feature.

antlr4 parse-tree

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -