At 21:35 15/01/2009, chain one wrote:
>I want to only parse the beginning of a file. And I don't want 
>the recognizer to beak the whole file into huge number of tokens 
>which will make the memory consuming very high.
>So after the lexer having recognized one specified TOKEN such as 
>";", I want to tell the lexer to stop, and pass the tokens to the 
>parser.
>Is it possible in C runtime target? If it is, could you tell me 
>how?

I don't think you can do it directly in the grammar, but you 
should be able to override some methods in the lexer or the stream 
to do that.  (And yes, you *can* override methods in the C target; 
it's just slightly trickier than in Java or C#.)


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