dcsimg
Unfinished token - how to catch it?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Andrzej_S
Posted On:   Thursday, November 11, 2010 09:21 PM

Hi, I was asked to write a C lexer/parser, and it is expected to return with an error for such "program": /* But as I have COMMENT : '//' .* (' ' | ' ') {$channel = HIDDEN;} | '/*' .* '*/' {$channel = HIDDEN;} ; it hides the error somewhere. How to modify these rules, to catch the "multiline comment end expected" exception? Regards, Andrzej    More>>

Hi,

I was asked to write a C lexer/parser, and it is expected to return with an error for such "program":



/*



But as I have




COMMENT
: '//' .* ('
' | '
') {$channel = HIDDEN;}
| '/*' .* '*/' {$channel = HIDDEN;}
;



it hides the error somewhere.


How to modify these rules, to catch the "multiline comment end expected" exception?


Regards,

Andrzej

   <<Less
About | Sitemap | Contact