]> matita.cs.unibo.it Git - helm.git/commitdiff
parser and pretty printer corrected and tested
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Mon, 16 Sep 2002 13:09:08 +0000 (13:09 +0000)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Mon, 16 Sep 2002 13:09:08 +0000 (13:09 +0000)
helm/ocaml/mathql/mQueryTParser.mly
helm/ocaml/mathql/mQueryUtil.ml
helm/ocaml/mathql/mathQL.ml

index 7bb6be3c43484cfebf34e7a020178fa1d3680b19..a90c90e71d63b20f8dd14212ed99f3b7192f719d 100644 (file)
@@ -42,7 +42,9 @@
    %left     DIFF WHERE REFOF  
    %left     OR UNION
    %left     AND INTER
-   %nonassoc NOT EX IN STR ATTR
+   %nonassoc STR
+   %nonassoc NOT EX IN ATTR
+
    %start    qstr query result
    %type     <string>        qstr      
    %type     <MathQL.query>  query
index dc6b6997f36c82260f5597cb3a58887ff0a65436..73006b60675994d0a5e8b5d69ed7718600d52b3f 100644 (file)
@@ -54,11 +54,11 @@ let text_of_query x =
       | M.SuperOp -> "super "
    in
    let txt_vvar_list l =
-      txt_list txt_vvar "," l
+      txt_list txt_vvar ", " l
    in
    let rec txt_val = function
       | M.Const [s]           -> txt_qstr s
-      | M.Const l             -> "{" ^ txt_list txt_qstr "," l ^ "}"
+      | M.Const l             -> "{" ^ txt_list txt_qstr ", " l ^ "}"
       | M.VVar vv             -> txt_vvar vv
       | M.Record (rv, vv)     -> txt_rvar rv ^ "." ^ txt_vvar vv
       | M.Fun (s, x)          -> "fun " ^ txt_qstr s ^ " " ^ txt_val x
@@ -93,14 +93,14 @@ let text_of_query x =
 let text_of_result x sep =
    let txt_attr = function
       | (s, []) -> txt_qstr s
-      | (s, l)  -> txt_qstr s ^ "=" ^ txt_list txt_qstr "," l
+      | (s, l)  -> txt_qstr s ^ "=" ^ txt_list txt_qstr ", " l
    in
-   let txt_group l = "{" ^ txt_list txt_attr ";" l ^ "}" in
+   let txt_group l = "{" ^ txt_list txt_attr "; " l ^ "}" in
    let txt_res = function
       | (s, []) -> txt_qstr s 
-      | (s, l)  -> txt_qstr s ^ " attr " ^ txt_list txt_group "," l
+      | (s, l)  -> txt_qstr s ^ " attr " ^ txt_list txt_group ", " l
    in   
-   let txt_set l = txt_list txt_res (";" ^ sep) l in
+   let txt_set l = txt_list txt_res ("; " ^ sep) l in
    txt_set x
 
 let query_of_text lexbuf =
index 5ccdf79d77440f0e30f91c3c239f8903bf53b462..b424d110b56bc8247b6fa8b750487668bf603842 100644 (file)
@@ -74,7 +74,7 @@ and boole_exp = False
 and val_exp = Const of string list 
             | RefOf of set_exp 
            | Record of rvar * vvar
-           | VVar of string
+           | VVar of vvar
            | Fun of string * val_exp
            | Attribute of refine_op * string * val_exp