Invalid strings are succeeding?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   John_Faust
Posted On:   Wednesday, September 12, 2001 06:37 PM

I have what I think is a simple parser for arithmetic expressions.
One of the rules is as follows:



			
aefactor
: (NSIGN)?
( aeliteral
| VARIABLE
| LPAREN aexp RPAREN
);




The problem is that I can create a string with a missing LPAREN
and the parser will accept it. In any case, it doesn't seem to
throw a TokenStreamException. On the other hand, if I omit
an RPAREN token, it will declare it invalid. What have I
overlooked here?

Re: Invalid strings are succeeding?

Posted By:   Ric_Klaren  
Posted On:   Tuesday, October 2, 2001 01:16 AM

Depends on the options you use in your grammar/lexer?
About | Sitemap | Contact