Zee3.Smt2.Parser (zee3 v0.3.0)

Copy Markdown

A NimbleParsec implementation for parsing SMT-LIB2 S-Expressions.

This is exposed as a public module, although most users will not want to parse any S-expressions directly. This module is used internally to parse the values returned by the solver.

Summary

Functions

Parses exactly one S-Expression from the given binary.

Parses multiple S-Expressions from the given binary, skipping any whitespace.

Parses the given binary as parse_multiple.

Parses the given binary as parse_single.

Functions

build_bin_bitvec(chars)

build_hex_bitvec(chars)

build_list(elements)

build_string(chars)

build_sym_or_int(chars)

build_symbol(chars)

parse(binary)

Parses exactly one S-Expression from the given binary.

parse_many(binary)

Parses multiple S-Expressions from the given binary, skipping any whitespace.

parse_multiple(binary, opts \\ [])

@spec parse_multiple(binary(), keyword()) ::
  {:ok, [term()], rest, context, line, byte_offset}
  | {:error, reason, rest, context, line, byte_offset}
when line: {pos_integer(), byte_offset},
     byte_offset: non_neg_integer(),
     rest: binary(),
     reason: String.t(),
     context: map()

Parses the given binary as parse_multiple.

Returns {:ok, [token], rest, context, position, byte_offset} or {:error, reason, rest, context, line, byte_offset} where position describes the location of the parse_multiple (start position) as {line, offset_to_start_of_line}.

To column where the error occurred can be inferred from byte_offset - offset_to_start_of_line.

Options

  • :byte_offset - the byte offset for the whole binary, defaults to 0
  • :line - the line and the byte offset into that line, defaults to {1, byte_offset}
  • :context - the initial context value. It will be converted to a map

parse_single(binary, opts \\ [])

@spec parse_single(binary(), keyword()) ::
  {:ok, [term()], rest, context, line, byte_offset}
  | {:error, reason, rest, context, line, byte_offset}
when line: {pos_integer(), byte_offset},
     byte_offset: non_neg_integer(),
     rest: binary(),
     reason: String.t(),
     context: map()

Parses the given binary as parse_single.

Returns {:ok, [token], rest, context, position, byte_offset} or {:error, reason, rest, context, line, byte_offset} where position describes the location of the parse_single (start position) as {line, offset_to_start_of_line}.

To column where the error occurred can be inferred from byte_offset - offset_to_start_of_line.

Options

  • :byte_offset - the byte offset for the whole binary, defaults to 0
  • :line - the line and the byte offset into that line, defaults to {1, byte_offset}
  • :context - the initial context value. It will be converted to a map

sexpr__0(rest, acc, stack, context, line, offset)

sexpr__1(rest, acc, stack, context, line, offset)

sexpr__2(rest, acc, stack, context, line, offset)

sexpr__3(rest, acc, stack, context, comb__line, comb__offset)

sexpr__4(rest, acc, stack, context, comb__line, comb__offset)

sexpr__5(rest, user_acc, list, context, line, offset)

sexpr__6(rest, acc, stack, context, line, offset)

sexpr__7(rest, acc, list, context, line, offset)

sexpr__8(_, _, stack, _, _, _)

sexpr__9(rest, acc, stack, context, line, offset)

sexpr__10(rest, acc, stack, context, comb__line, comb__offset)

sexpr__11(rest, acc, stack, context, comb__line, comb__offset)

sexpr__12(rest, user_acc, list, context, line, offset)

sexpr__13(rest, acc, stack, context, line, offset)

sexpr__14(rest, acc, list, context, line, offset)

sexpr__15(_, _, stack, _, _, _)

sexpr__16(rest, acc, stack, context, line, offset)

sexpr__17(rest, acc, stack, context, comb__line, comb__offset)

sexpr__18(rest, acc, stack, context, comb__line, comb__offset)

sexpr__19(rest, user_acc, list, context, line, offset)

sexpr__20(rest, acc, stack, context, line, offset)

sexpr__21(rest, acc, list, context, line, offset)

sexpr__22(_, _, stack, _, _, _)

sexpr__23(rest, acc, stack, context, line, offset)

sexpr__24(rest, acc, stack, context, comb__line, comb__offset)

sexpr__25(rest, acc, stack, context, comb__line, comb__offset)

sexpr__26(rest, acc, stack, context, comb__line, comb__offset)

sexpr__27(rest, acc, stack, context, line, offset)

sexpr__28(rest, user_acc, list, context, line, offset)

sexpr__29(rest, acc, list, context, line, offset)

sexpr__30(_, _, stack, _, _, _)

sexpr__31(rest, acc, stack, context, line, offset)

sexpr__32(rest, acc, stack, context, comb__line, comb__offset)

sexpr__33(rest, acc, stack, context, line, offset)

sexpr__34(_, _, list, _, _, _)

sexpr__35(rest, acc, stack, context, comb__line, comb__offset)

sexpr__36(inner_rest, inner_acc, list, inner_context, inner_line, inner_offset)

sexpr__37(rest, acc, stack, context, comb__line, comb__offset)

sexpr__38(rest, user_acc, list, context, line, offset)

sexpr__39(rest, acc, list, context, line, offset)

sexpr__40(_, _, stack, _, _, _)

sexpr__41(rest, acc, stack, context, line, offset)

sexpr__42(rest, acc, stack, context, comb__line, comb__offset)

sexpr__43(rest, acc, stack, context, line, offset)

sexpr__44(_, _, list, _, _, _)

sexpr__45(rest, acc, stack, context, line, offset)

sexpr__46(rest, acc, stack, context, comb__line, comb__offset)

sexpr__47(rest, user_acc, list, context, line, offset)

sexpr__48(rest, acc, stack, context, line, offset)

sexpr__49(rest, acc, stack, context, line, offset)

sexpr__50(inner_rest, inner_acc, list, inner_context, inner_line, inner_offset)

sexpr__51(rest, acc, stack, context, line, offset)

sexpr__52(rest, acc, stack, context, comb__line, comb__offset)

sexpr__53(rest, user_acc, list, context, line, offset)

sexpr__54(rest, acc, stack, context, line, offset)

sexpr__55(rest, acc, stack, context, comb__line, comb__offset)

sexpr__56(rest, user_acc, list, context, line, offset)

sexpr__57(rest, acc, list, context, line, offset)