[antlr-interest] Typesetting grammars

Rene Vestergaard vester at jaist.ac.jp
Sun May 1 05:19:08 PDT 2011


I can't seem to find any information on automatically type-setting ANTLR 
grammars, i.e., on exporting a given grammar in a manner similar to how 
ANTLRWorks' syntax diagrams work, except that the target is LaTeX, 
formatted html, or similar.

There's a Pygments mode, but it syntax-highlights everything, including 
actions, it seems. I was playing around with the code and it also 
doesn't seem to behave in an entirely predictable manner when you change 
things. I wrote a quick filter to get rid of everything not BNF-like in 
the Pygments output but it requires annotations with comments in the 
ANTLR file and, while it's one time to do, I'm not sure I like the end 
result: there are just too many levels in play within a given specification.

Please tell me I have missed something, and that type-setting is catered 
to already. I mean, it shouldn't be too hard to re-target the ANTLRWorks 
code ...

Cheers,
Rene


More information about the antlr-interest mailing list