[antlr-interest] grammar to latex

Ana Nelson nelson.ana at gmail.com
Sat May 31 05:57:01 PDT 2008


Maybe try pygments? Or some other syntax highlighter with LaTeX support.
You'd just have to write/adapt a grammar definition for
ANTLR-and-your-target-language.

I think that would be easier and more maintainable than writing your own
custom output templates from scratch, even with StringTemplate :-), and you
would be able to output other formats (besides LaTeX, e.g. HTML) for free.

In fact, out of curiosity I just ran 'pygmentize' on one of my java-based
ANTLR grammar files using the java lexer and it didn't blow up. The results
weren't perfect but I was able to paste them into a latex file and render
it.

-Ana



2008/5/31 Felix Dorner <felix_do at web.de>:

> Hi,
>
> Converting my antlr grammar to readable format (cursive nonterminals,
> typewriter terminals, filter actions) in latex is a pain. I looked for a
> grammar to latex converter, but didn' t find anything suitable. This would
> be a cool antlr+stringtemplate translator huh?
>
> Maybe someone has already done this?
>
>
> Felix
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080531/930b7beb/attachment-0001.html 


More information about the antlr-interest mailing list