[antlr-interest] Keywords can appear in expressions

Dimitrios Kolovos dskolovos at gmail.com
Thu Jan 5 04:38:09 PST 2006


Hi,

In my language some keywords can also appear in expressions e.g.

*operation* doSomething() {}

and

object.operation.name;

When I declare the "operation" keyword like that,

OPERATION : "operation";

it is recognized as keyword in the second case as well.

What I think might work is to declare OPERATION as (' ' | '\t' | '\n') 
"operation" (' ' | '\t' | '\n') but I don't want characters before or 
after "operation" to be consumed. Any ideas on how to do this?

Cheers,
Dimitrios


More information about the antlr-interest mailing list