summaryrefslogtreecommitdiffstats
path: root/kexi/doc/dev/kexisql_grammar_notes.txt
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
commit8362bf63dea22bbf6736609b0f49c152f975eb63 (patch)
tree0eea3928e39e50fae91d4e68b21b1e6cbae25604 /kexi/doc/dev/kexisql_grammar_notes.txt
downloadkoffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz
koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip
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
Diffstat (limited to 'kexi/doc/dev/kexisql_grammar_notes.txt')
-rw-r--r--kexi/doc/dev/kexisql_grammar_notes.txt62
1 files changed, 62 insertions, 0 deletions
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); }
+ ;
+
+
+
+
+