Eyeon.BinaryDecoder.V11 (eyeon v0.3.2)

Copy Markdown View Source

Decodes Ion 1.1 binary format to parser-compatible AST nodes.

This module expects data WITHOUT the Ion Version Marker (IVM) prefix. The IVM is stripped by Eyeon.BinaryDecoder (the router) before dispatching here.

Ion 1.1 uses little-endian byte order with FlexUInt/FlexInt/FixedInt/FixedUInt variable-length encodings from Eyeon.Binary11.

The decoder produces AST nodes identical to those emitted by the leex/yecc text parser. These flow through macro expansion then Eyeon.Decoder.decode_values/4 to produce final Elixir values.

Summary

Functions

decode(data, catalog \\ Catalog.new([]), options \\ %{})

@spec decode(binary(), Eyeon.Catalog.t(), map()) :: {:ok, any()} | {:error, any()}

decode_all(data, catalog \\ Catalog.new([]), options \\ %{})

@spec decode_all(binary(), Eyeon.Catalog.t(), map()) ::
  {:ok, [any()]} | {:error, any()}

decode_to_ast(data, catalog \\ Catalog.new([]), options \\ %{})

@spec decode_to_ast(binary(), Eyeon.Catalog.t(), map()) ::
  {:ok, [term()]} | {:error, any()}

Decode binary data to a list of AST nodes (parser-compatible tuples).