best way to generate abstract syntaxtree with antlr4

51 views
Skip to first unread message

reich...@gmail.com

unread,
Sep 17, 2014, 3:35:41 AM9/17/14
to antlr-di...@googlegroups.com
Good Morning,
right now, Im trying to generate a abstrct syntaxtree with antlr4 based on the give Java8 grammar on https://github.com/antlr/grammars-v4.
It all works fine. I can generate Listeners and Visitors and also execute the implementation of them.

Now I want to know, is there a better way to generate an abstract syntaxtree based on a self defined class structure with the following
requirements:

- strict separation of grammar and java code.

- Dont use setter / getter. Just use the constructors of the classes to initialize them and set their parameters.

The last requirement shows some Problems for me....... I cant see a good solution to do so....

Can anyone help me here to solve these problem?

Thanks a lot   :-)

Benny
Reply all
Reply to author
Forward
0 new messages