aboutsummaryrefslogtreecommitdiff
path: root/lib/syntax/analyzer.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/syntax/analyzer.ml')
-rw-r--r--lib/syntax/analyzer.ml43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/syntax/analyzer.ml b/lib/syntax/analyzer.ml
new file mode 100644
index 0000000..22c1696
--- /dev/null
+++ b/lib/syntax/analyzer.ml
@@ -0,0 +1,43 @@
+module type T = sig
+ type ex
+ (** The type is not given, but we do not have much choice. Because of
+ recursive definition, the type is left blank here, but constraint will be
+ defined later, and this type shall be a [ex] *)
+
+ val depends : ex list
+ (** Dependencies are module required to be executed before. The result for
+ them can be accessed with the ctx argument given in the functions *)
+
+ val identifier : string
+ (** Identifier for the module *)
+
+ val description : string
+ (** Short description*)
+
+ val active : bool ref
+ (** Is the test active or not *)
+
+ val is_global : bool
+ (** Declare the checker as global. It requires to run over the whole file and
+ will be disabled if the application only check a single location.
+
+ Also, the test will be disabled if a syntax error is reported during the
+ parsing, because this tell that I haven’t been able to analyse the whole
+ source code. *)
+
+ type context
+ (** Context used to keep information during the whole test *)
+
+ val initialize : unit -> context
+ (** Initialize the context before starting to parse the content *)
+
+ module Expression : S.Expression
+ module Instruction : S.Instruction with type expression := Expression.t'
+
+ module Location :
+ S.Location
+ with type instruction := Instruction.t'
+ and type context := context
+
+ val finalize : context -> (string * Report.t) list
+end