[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SQL grammar
From: |
RichardT |
Subject: |
Re: SQL grammar |
Date: |
Thu, 8 May 2008 08:59:52 -0700 (PDT) |
Hi. Also, here is a simplified version of my bison file. You can just copy
and paste it in a file and compile it with:
bison -y -v -d file_name.y
%token NOT IN UNION ICONST SELECT FROM SCONST
%left UNION
%left '+' '-'
%left '*' '/'
%%
search_cond: NOT IN '(' exp_list ')'
| NOT IN '(' query_list ')'
;
exp_list: exp_list ',' expression
| expression
;
query_list: query_list UNION query_list
| '(' query_list ')'
| query_specification
;
expression: ICONST
| expression '+' expression
| expression '-' expression
| expression '/' expression
| expression '*' expression
| '(' expression ')'
| '(' query_specification ')'
;
query_specification: SELECT '*' FROM table
;
table: SCONST
;
%%
--
View this message in context:
http://www.nabble.com/SQL-grammar-tp17127516p17127524.html
Sent from the Gnu - Bison - Help mailing list archive at Nabble.com.