DB2 DDL Parser using ANTLR 3

364 views
Skip to first unread message

Jawad Ahmed

unread,
Oct 8, 2013, 4:23:11 AM10/8/13
to antlr-di...@googlegroups.com
Hi,

I am implementing the DB2 DDL parser. I am facing an issue "Decision can match input such as "DATA" using multiple alternatives: 1, 2". I have mapped the Create Table syntax diagrams from DB2 documentation to my ANTLR grammar. There is a typed_table_options which has all optional tokens/clauses and ANTLR works showed that these paths are making multiple alternatives.

I have also posted the details on stackoverflow. The link is http://stackoverflow.com/questions/19218141/db2-ddl-parser-using-antlr-3.

I am attaching the snapshots of the ANTLR Works and DB2 syntax diagram.

Please help me in this regard.
ANTLR_Work_Img.jpg
Db2_img.jpg

Jim Idle

unread,
Oct 8, 2013, 4:47:39 AM10/8/13
to antlr-di...@googlegroups.com, antlr-di...@googlegroups.com
You will want to disambiguate with syntactic predicates and sometimes keywords can be identifiers. 

x: CREATE ((Tok)=>optional))? Etc

Single token predicates usually do it with SQL. 

Jim
--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
<ANTLR_Work_Img.jpg>
<Db2_img.jpg>

Jawad Ahmed

unread,
Dec 10, 2014, 3:54:42 AM12/10/14
to antlr-di...@googlegroups.com
Thanks Jim. This is what I need.
Reply all
Reply to author
Forward
0 new messages