/[svn]/parser/parser.ml
ViewVC logotype

Diff of /parser/parser.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 14 by abate, Tue Jul 10 16:57:45 2007 UTC revision 15 by abate, Tue Jul 10 16:57:55 2007 UTC
# Line 47  Line 47 
47      [ e1 = expr; e2 = expr -> mk loc (Apply (e1,e2))      [ e1 = expr; e2 = expr -> mk loc (Apply (e1,e2))
48      ]      ]
49    
50        |
51        [ e1 = expr; "+"; e2 = expr -> mk loc (BinaryOp (Op.add,e1,e2))  ]
52    
53      | "no_appl"      | "no_appl"
54      [ c = const -> mk loc (Cst c)      [ c = const -> mk loc (Cst c)
55      | "("; l = LIST1 expr SEP ","; ")" -> tuple loc l      | "("; l = LIST1 expr SEP ","; ")" -> tuple loc l
# Line 117  Line 120 
120        | "("; a = LIDENT; ":="; c = const; ")" -> mk loc (Constant (a,c))        | "("; a = LIDENT; ":="; c = const; ")" -> mk loc (Constant (a,c))
121        | a = UIDENT -> mk loc (PatVar a)        | a = UIDENT -> mk loc (PatVar a)
122        | i = INT ; "--"; j = INT ->        | i = INT ; "--"; j = INT ->
123            let i = int_of_string i and j = int_of_string j in            let i = Big_int.big_int_of_string i
124              and j = Big_int.big_int_of_string j in
125            mk loc (Internal (Types.interval i j))            mk loc (Internal (Types.interval i j))
126        | i = char ; "--"; j = char ->        | i = char ; "--"; j = char ->
127            mk loc (Internal (Types.char_class i j))            mk loc (Internal (Types.char_class i j))
# Line 153  Line 157 
157    
158    const:    const:
159      [      [
160        [ i = INT -> Types.Integer (int_of_string i)        [ i = INT -> Types.Integer (Big_int.big_int_of_string i)
161        | x = STRING -> Types.String (Token.eval_string x)  (*      | x = STRING -> Types.String (Token.eval_string x) *)
162        | "`"; a = [LIDENT | UIDENT] -> Types.Atom (Types.mk_atom a)        | "`"; a = [LIDENT | UIDENT] -> Types.Atom (Types.mk_atom a)
163        | c = char -> Types.Char c ]        | c = char -> Types.Char c ]
164      ];      ];

Legend:
Removed from v.14  
changed lines
  Added in v.15

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5