comparison src/urweb.grm @ 389:acaf9d19fbb7

num working for int
author Adam Chlipala <adamc@hcoop.net>
date Tue, 21 Oct 2008 10:34:07 -0400
parents 260b680a6a04
children fe8f75f7e130
comparison
equal deleted inserted replaced
388:2e93d18daf44 389:acaf9d19fbb7
156 val e = (EApp (e, sqlexp1), loc) 156 val e = (EApp (e, sqlexp1), loc)
157 in 157 in
158 (EApp (e, sqlexp2), loc) 158 (EApp (e, sqlexp2), loc)
159 end 159 end
160 160
161 fun native_unop (oper, e1, loc) =
162 let
163 val e = (EVar (["Basis"], oper), loc)
164 val e = (EApp (e, (EWild, loc)), loc)
165 in
166 (EApp (e, e1), loc)
167 end
168
161 fun native_op (oper, e1, e2, loc) = 169 fun native_op (oper, e1, e2, loc) =
162 let 170 let
163 val e = (EVar (["Basis"], oper), loc) 171 val e = (EVar (["Basis"], oper), loc)
164 val e = (EApp (e, (EWild, loc)), loc) 172 val e = (EApp (e, (EWild, loc)), loc)
165 val e = (EApp (e, e1), loc) 173 val e = (EApp (e, e1), loc)
181 EOF 189 EOF
182 | STRING of string | INT of Int64.int | FLOAT of Real64.real 190 | STRING of string | INT of Int64.int | FLOAT of Real64.real
183 | SYMBOL of string | CSYMBOL of string 191 | SYMBOL of string | CSYMBOL of string
184 | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE 192 | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE
185 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | UNDER | UNDERUNDER | BAR 193 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | UNDER | UNDERUNDER | BAR
186 | DIVIDE | DOTDOTDOT 194 | PLUS | MINUS | DIVIDE | DOTDOTDOT | MOD
187 | CON | LTYPE | VAL | REC | AND | FUN | FOLD | UNIT | KUNIT | CLASS 195 | CON | LTYPE | VAL | REC | AND | FUN | FOLD | UNIT | KUNIT | CLASS
188 | DATATYPE | OF 196 | DATATYPE | OF
189 | TYPE | NAME 197 | TYPE | NAME
190 | ARROW | LARROW | DARROW | STAR | SEMI 198 | ARROW | LARROW | DARROW | STAR | SEMI
191 | FN | PLUSPLUS | MINUSMINUS | DOLLAR | TWIDDLE 199 | FN | PLUSPLUS | MINUSMINUS | DOLLAR | TWIDDLE
333 %right CAND 341 %right CAND
334 %nonassoc EQ NE LT LE GT GE 342 %nonassoc EQ NE LT LE GT GE
335 %right ARROW 343 %right ARROW
336 %left WITH 344 %left WITH
337 %right PLUSPLUS MINUSMINUS 345 %right PLUSPLUS MINUSMINUS
338 %right STAR 346 %left PLUS MINUS
347 %left STAR DIVIDE MOD
339 %left NOT 348 %left NOT
340 %nonassoc TWIDDLE 349 %nonassoc TWIDDLE
341 %nonassoc DOLLAR 350 %nonassoc DOLLAR
342 %left DOT 351 %left DOT
343 %nonassoc LBRACE RBRACE 352 %nonassoc LBRACE RBRACE
680 in 689 in
681 (EApp (e, (EAbs ("_", SOME t, eexp2), loc)), loc) 690 (EApp (e, (EAbs ("_", SOME t, eexp2), loc)), loc)
682 end) 691 end)
683 | eexp EQ eexp (native_op ("eq", eexp1, eexp2, s (eexp1left, eexp2right))) 692 | eexp EQ eexp (native_op ("eq", eexp1, eexp2, s (eexp1left, eexp2right)))
684 | eexp NE eexp (native_op ("ne", eexp1, eexp2, s (eexp1left, eexp2right))) 693 | eexp NE eexp (native_op ("ne", eexp1, eexp2, s (eexp1left, eexp2right)))
694 | MINUS eterm (native_unop ("neg", eterm, s (MINUSleft, etermright)))
695 | eexp PLUS eexp (native_op ("plus", eexp1, eexp2, s (eexp1left, eexp2right)))
696 | eexp MINUS eexp (native_op ("minus", eexp1, eexp2, s (eexp1left, eexp2right)))
697 | eterm STAR eexp (native_op ("times", eterm, eexp, s (etermleft, eexpright)))
698 | eexp DIVIDE eexp (native_op ("div", eexp1, eexp2, s (eexp1left, eexp2right)))
699 | eexp MOD eexp (native_op ("mod", eexp1, eexp2, s (eexp1left, eexp2right)))
685 | eexp WITH cterm EQ eexp (EWith (eexp1, cterm, eexp2), s (eexp1left, eexp2right)) 700 | eexp WITH cterm EQ eexp (EWith (eexp1, cterm, eexp2), s (eexp1left, eexp2right))
686 701
687 eargs : earg (earg) 702 eargs : earg (earg)
688 | eargl (eargl) 703 | eargl (eargl)
689 704