Posted By:
Monty_Zukowski
Posted On:
Tuesday, May 1, 2001 06:59 AM
Here's what I did in my AREV parser.
literalID
: d:("function"
| "select"
| "lt"
| "delete"
| "osdelete"
| "null"
| "loop"
| "on"
| "off"
| "clearselect"
| "clearfile"
| "flush"
| "readnext"
| "data"
)
{#literalID.setType(ID);
}
;
id: d:literalID
| ID
;
Then when you use these rules you have to be aware of antlr's ambiguity warnings, and use syntactic predicates when necessary. I don't have any simple examples from my AREV grammar, so post your own example if you run into trouble and I'll help fix it.