[antlr-interest] Newbie: NoViableAltException

Cameron Esfahani dirty at apple.com
Tue Jul 24 17:12:00 PDT 2007


Ah, I was trying to come up with a good explanation and Randall's is  
so much better...

On Jul 24, 2007, at 5:10 PM, Randall R Schulz wrote:

>> I still don't get it.
>>
>> Don't the parser rules indicate what lexer rule to use? If you have
>> the following:
>
> Nope. Again, the lexical analyzer operates independently and  
> essentially
> asynchronously w.r.t. the parser. The parser _DOES NOT_ direct the
> actions of the scanner.
>
>
>> IDENT EQUALS (PCHAR)*
>>
>> The IDENT lexer rule would not get called for any tokens to the RHS
>> of the EQUALS sign, right? I declared it only gets called for the
>> LHS.
>
> Scanner rules are NOT "called" by the parser. They are used to  
> partition
> the input stream and assign token type codes to each sub-sequence of
> the input. Then, when that's all done and the entire input is broken
> into tokens, the parser starts in on those tokens.
>

Cameron Esfahani
dirty at apple.com

"Americans are very skilled at creating a custom meaning from  
something that's mass-produced."

Ann Powers


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070724/05e95283/attachment.html 


More information about the antlr-interest mailing list