comparison src/urweb.grm @ 470:7cb418e9714f

Tree demo works
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Nov 2008 18:49:38 -0500
parents 3f1b9231a37b
children 20fab0e96217
comparison
equal deleted inserted replaced
469:b393c2fc80f8 470:7cb418e9714f
212 | UNION | INTERSECT | EXCEPT 212 | UNION | INTERSECT | EXCEPT
213 | LIMIT | OFFSET | ALL 213 | LIMIT | OFFSET | ALL
214 | TRUE | FALSE | CAND | OR | NOT 214 | TRUE | FALSE | CAND | OR | NOT
215 | COUNT | AVG | SUM | MIN | MAX 215 | COUNT | AVG | SUM | MIN | MAX
216 | ASC | DESC 216 | ASC | DESC
217 | INSERT | INTO | VALUES | UPDATE | SET | DELETE | NULL 217 | INSERT | INTO | VALUES | UPDATE | SET | DELETE | NULL | IS
218 | CURRENT_TIMESTAMP 218 | CURRENT_TIMESTAMP
219 | NE | LT | LE | GT | GE 219 | NE | LT | LE | GT | GE
220 220
221 %nonterm 221 %nonterm
222 file of decl list 222 file of decl list
344 %nonassoc DCOLON TCOLON 344 %nonassoc DCOLON TCOLON
345 %left UNION INTERSECT EXCEPT 345 %left UNION INTERSECT EXCEPT
346 %right COMMA 346 %right COMMA
347 %right OR 347 %right OR
348 %right CAND 348 %right CAND
349 %nonassoc EQ NE LT LE GT GE 349 %nonassoc EQ NE LT LE GT GE IS
350 %right ARROW 350 %right ARROW
351 %right PLUSPLUS MINUSMINUS 351 %right PLUSPLUS MINUSMINUS
352 %left PLUS MINUS 352 %left PLUS MINUS
353 %left STAR DIVIDE MOD 353 %left STAR DIVIDE MOD
354 %left NOT 354 %left NOT
1234 in 1234 in
1235 (ECApp (e, (CName CSYMBOL, loc)), loc) 1235 (ECApp (e, (CName CSYMBOL, loc)), loc)
1236 end 1236 end
1237 end) 1237 end)
1238 1238
1239 | LBRACE LBRACK eexp RBRACK RBRACE (eexp)
1240
1239 | sqlexp EQ sqlexp (sql_compare ("eq", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right))) 1241 | sqlexp EQ sqlexp (sql_compare ("eq", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right)))
1240 | sqlexp NE sqlexp (sql_compare ("ne", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right))) 1242 | sqlexp NE sqlexp (sql_compare ("ne", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right)))
1241 | sqlexp LT sqlexp (sql_compare ("lt", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right))) 1243 | sqlexp LT sqlexp (sql_compare ("lt", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right)))
1242 | sqlexp LE sqlexp (sql_compare ("le", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right))) 1244 | sqlexp LE sqlexp (sql_compare ("le", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right)))
1243 | sqlexp GT sqlexp (sql_compare ("gt", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right))) 1245 | sqlexp GT sqlexp (sql_compare ("gt", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right)))
1244 | sqlexp GE sqlexp (sql_compare ("ge", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right))) 1246 | sqlexp GE sqlexp (sql_compare ("ge", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right)))
1245 1247
1246 | sqlexp CAND sqlexp (sql_binary ("and", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right))) 1248 | sqlexp CAND sqlexp (sql_binary ("and", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right)))
1247 | sqlexp OR sqlexp (sql_binary ("or", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right))) 1249 | sqlexp OR sqlexp (sql_binary ("or", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right)))
1248 | NOT sqlexp (sql_unary ("not", sqlexp, s (NOTleft, sqlexpright))) 1250 | NOT sqlexp (sql_unary ("not", sqlexp, s (NOTleft, sqlexpright)))
1251
1252 | sqlexp IS NULL (let
1253 val loc = s (sqlexpleft, NULLright)
1254 in
1255 (EApp ((EVar (["Basis"], "sql_is_null", Infer), loc),
1256 sqlexp), loc)
1257 end)
1249 1258
1250 | LBRACE eexp RBRACE (sql_inject (#1 eexp, 1259 | LBRACE eexp RBRACE (sql_inject (#1 eexp,
1251 s (LBRACEleft, RBRACEright))) 1260 s (LBRACEleft, RBRACEright)))
1252 | LPAREN sqlexp RPAREN (sqlexp) 1261 | LPAREN sqlexp RPAREN (sqlexp)
1253 1262