Hi Sebastien,

I think your visited file table is a perfectly good solution.  I'm 
pretty sure that my parser will go into an infinite loop when that 
happens.  I should fix that.

Cheers
./m


� wrote:
> 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
> 
> 
> 
> 
> 

This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.



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