How to specify javadoc class comment in .g4?

29 views
Skip to first unread message

David Biesack

unread,
Jul 5, 2016, 4:51:57 PM7/5/16
to antlr-discussion
How does one inject a Javadoc class comment into a parser class created by an ANTLR 4 grammar?

I put a Javadoc comment in @parser::header but it is emitted before all the generated ANTLR import statements. Thus when I run Javadoc on the resulting parser source, the comment is not associated with the class... my parser class has no class-level Javadoc.

I'm using ANTLR 4 with -no-listener because I've not yet converted the v3 actions to listeners (no need yet).

Jim Idle

unread,
Jul 5, 2016, 7:41:27 PM7/5/16
to antlr-di...@googlegroups.com
I am not sure it's worth it. It is generated code after all. But perhaps an easier way is to tell the grammar to inherit from a superclass and document the bejesus out of that. This is often very useful anyway so I do it as a matter of course. 

That said I thought there was a way to make this happen just by putting havoc comments in the grammar somewhere, but I could be mistaken. 


Jim
--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages