Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Parser module
Exceptions
class bag_exception : string -> object ... end
class outofbound : string -> object ... end
class arg : string -> object ... end
class type_error : string -> object ... end
class syntax_error : string -> object ... end
Type argument: every primitive type the language recognize
type parameters =
| CallExpression of string
| Argument of arguments
| GOTO of string
| LOAD of string
| Exception of bag_exception
| Label of string
| IF
| COND
| Array
| TBL of parameters array
| Function of string * string list
Type parameters: every structure the language recognize
Type AST
Printing utility
val print_argument : arguments -> string
Transforms an argument into a string Type: value
val print_lit_argument : arguments -> string
Transforms only the value of an argument
val print_argument_for_repl : arguments -> string
Transform an argument into a string for the REPL
val print_parameter : ?fortbl:bool -> parameters -> string
Transforms a parameter into a string
val print_pretty_arguments : parameters list -> string
Transform a list of parameters into a string representation
val print_pretty_node : parameters ast -> string
Pretty-print (transforms into a string) an AST
Parsing methods
val parse_string_rec : Token.token_type list -> string * Token.token_type list
Parse a string recursively until it encounters a closing quote
val ast_list_to_string_list : parameters ast list -> string list
val parse_line :
Token.token_type list ->
Token.token_type list * parameters ast list
Parse a line (a list of tokens) into a a list of ASTs
val parse_file : Token.token_type list -> parameters ast list
Parse a file using parse line
Parameters/Arguments utility functions
val create_int_argument : int -> parameters
Creates an integer argument and wraps it into a parameter
val create_float_argument : float -> parameters
Creates a float argument and wraps it into a parameter
val create_bool_argument : bool -> parameters
Creates a boolean argument and wraps it into a parameter
val create_string_argument : string -> parameters
Creates a string argument and wraps it into a parameter
Parameters algebra function
val add_numbers : parameters -> parameters -> parameters
Adds two parameters
val equality : parameters -> parameters -> parameters
Checks for equality between two parameters
val inferior_large : parameters -> parameters -> parameters
Checks for the <= between two parameters
val inferior : parameters -> parameters -> parameters
Checks for the < between two parameters
val superior_large : parameters -> parameters -> parameters
Checks for the >= between two parameters
val superior : parameters -> parameters -> parameters
Checks for the > between two parameters
val mult_numbers : parameters -> parameters -> parameters
Multiply two numbers
val expn : parameters -> parameters -> parameters
Exponentiate a^b
val divide_numbers : parameters -> parameters -> parameters
Divide a/b
val substract_numbers : parameters -> parameters -> parameters
Subtract two number
val apply_binary_operator :
(bool -> bool -> bool) ->
parameters ->
parameters ->
parameters
Apply a binary operator for two booleans
val apply_unary_operator : (bool -> bool) -> parameters -> parameters
Apply an unary operator on a boolean