Le 12 nov. 2010 à 18:36, Michael Matera a écrit :

> Hi Sebastien,
> 
> There's an ANTLR wiki entry that shows how to do this:
> 
>> http://www.antlr.org/wiki/pages/viewpage.action?pageId=557057
> 
> It works by inserting tokens into your token stream which has the effect 
> of generating an AST at the point of the require.

The last code snippet perfectly fits my need. It's a shame that I don't use the 
"include" keyword when I googled my problem.


However, another simple question: How to handle properly cyclic inclusions?  I 
basically use a "visitedFile" table declared as a parser member. When I start 
the 'sub-parser', I set its visited table to the current one. And after the end 
of the sub-parse, I set mine to the one available in the sub-parser. 

Is there another solution? Mine looks like a hack :S

Cheers, 

--
 Sébastien Mosser
 http://sebastien-mosser.fr





List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to