[antlr-interest] Modified SQL grammar

Stepan Samarin stepan.samarin at gmail.com
Mon Oct 16 06:12:52 PDT 2006


Hi,

I'm trying to parse a general where-clause, using Oracle 7 SQL grammar
I took from antlr.org. I modified it a bit and now am stuck with the
following:

TYPE BETWEEN 'OFFICE' AND 'FURNITURE'

line 1:1: unexpected token: TYPE

==> Dump of AST <==
where_condition [7]
   AND [88]
   sql_literal [10]
      'FURNITURE' [33]
nil [1]

Actual grammar is in the attachment, but I think the following is not
properly evaluated:
( exp_simple ( "not" )? "between" ) => exp_simple ( "not" )? "between"
exp_simple "and" exp_simple

Help would be really appreciated.

Cheers, Stepan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sql-where-clause.g
Type: application/octet-stream
Size: 11356 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20061016/076d5eeb/attachment-0001.obj 


More information about the antlr-interest mailing list