Greetings! On Fri, 2010-12-03 at 07:05 -0800, Daniel Rippel wrote: > > I am fairly new to antlr and am running into a basic issue that I can't quite > find the answer for on the wiki and in Parr's book. > > Here is my lexer. Greatly simplified of course. > > ... > CREATE : 'create' ; > ... > IDENTIFIER : (['a'..'z']|['A'..'Z'])(['a'..'z']|['A'..'Z']|['0'..'9'])+ ; > did you really mean to use the [ and ] above? those aren't valid syntax here. [] are used to surround parameters being passed to a rule. use () instead...
> Basically, I want 'create' to be a keyword token. > And something like 'createFoo' should be an identifier. > > However, the lexer always finds 'create' stops and gives me the CREATE token > back. > > I have tried using the greedy flag but am not having any luck. > > Any ideas or suggestions would be extremely helpful. > I'll even accept an RTFM, if you can point me to the page in the FM. > once you replace the [] with () i see no problem with this fragment. maybe try to create the smallest (yet complete) grammar that exhibits your problem. and post that. sorry for not being very helpful.... -jbb List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
