Combining grammars

12 views
Skip to first unread message

Mohan Radhakrishnan

unread,
Jul 12, 2016, 6:29:44 AM7/12/16
to antlr-discussion
Hi,
       I am using the Java.g4 grammar now. I walk the tree and write the code back after modifying.

       Is there a way to specify a grammar that I can plugin to the master grammar ? This could modify specific parts of the code. I have seen Java code in a grammar file(http://stackoverflow.com/questions/11551038/combining-antlr-and-code-files).

Can I look at a simpler example ? Let's assume I want to delete the parameters of some methods. Can I specify this as an extension grammar and have Antlr remove it instead of visiting the tree and removing it myself ?

Thanks,
Mohan
Reply all
Reply to author
Forward
0 new messages