[antlr-interest] De-emphasizing tree grammars?

Jason Osgood jason at jasonosgood.com
Mon Dec 26 12:01:33 PST 2011


Hi Terence.


re: ParseTreeVisitor

Thanks for the direct links. Yup, that's exactly what I want.

One caveat. Please don't use the term "Visitor". That's an overloaded
term. ParseEventListener (or some such) is clear and concise and
familiar.


> With a single decision, I had stripped away 2 large pieces of work: AST
> specification and tree grammar specification.

Less is more. Good job.


> As Kyle points out, a big benefit of this automatic parse tree construction and listener
> event mechanism is that it renders grammars 100% reusable and retargetable to any
> target programming language.

Awesome. The power of modular interfaces. My use case is the opposite:
multiple grammars to a single target. I tried and tried to figure out
how to support multiple SQL grammars in a generic manner. As described
upthread, event listener with path expressions was the only tractable
solution I could find.


> Sam Harwell has convinced me to include things like skip in setting channels in
> the lexer with special syntax rather than actions? again we get retargeting.

Some day I hope to understand what you just said. :)


I'll sit tight with my current solution until v4. Thanks for your hard
work and creativity, Terence. I'm having a lot of fun. (With my gf
teasing me in the background "You're such a geek!").


Cheers, Jason


More information about the antlr-interest mailing list