[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Husam Senussi wrote:

> Hi There,
> I'm just thinking if we have section called keyword to define the language
> keyword like
> Print,if,... etc and the Lexical generator give them the first priority.
> because I have found problem  In grammar like this
> Helpers
>        l    =['A'-'Z'];
>       d    =['0'-'9'];
> Tokens
>             Id= l (l | d)*
>             if='if'
>             .....
> the  Lexical will peek the first one .

I am not sure to understand your problem. But I have it with my first steps
with SableCC.
So, now I define the keyword (if, then, ..) and then I define the identifier.

Before using SableCC, I try to use (www.antlr.org). This product get an
identifer and then test is to see if it is or if it is not a keyword.

My personal point of view, is that I perfer SableCC, that will be a very
important point in my project.

I hope this will help you.