[antlr-interest] Source positions for imaginary tokens

Mike Lischke mike at lischke-online.de
Mon Sep 10 23:29:34 PDT 2012


> For instance like this: lb=LBRACE block RBRACE ^(DUM[$lb,"SLIST"] block)
> 
> The imaginary token DUM will get the position information of the left
> brace and will show in the AST tree as SLIST.
> 
> I got this information from the reference (book of TParr).


Unfortunately, this doesn't work with all targets. For instance the C target has a bug that prevents the use of things like DUM[$lb].

Mike
-- 
www.soft-gems.net




More information about the antlr-interest mailing list