]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/grafite_parser/grafiteParser.ml
Invert dependencies between baseuris (files) are now stored in the db.
[helm.git] / helm / software / components / grafite_parser / grafiteParser.ml
index ea74231adb46762d2a5c41e7af435b0855a38e62..481d49f08db75716160add58d1d42958c41effef 100644 (file)
@@ -51,11 +51,11 @@ type 'status parser_status = {
   statement : #LE.status as 'status statement Grammar.Entry.e;
 }
 
-let grafite_callback = ref (fun _ -> ())
-let set_grafite_callback cb = grafite_callback := Obj.magic cb
+let grafite_callback = ref (fun _ -> ())
+let set_grafite_callback cb = grafite_callback := cb
 
-let lexicon_callback = ref (fun _ -> ())
-let set_lexicon_callback cb = lexicon_callback := Obj.magic cb
+let lexicon_callback = ref (fun _ -> ())
+let set_lexicon_callback cb = lexicon_callback := cb
 
 let initial_parser () = 
   let grammar = CicNotationParser.level2_ast_grammar () in
@@ -262,8 +262,10 @@ EXTEND
         G.NLetIn (loc,where,t,name)
     | kind = nreduction_kind; p = pattern_spec ->
         G.NReduce (loc, kind, p)
-    | IDENT "nrewrite"; dir = direction; what = tactic_term ; where = pattern_spec ->
+    | IDENT "nrewrite"; dir = direction; what = tactic_term ; where = pattern_spec ->  
         G.NRewrite (loc, dir, what, where)
+    | IDENT "ntry"; LPAREN ; tac = SELF ; RPAREN -> G.NTry (loc,tac)
+    | IDENT "nassumption" -> G.NAssumption loc
     | SYMBOL "#"; n=IDENT -> G.NIntro (loc,n)
     | SYMBOL "#"; SYMBOL "_" -> G.NIntro (loc,"_")
     | SYMBOL "*" -> G.NCase1 (loc,"_")
@@ -938,19 +940,19 @@ EXTEND
     [ ex = executable ->
        fun ?(never_include=false) ~include_paths status ->
           let stm = G.Executable (loc, ex) in
-          Obj.magic !grafite_callback status stm;
+          !grafite_callback stm;
          status, LSome stm
     | com = comment ->
        fun ?(never_include=false) ~include_paths status -> 
           let stm = G.Comment (loc, com) in
-          Obj.magic !grafite_callback status stm;
+          !grafite_callback stm;
          status, LSome stm
     | (iloc,fname,normal,mode) = include_command ; SYMBOL "."  ->
        fun ?(never_include=false) ~include_paths status ->
          let stm =
             G.Executable (loc, G.Command (loc, G.Include (iloc, normal, fname)))
          in
-          Obj.magic !grafite_callback status stm;
+          !grafite_callback stm;
          let _root, buri, fullpath, _rrelpath = 
             Librarian.baseuri_of_script ~include_paths fname 
           in
@@ -964,7 +966,7 @@ EXTEND
          status, LSome stm
     | scom = lexicon_command ; SYMBOL "." ->
        fun ?(never_include=false) ~include_paths status ->
-          !lexicon_callback status scom;         
+          !lexicon_callback scom;        
          let status = LE.eval_command status scom in
           status, LNone loc
     | EOI -> raise End_of_file