package ordinal

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module OrdinalSource

Sourcetype value =
  1. | Int of int
  2. | Float of float
Sourcetype interpreter = {
  1. stack : value list;
  2. i : value;
  3. memory : value array;
  4. get_char : unit -> char;
  5. put_string : string -> unit;
}
Sourcetype interpreter_error =
  1. | StackUnderflow
  2. | TypeError of value
  3. | Break of interpreter
  4. | InvalidDereference
  5. | Unreachable
Sourcetype 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
Sourcetype 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
Sourcetype 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
Sourcetype parser = {
  1. comment_count : int;
  2. state : parser_state list;
  3. words : (string, word list) Hashtbl.t;
  4. memory_count : int;
}
Sourceval adjust_arr : 'a array -> int -> 'a -> 'a array
Sourceval string_of_string_list : string list -> string
Sourceval string_of_parser_error : parser_error -> string
Sourceval string_of_interpreter_error : interpreter_error -> string
Sourceval get_float : value -> float
Sourceval value_of_bool : bool -> value
Sourceval bool_of_value : value -> bool
Sourceval equal : value -> value -> bool
Sourceval not_equal : value -> value -> bool
Sourceval less_than : value -> value -> bool
Sourceval less_than_equal : value -> value -> bool
Sourceval greater_than : value -> value -> bool
Sourceval greater_than_equal : value -> value -> bool
Sourceval pushs : interpreter -> value list -> interpreter
Sourceval split_string : string -> String.t list
Sourceval builtin_of_string : string -> word option
Sourceval parse : parser -> string -> (parser * word option, parser_error) result
Sourceval parse_words : parser -> string list -> (parser * word list, parser_error) result
Sourceval interpret_begin_until_loop : interpreter -> word list -> (interpreter, interpreter_error) result
Sourceval interpret_do_loop : interpreter -> word list -> (interpreter, interpreter_error) result
Sourceval interpret_words : interpreter -> word list -> (interpreter, interpreter_error) result