]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql/mQueryTParser.mly
structurated attribute names added
[helm.git] / helm / ocaml / mathql / mQueryTParser.mly
index 1228155e6ca7ed9c41e4dc959e3e3fe351c8acab..7bc2f97bf2162389d5433e8942b6333c5b9d2e1a 100644 (file)
@@ -53,7 +53,7 @@
       and an_boole = function
          | M.False       -> []
          | M.True        -> []
-         | M.Ex _ _      -> []
+         | M.Ex _        -> []
          | M.Not x       -> an_boole x
          | M.And (x, y)  -> join (an_boole x) (an_boole y)
          | M.Or (x, y)   -> join (an_boole x) (an_boole y)
       | STR CM strs { $1 :: $3 }
       | STR         { [$1]     } 
    ;
-   vvars:
-      | vvar CM vvars { $1 :: $3 }
-      | vvar          { [$1]     }
+   subpath:
+      | STR SL subpath { $1 :: $3 }
+      | STR            { [$1]     } 
    ;
    path:
-      | STR SL path { $1 :: $3 }
-      | STR         { [$1]     } 
-   ;
-   ref:
-      | SUB   { MathQL.SubOp   }
-      | SUPER { MathQL.SuperOp }
-      |       { MathQL.ExactOp }
-   ;
+      | STR SL subpath { ($1, $3) }
+      | STR            { ($1, []) }
+   ;   
    inv:
       | INV { true  }
       |     { false }
    ;
+   ref:
+      | SUB   { MathQL.RefineSub   }
+      | SUPER { MathQL.RefineSuper }
+      |       { MathQL.RefineExact }
+   ;
    val_exp:
       | STR                         { MathQL.Const [$1]                 } 
       | FUN STR val_exp             { MathQL.Fun ($2, $3)               }
       | ATTRIB inv ref path val_exp { MathQL.Attribute ($2, $3, $4, $5) }
-      | rvar FS vvar                { MathQL.Record ($1, $3)            }
+      | rvar FS path                { MathQL.Record ($1, $3)            }
       | vvar                        { MathQL.VVar $1                    }
       | LC strs RC                  { MathQL.Const $2                   }
       | LC RC                       { MathQL.Const []                   }
       | PAT val_exp                            { MathQL.Pattern $2                } 
       | LP set_exp RP                          { $2                               }
       | SELECT rvar IN set_exp WHERE boole_exp { MathQL.Select ($2, $4, $6)       }
-      | REL inv ref path set_exp ATTR vvars    { MathQL.Relation ($2, $3, $4, $5, $7) }
+      | REL inv ref path set_exp ATTR strs     { MathQL.Relation ($2, $3, $4, $5, $7) }
       | REL inv ref path set_exp               { MathQL.Relation ($2, $3, $4, $5, []) }
       | svar                                   { MathQL.SVar $1                   }
       | rvar                                   { MathQL.RVar $1                   }
       | set_exp EOF { $1 }
    ;
    attr:
-      | STR IS strs { ($1, $3) }
-      | STR         { ($1, []) }
+      | path IS strs { ($1, $3) }
+      | path         { ($1, []) }
    ;
    attrs:
       | attr SC attrs { $1 :: $3 }
    resources:
       | resource SC resources { $1 :: $3 }
       | resource              { [$1]     }
-      |                           { []       }
+      |                       { []       }
    ;   
    result:
       | resources EOF { $1 }