X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fgrafite_parser%2FgrafiteParser.ml;h=2a5d3c0b0777fe500bef007004befa0e436167c4;hb=6bd0d331d096d862754b42f9a7fb8af1b823685d;hp=7fbd499680f728714ca305a7b0c50019b265c727;hpb=b225178112c2c5ef1a717ac7e647d854d94b2e52;p=helm.git diff --git a/helm/software/components/grafite_parser/grafiteParser.ml b/helm/software/components/grafite_parser/grafiteParser.ml index 7fbd49968..2a5d3c0b0 100644 --- a/helm/software/components/grafite_parser/grafiteParser.ml +++ b/helm/software/components/grafite_parser/grafiteParser.ml @@ -181,8 +181,39 @@ EXTEND ]; using: [ [ using = OPT [ IDENT "using"; t = tactic_term -> t ] -> using ] ]; ntactic: [ - [ IDENT "napply"; t = tactic_term -> - GrafiteAst.NApply (loc, t) + [ IDENT "napply"; t = tactic_term -> GrafiteAst.NApply (loc, t) + | IDENT "nassert"; + seqs = LIST0 [ + hyps = LIST0 + [ id = IDENT ; SYMBOL ":" ; ty = tactic_term -> id,`Decl ty + | id = IDENT ; SYMBOL ":" ; ty = tactic_term ; + SYMBOL <:unicode> ; bo = tactic_term -> + id,`Def (bo,ty)]; + SYMBOL <:unicode>; + concl = tactic_term -> (List.rev hyps,concl) ] -> + GrafiteAst.NAssert (loc, seqs) + | IDENT "ncases"; what = tactic_term ; where = pattern_spec -> + GrafiteAst.NCases (loc, what, where) + | IDENT "nchange"; what = pattern_spec; "with"; with_what = tactic_term -> + GrafiteAst.NChange (loc, what, with_what) + | IDENT "nelim"; what = tactic_term ; where = pattern_spec -> + GrafiteAst.NElim (loc, what, where) + | IDENT "ngeneralize"; p=pattern_spec -> + GrafiteAst.NGeneralize (loc, p) + | IDENT "nletin"; name = IDENT ; SYMBOL <:unicode> ; t = tactic_term; + where = pattern_spec -> + GrafiteAst.NLetIn (loc,where,t,name) + | IDENT "nrewrite"; dir = direction; what = tactic_term ; where = pattern_spec -> + GrafiteAst.NRewrite (loc, dir, what, where) + | IDENT "nwhd"; delta = OPT [ IDENT "nodelta" -> () ]; + where = pattern_spec -> + let delta = match delta with None -> true | _ -> false in + GrafiteAst.NEval (loc, where, `Whd delta) + | SYMBOL "#"; n=IDENT -> GrafiteAst.NIntro (loc,n) + | SYMBOL "#"; SYMBOL "_" -> GrafiteAst.NIntro (loc,"_") + | SYMBOL "*" -> GrafiteAst.NCase1 (loc,"_") + | SYMBOL "*"; n=IDENT -> + GrafiteAst.NCase1 (loc,n) ] ]; tactic: [ @@ -744,7 +775,9 @@ EXTEND GrafiteAst.Tactic (loc, Some tac, punct) | punct = punctuation_tactical -> GrafiteAst.Tactic (loc, None, punct) | tac = ntactic; punct = punctuation_tactical -> - GrafiteAst.NTactic (loc, Some tac, punct) + GrafiteAst.NTactic (loc, tac, punct) + | SYMBOL "#" ; SYMBOL "#" ; punct = punctuation_tactical -> + GrafiteAst.NTactic (loc, GrafiteAst.NId loc, punct) | tac = non_punctuation_tactical; punct = punctuation_tactical -> GrafiteAst.NonPunctuationTactical (loc, tac, punct) | mac = macro; SYMBOL "." -> GrafiteAst.Macro (loc, mac)