package ordinal

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type value =
  1. | Int of int
  2. | Float of float
type interpreter = {
  1. stack : value list;
  2. i : value;
  3. memory : value array;
  4. get_char : unit -> char;
  5. put_string : string -> unit;
}
type interpreter_error =
  1. | StackUnderflow
  2. | TypeError of value
  3. | Break of interpreter
  4. | InvalidDereference
  5. | Unreachable
type word =
  1. | Value of value
  2. | Builtin of interpreter -> (interpreter, interpreter_error) result
  3. | Subroutine of word list
  4. | DoLoop of word list
  5. | BeginUntilLoop of word list
  6. | IfThen of word list
  7. | IfElseThen of word list * word list
type parser_state =
  1. | WordDefinition of string option * word list
  2. | DoLoop of word list
  3. | BeginUntilLoop of word list
  4. | IfThen of word list
  5. | IfElseThen of word list * word list
  6. | String of string list
  7. | VariableDeclaration
type parser_error =
  1. | MisplacedCommentClose
  2. | MisplacedWordDefinition
  3. | MisplacedWordDefinitionClose
  4. | MisplacedStringClose
  5. | MisplacedLoop
  6. | MisplacedUntil
  7. | MisplacedThen
  8. | MisplacedElse
  9. | UnnamedWordDefinition
  10. | UnknownWord of string
  11. | MisplacedVariableDeclaration
  12. | Unreachable
type parser = {
  1. comment_count : int;
  2. state : parser_state list;
  3. words : (string, word list) Hashtbl.t;
  4. memory_count : int;
}
val adjust_arr : 'a array -> int -> 'a -> 'a array
val string_of_string_list : string list -> string
val string_of_parser_error : parser_error -> string
val string_of_interpreter_error : interpreter_error -> string
val get_float : value -> float
val value_of_bool : bool -> value
val bool_of_value : value -> bool
val equal : value -> value -> bool
val not_equal : value -> value -> bool
val less_than : value -> value -> bool
val less_than_equal : value -> value -> bool
val greater_than : value -> value -> bool
val greater_than_equal : value -> value -> bool
val push : interpreter -> value -> interpreter
val pushs : interpreter -> value list -> interpreter
val pop_n : interpreter -> int -> (value list * interpreter, interpreter_error) result
val split_string : string -> String.t list
val builtin_of_string : string -> word option
val parse : parser -> string -> (parser * word option, parser_error) result
val parse_words : parser -> string list -> (parser * word list, parser_error) result
val interpret_begin_until_loop : interpreter -> word list -> (interpreter, interpreter_error) result
val interpret_do_loop : interpreter -> word list -> (interpreter, interpreter_error) result
val interpret_words : interpreter -> word list -> (interpreter, interpreter_error) result
OCaml

Innovation. Community. Security.