From 8362bf63dea22bbf6736609b0f49c152f975eb63 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 20 Jan 2010 01:29:50 +0000 Subject: Added old abandoned KDE3 version of koffice git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kexi/doc/dev/kexisql_grammar_notes.txt | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 kexi/doc/dev/kexisql_grammar_notes.txt (limited to 'kexi/doc/dev/kexisql_grammar_notes.txt') diff --git a/kexi/doc/dev/kexisql_grammar_notes.txt b/kexi/doc/dev/kexisql_grammar_notes.txt new file mode 100644 index 00000000..9f80ed69 --- /dev/null +++ b/kexi/doc/dev/kexisql_grammar_notes.txt @@ -0,0 +1,62 @@ +/* Jaroslaw Staniek: + TAKEN FROM his compiler's parser + AS EXAMPLE FOR LUCIJAN'S KEXISQL PARSER */ + + + +exp: exp3 { $$->prn(); } + | exp OR exp3 { $$ = new NOpLog($1,OR,$3); $$->prn(); } + ; +exp3: exp3n {/*default*/} + | exp3 AND exp3n { $$ = new NOpLog($1,AND,$3); } + ; +exp3n: exp2 {/*default*/} + | NOT exp3n { $$ = new NOp1arg(NOT,$2); } + ; +exp2: exp1 {/*default*/} + | exp1 op_rel exp1 { $$ = new NOpRel($1,$2,$3); } + ; +exp1: exp0 {/*default*/} + | exp1 op_ar1 exp0 { $$ = new NOpAr($1,$2,$3); } + ; +exp0: exp_poj {/*default*/} + | exp0 op_ar0 exp_poj { $$ = new NOpAr($1,$2,$3); } + ; + + + + +* prior.2 - relational oper. */ +op_rel: '=' { $$='='; } + | '<' { $$='<'; } + | '>' { $$='>'; } + | "<=" { $$=REL_LESS_EQ; } + | ">=" { $$=REL_GREAT_EQ; } + | "<>" { $$=REL_NOT_EQ; } + ; +/* prior.1 - arytmetic oper. +,- */ +op_ar1: '+' { $$='+'; } + | '-' { $$='-'; } + ; +/* prior.0 - arytmetic oper. *,/ */ +op_ar0: '*' { $$='*'; } + | '/' { $$='/'; } + ; +exp_single: single {/*default*/} + | '(' exp ')' { /*$$=new NOp1arg(0, $2);*/ $$=$2; } + | '-' exp_single %prec OP_MINUS { $$=new NOp1arg('-', $2); } + | '+' exp_single %prec OP_PLUS { $$=new NOp1arg('+', $2); } + ; +single: const {/*default*/} + | variable {/*default*/ } + | function_call {/*default*/} + +const: CONST_BOOL { $$ = new NConstBool(yylval.bval); } + | CONST_INT { $$ = new NConstInt(yylval.ival); } + | CONST_STR { $$ = new NConstStr(yylval.sval); } + ; + + + + + -- cgit v1.2.1