[antlr-interest] Newbie: NoViableAltException

Buck, Robert rbuck at verisign.com
Tue Jul 24 18:13:05 PDT 2007


It clarified things for me quite a bit. Not quite sure how I'd write a
parser in ANTLR for the sort of syntax, if its possible, but now I
understand the issue.

Bob

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org 
> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of 
> Cameron Esfahani
> Sent: Tuesday, July 24, 2007 8:12 PM
> To: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Newbie: NoViableAltException
> 
> 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
> 
> 
> 


More information about the antlr-interest mailing list