diff src/lacweb.grm @ 14:f1c36df29ed7

Primitive type constants
author Adam Chlipala <adamc@hcoop.net>
date Sun, 08 Jun 2008 12:27:08 -0400
parents d89477f07c1e
children 1e645beb3f3b
line wrap: on
line diff
--- a/src/lacweb.grm	Sun Jun 08 11:32:48 2008 -0400
+++ b/src/lacweb.grm	Sun Jun 08 12:27:08 2008 -0400
@@ -36,6 +36,7 @@
 
 %term 
    EOF
+ | STRING of string | INT of Int64.int | FLOAT of Real64.real
  | SYMBOL of string | CSYMBOL of string
  | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE
  | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH
@@ -155,6 +156,10 @@
        | SYMBOL                         (EVar SYMBOL, s (SYMBOLleft, SYMBOLright))
        | LBRACE rexp RBRACE             (ERecord rexp, s (LBRACEleft, RBRACEright))
 
+       | INT                            (EPrim (Prim.Int INT), s (INTleft, INTright))
+       | FLOAT                          (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright))
+       | STRING                         (EPrim (Prim.String STRING), s (STRINGleft, STRINGright))
+
 rexp   :                                ([])
        | ident EQ eexp                  ([(ident, eexp)])
        | ident EQ eexp COMMA rexp       ((ident, eexp) :: rexp)