On Wed, Oct 11, 2006 at 10:56:39PM +0200, Mehmet Yavuz Selim Soyturk wrote: > I have rewritten the grammar. There are some problems though. > > - I don't know how to express thinks like: an identifier is > <[a..zA..Z_$]>*, but not a <keyword>. Something like: rule identifier > {<!keyword><[a..zA..Z_$]>*} seems not to allow identifiers that have > keywords as prefix.
For now, try adding a \b at the ends of the <keyword> rule: token keyword { \b [ if | else | for | while | ... ] \b } Then <keyword> will match only the exact keyword. However, the "\b" metacharacter is disappearing soon, to be replaced by <?wb> and <!wb>. In its place will be "<<" and ">>", making the above: token keyword { << [ if | else | for | while | ... ] >> } I'll get << and >> added into PGE today/tomorrow. > - I couldn't make comments work. > - I don't know how to handle unicode, > - How to accomplish semicolon insertion? I'll have to look at the grammar a bit and see what I can come up with here. Pm