[antlr-interest] help

The Researcher researcher0x00 at gmail.com
Wed Apr 13 07:25:05 PDT 2011


I believe I found the cause of your problem.

CREATE  in CREATE OR REPLACE from the input is parsed as
--> sqlplus_file                    paser rule
--> create_object                paser rule
--> create_package_body   paser rule
--> CREATE                       paser rule
--> CREATE : 'create'  ;     lexer rule

So 'CREATE' in the input is being matched against 'create' in the lexer
rules which will always fail because upper case 'CREATE' is not lower case
'create'. Since the lexer has no other alternative, you get the error.

Since I have no experience with ANTLR and case sensitive grammars, the only
quick solution  I can offer is obviously to make the input match the lexer,
or make the lexer match the input.

If you plan to tackle case sensitive parsing with ANTLR you may find the
following helpful.
You can search the mail for help using http://antlr.markmail.org/ or try
Stack Overflow tags using ANTLR at http://stackoverflow.com/tags.

The grammar does try and support case sensitive keywords, but how successful
I can't say.

Eric


More information about the antlr-interest mailing list