Module Parsexp__Parser_automaton_internal

Internal bits used by the generated automaton, not part of the public API

module Public : sig ... end
val raise_error : (__) Public.state -> at_eof:bool -> Parsexp.Parse_error.Private.Reason.t -> _
type context =
| Sexp_comment
| Sexp
val context : (__) Public.state -> context
val set_automaton_state : ('u's) Public.state -> int -> unit
val advance : ('u's) Public.state -> unit

Advance the position counters. advance_eol is for when we read a newline character.

val advance_eol : ('u's) Public.state -> unit
val block_comment_depth : ('u's) Public.state -> int

Number of opened #|

type ('u, 's) action = ('u's) Public.state -> char -> 's -> 's
type ('u, 's) epsilon_action = ('u's) Public.state -> 's -> 's
val add_atom_char : (__) action

Add a character to the atom buffer. add_quoted_atom_char does the same for quoted atoms

val add_quoted_atom_char : (__) action
val add_escaped : (__) action

Add a character that just follows a '\\' and the '\\' itself if necessary.

val add_dec_escape_char : (__) action

escaped_value <- escaped_value * 10 + (char - '0')

These functions make the assumption that char is between '0' and '9'. add_dec_escape_char also assumes the result doesn't overflow. The automaton definition must make sure this is the case.

add_last_dec_escape_char also adds the resulting character to the atom buffer.

val add_last_dec_escape_char : (__) action
val comment_add_last_dec_escape_char : (__) action

Same but for quoted strings inside comments. Useful because it can fail.

val add_hex_escape_char : (__) action

Same as add_dec_escape_char but for hexadicemal escape sequences

val add_last_hex_escape_char : (__) action
val start_sexp_comment : (__) action

Ignore one more full sexp to come

val add_first_char : (__) action

Add the first char of an unquoted atom.

val start_quoted_string : (__) action
val add_token_char : (__) action

Takes note of a control character in quoted atoms or the uninterpreted characters of comments, for which there is no corresponding add_* call (a backslash and the x in "\xff" or any character in a line comment). This does not get called for the opening (start_quoted_string) or closing (push_quoted_atom) quotes themselves.

val opening : (__) action
val closing : (__) action
val push_quoted_atom : (__) action
val start_block_comment : (__) action
val end_block_comment : (__) action
val start_line_comment : (__) action
val end_line_comment : (__) epsilon_action
val eps_push_atom : (__) epsilon_action
val eps_add_first_char_hash : (__) epsilon_action
val eps_eoi_check : (__) epsilon_action
val eps_add_escaped_cr : (__) epsilon_action