Access grammar metadata?

33 views
Skip to first unread message

Chang Liu

unread,
Nov 1, 2013, 11:01:52 AM11/1/13
to antlr-di...@googlegroups.com
Hello,
 
While I am using ANTLR to define a grammar with say grammar.g file, is it possible to access its metadata such as how many prodution rules are there, what are the choices for a production rule, etc.? I browsed ANTLR API doc, did not find anything quite relevant to this with my bare eyes.
 
Any tips on this would be highly appreciated.
 
Thanks,
Chang

Terence Parr

unread,
Nov 1, 2013, 11:18:00 AM11/1/13
to antlr-di...@googlegroups.com
Try Grammar (v4) object in tools part of software.
Ter


--
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/groups/opt_out.



--
Dictation in use. Please excuse homophones, malapropisms, and nonsense. 

Chang Liu

unread,
Nov 1, 2013, 3:43:29 PM11/1/13
to antlr-di...@googlegroups.com
Thanks for the advice!
 
I did some more study on ANTLR 4 Documentation. Seems like the notion of ATN is relevant to this requirement. Is this the right direction for me?

Terence Parr

unread,
Nov 1, 2013, 7:11:13 PM11/1/13
to antlr-di...@googlegroups.com
The grammar should answer questions about rules and then rules have ATN submachines with list of alts known to the Rule object. yep :)
Ter
Reply all
Reply to author
Forward
0 new messages