[antlr-interest] Antwort: Templates for ANTLR post processing ?

arnulf.heller at cnsystems.at arnulf.heller at cnsystems.at
Tue Oct 21 03:48:30 PDT 2008


antlr-interest-bounces at antlr.org schrieb am 21.10.2008 12:12:42:

> 
> Hello, 
> 
> I'd like to further process some of ANTLR's output (e.g. the 
> contents of the .tokens file). 
> 
> Would it be possible to submit a string template to ANTLR that is 
> called during the generation process ? 

You might also consider writing a backend for ANTLR. As ANTLR parses a 
grammar file, it builds up internal data structures which are subsequently 
handled to the string templates of the target language.

These data structures do have complete knowledge of you grammar because 
they are used to build the parser.

There is an article on the wiki which describes how to build a backend. 
You are in the lucky situation that you don't need to write the runtime 
thus it should be pretty easy to do that.

> 
> Freundliche Grüße / Best Regards
> Lars von Wedel
> _________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081021/bf08e2e2/attachment.html 


More information about the antlr-interest mailing list