# `Zee3.Smt2.Parser`

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.

# `build_bin_bitvec`

# `build_hex_bitvec`

# `build_list`

# `build_string`

# `build_sym_or_int`

# `build_symbol`

# `parse`

Parses exactly one S-Expression from the given binary.

# `parse_many`

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

# `parse_multiple`

```elixir
@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`

```elixir
@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`

# `sexpr__1`

# `sexpr__2`

# `sexpr__3`

# `sexpr__4`

# `sexpr__5`

# `sexpr__6`

# `sexpr__7`

# `sexpr__8`

# `sexpr__9`

# `sexpr__10`

# `sexpr__11`

# `sexpr__12`

# `sexpr__13`

# `sexpr__14`

# `sexpr__15`

# `sexpr__16`

# `sexpr__17`

# `sexpr__18`

# `sexpr__19`

# `sexpr__20`

# `sexpr__21`

# `sexpr__22`

# `sexpr__23`

# `sexpr__24`

# `sexpr__25`

# `sexpr__26`

# `sexpr__27`

# `sexpr__28`

# `sexpr__29`

# `sexpr__30`

# `sexpr__31`

# `sexpr__32`

# `sexpr__33`

# `sexpr__34`

# `sexpr__35`

# `sexpr__36`

# `sexpr__37`

# `sexpr__38`

# `sexpr__39`

# `sexpr__40`

# `sexpr__41`

# `sexpr__42`

# `sexpr__43`

# `sexpr__44`

# `sexpr__45`

# `sexpr__46`

# `sexpr__47`

# `sexpr__48`

# `sexpr__49`

# `sexpr__50`

# `sexpr__51`

# `sexpr__52`

# `sexpr__53`

# `sexpr__54`

# `sexpr__55`

# `sexpr__56`

# `sexpr__57`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
