I just found that ANTLR V3 would firstly turn input file stream into tokens, then the parser started to work.Is there anyway to set the token buffer length? Check the following Lexer rule:
IDENT : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')* { if (!parser.isFirst) $type=globalSearchId($text); } ; Function globalSearchId depends on what the current scope is to search the ID. Current scope is already recorded in the first pass and is updated when parser moving forward. So in the second pass if the token stream buffer is very long, before feeding the tokens to Parser, all tokens have been recognized and globalSearchId has been called N times. However, because Parser hasn't started to work, the current scope couldn't be updated. So calling globalSearchId always returns null. I checked the Java target Runtime DOC , found no such interfaces to modify the token stream buffer length. Best Regards, chainone --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to il-antlr-interest@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address