[antlr-interest] testLiterals in ANTLR v3?

Olivier Girard ogirard at student.ethz.ch
Tue Sep 19 00:04:46 PDT 2006


Hi, 

I'd like to parse keyword queries using ANTLR v3.0b4.
Such as:
    'key word and query'

This is a list of words (idents), which is fine. But 'and' is a special
keyword too. So I'd like to let my parser recognize this. If I use &&
instead of the keyword 'and', there's no problem. So the grammar would work.

Is there a possibility to check keywords in ANTLR v3 (similar to the
testLiterals option in previous versions)? How can this be done in a simple
way?

Thanks for help.

Best, Olivier



Olivier Girard
MSc Student, ETH Zürich
Dept. of Computer Science

o.girard at gmx.ch
ogirard at student.ethz.ch



More information about the antlr-interest mailing list