aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/syntax/default.ml33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/syntax/default.ml b/lib/syntax/default.ml
new file mode 100644
index 0000000..f4bc34e
--- /dev/null
+++ b/lib/syntax/default.ml
@@ -0,0 +1,33 @@
+type pos = Lexing.position * Lexing.position
+type ('a, 'b) variable = { pos : 'a; name : string; index : 'b option }
+
+module Expression = struct
+ type 'a obs
+ type repr = unit
+
+ type variable = { pos : pos; name : string; index : repr option }
+ (**
+ Describe a variable, using the name in capitalized text, and an optionnal
+ index.
+
+ If missing, the index should be considered as [0].
+ *)
+
+ let ident : variable -> repr = fun _ -> ()
+
+ (*
+ Basic values, text, number…
+ *)
+
+ let integer : pos -> string -> repr = fun _ _ -> ()
+ let literal : pos -> string -> repr = fun _ _ -> ()
+
+ (** Call a function. The functions list is hardcoded in lib/lexer.mll *)
+ let function_ : pos -> T.function_ -> repr list -> repr = fun _ _ _ -> ()
+
+ (** Unary operator like [-123] or [+'Text']*)
+ let uoperator : pos -> T.uoperator -> repr -> repr = fun _ _ _ -> ()
+
+ (** Binary operator, for a comparaison, or an operation *)
+ let boperator : pos -> T.boperator -> repr -> repr -> repr = fun _ _ _ _ -> ()
+end