X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2FmatitaScript.mli;h=df3ec4e1e358a840b62096f9420f457d0713d3c1;hb=7fb4b063ed9488bbffa34d1cd193fca6c288a425;hp=cdcb5a544863a5bccc1ebe416108655455e3b334;hpb=642e20a0135126586603ffb539f0d1c1428f1502;p=helm.git diff --git a/helm/matita/matitaScript.mli b/helm/matita/matitaScript.mli index cdcb5a544..df3ec4e1e 100644 --- a/helm/matita/matitaScript.mli +++ b/helm/matita/matitaScript.mli @@ -1,4 +1,4 @@ -(* Copyright (C) 2005, HELM Team. +(* Copyright (C) 2004-2005, HELM Team. * * This file is part of HELM, an Hypertextual, Electronic * Library of Mathematics, developed at the Computer Science @@ -23,23 +23,55 @@ * http://helm.cs.unibo.it/ *) - (** script failures (e.g. going before the beginning or after the end of the - * script) *) -exception Script_failure of string - class type script = - object - (** script window used by this script *) - method win: MatitaGeneratedGui.scriptWin +object + + (** @return current status *) + method status: MatitaTypes.status + + (** {2 Observers} *) + + method addObserver : (MatitaTypes.status -> unit) -> unit + + (** {2 History} *) + + method advance : ?statement:string -> unit -> unit + method retract : unit -> unit + method goto: [`Top | `Bottom | `Cursor] -> unit -> unit + method reset: unit -> unit + + (** {2 Load/save} *) + + method loadFrom : string -> unit + method saveTo : string -> unit + + (** {2 Current proof} (if any) *) + + (** @return true if there is an ongoing proof, false otherise *) + method onGoingProof: unit -> bool + + method proofStatus: ProofEngineTypes.status (** @raise Statement_error *) + method proofMetasenv: Cic.metasenv (** @raise Statement_error *) + method proofContext: Cic.context (** @raise Statement_error *) + + method setGoal: int -> unit + + (* debug *) + method dump : unit -> unit - (** fill text buffer reading a script from a file *) - method loadFrom: string -> unit +end - (** adds a tactical at current script execution point and execute it. Used - * when the user uses buttons or console instead of directly editing the - * script *) - method advance: DisambiguateTypes.tactical -> MatitaTypes.command_outcome - end +val script: + buffer:GText.buffer -> + init:MatitaTypes.status -> + mathviewer: MatitaTypes.mathViewer-> + urichooser: (string list -> string list) -> + unit -> + script -val script: interpreter:MatitaTypes.interpreter -> script +(* each time script above is called an internal ref is set, instance will return + * the value of this ref *) +(* TODO Zack: orrible solution until we found a better one for having a single + * access point for the script *) +val instance: unit -> script