Mlang.Parse_utils
Helpers for parsing
A parsed variable can be a regular variable or an integer literal
val mk_position : (Stdlib.Lexing.position * Stdlib.Lexing.position) -> Pos.t
val parse_variable :
(Stdlib.Lexing.position * Stdlib.Lexing.position) ->
string ->
Mast.variable
Checks whether the variable contains parameters
Checks whether the string is entirely capitalized
val parse_variable_or_int :
(Stdlib.Lexing.position * Stdlib.Lexing.position) ->
string ->
parse_val
val parse_table_size : string -> Mast.table_size
Checks whether is it actually an integer
val parse_literal :
(Stdlib.Lexing.position * Stdlib.Lexing.position) ->
string ->
Com.literal
val parse_atom :
(Stdlib.Lexing.position * Stdlib.Lexing.position) ->
string ->
Mast.variable Com.atom
val parse_function_name : string Pos.marked -> Com.func Pos.marked
val parse_if_then_etc :
(Mast.expression Pos.marked option * Mast.instruction Pos.marked list * Pos.t)
list ->
Mast.instruction
val parse_when_do_etc :
((Mast.expression Pos.marked * Mast.instruction Pos.marked list * Pos.t) list
* Mast.instruction Pos.marked list Pos.marked) ->
Mast.instruction
type target_header =
| Target_apps of Mast.application Pos.marked list |
| Target_input_arg of string Pos.marked list |
| Target_tmp_vars of (string Pos.marked * Mast.table_size Pos.marked option) list |
| Function_result of string Pos.marked |
val parse_target_or_function_header :
string Pos.marked ->
bool ->
target_header Pos.marked list ->
Mast.application Pos.marked StrMap.t
* string Pos.marked list
* (string Pos.marked * Mast.table_size Pos.marked option) StrMap.t
* string Pos.marked option