A small problem
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, August 12, 2008 02:53 AM

Hi, i want to read a line of text from a file. The line is "aaa was acquired by bbb". the lexer i wrote was: CompName : ('a'..'z' | 'A'..'Z')+;//for aaa and bbb Was : ("Was"|"was");//for was Acq :("acquired" | "Acquired");//for acquired The parser is: acquire : CompName Was Acq (By)? CompName Semi; but the error is expecting Was, found 'was' please do help me....    More>>

Hi,

i want to read a line of text from a file.
The line is "aaa was acquired by bbb".



the lexer i wrote was:

CompName : ('a'..'z' | 'A'..'Z')+;//for aaa and bbb


Was : ("Was"|"was");//for was


Acq :("acquired" | "Acquired");//for acquired




The parser is:

acquire : CompName Was Acq (By)? CompName Semi;




but the error is

expecting Was, found 'was'



please do help me....

   <<Less

Re: A small problem

Posted By:   h_ala  
Posted On:   Monday, August 25, 2008 08:15 AM

I think it is about the lexer statements order

Acq :('acquired' | 'Acquired');
Was : ('Was'|'was');
By : ('by' | 'By') ;
Semi : ';' ;
CompName : ('a'..'z' | 'A'..'Z')+;
About | Sitemap | Contact