Hi all,
I am a newbie, using antlr to parse sql language.  we have a statement
CREATE USER, where USER is not a keyword, so that
CREATE TABLE TBL(USER int) is acceptable. But my parser came across a
problem:
mydb> create table tbl(user int);
FAILED: Parse Error: line 1:17 mismatched input 'user' expecting Identifier
in column specification

here is grammar snippets

createUserStatement
@init { msgs.push("create user statement"); }
@after { msgs.pop(); }
    : KW_CREATE USER userItem (COMMA userItem)*
    -> ^(TOK_CREATEUSER userItem+)
    ;

userItem
@init { msgs.push("user item"); }
@after { msgs.pop(); }
    : (Identifier (KW_IDENTIFIED KW_BY StringLiteral)?)
    -> ^(TOK_USER Identifier StringLiteral?)
    ;


USER: 'USER'

Identifier
    :
    (Letter | Digit) (Letter | Digit | '_')*
    | '`' RegexComponent+ '`'
    ;

anyone help me on this?
Thanks in advance!


Min
-- 
My research interests are distributed systems, parallel computing and
bytecode based virtual machine.

My profile:
http://www.linkedin.com/in/coderplay
My blog:
http://coderplay.javaeye.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to