X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=inline;f=helm%2Fsoftware%2Fcomponents%2Fgrafite_parser%2FgrafiteParser.mli;h=1413e93fd97409b96518496a0fcf993d61007fe7;hb=a9e037fe189335607ab5d10523c836d8c7717245;hp=6a1980011409c790625df02005b9cb17d70c26ae;hpb=55b82bd235d82ff7f0a40d980effe1efde1f5073;p=helm.git diff --git a/helm/software/components/grafite_parser/grafiteParser.mli b/helm/software/components/grafite_parser/grafiteParser.mli index 6a1980011..1413e93fd 100644 --- a/helm/software/components/grafite_parser/grafiteParser.mli +++ b/helm/software/components/grafite_parser/grafiteParser.mli @@ -25,17 +25,34 @@ type 'a localized_option = LSome of 'a - | LNone of Token.flocation + | LNone of GrafiteAst.loc -type statement = - include_paths:string list -> - LexiconEngine.status -> - LexiconEngine.status * +type ast_statement = (CicNotationPt.term, CicNotationPt.term, - CicNotationPt.term GrafiteAst.reduction, CicNotationPt.obj, string) - GrafiteAst.statement localized_option + CicNotationPt.term GrafiteAst.reduction, + CicNotationPt.term CicNotationPt.obj, string) + GrafiteAst.statement + +exception NoInclusionPerformed of string (* full path *) + +type statement = + ?never_include:bool -> + (* do not call LexiconEngine to do includes, always raise NoInclusionPerformed *) + include_paths:string list -> + LexiconEngine.status -> + LexiconEngine.status * ast_statement localized_option val parse_statement: Ulexing.lexbuf -> statement (** @raise End_of_file *) -val statement: statement Grammar.Entry.e +val statement: unit -> statement Grammar.Entry.e + +(* this callback is called before every grafite statement *) +val set_grafite_callback: + (LexiconEngine.status -> ast_statement -> unit) -> unit + +(* this callback is called before every lexicon command *) +val set_lexicon_callback: + (LexiconEngine.status -> LexiconAst.command -> unit) -> unit +val push : unit -> unit +val pop : unit -> unit