Flatbuf.Schema.Parser (flatbuf v0.1.0)

Copy Markdown View Source

Recursive-descent parser for FlatBuffers .fbs source.

Consumes tokens produced by Flatbuf.Schema.Lexer and returns a list of declaration records (the CST). The resolver later promotes these into the semantic %Flatbuf.Schema{}.

Summary

Types

decl()

@type decl() ::
  {:include, String.t(), pos_integer()}
  | {:namespace, String.t(), pos_integer()}
  | {:root_type, String.t(), pos_integer()}
  | {:file_identifier, String.t(), pos_integer()}
  | {:file_extension, String.t(), pos_integer()}
  | {:attribute_decl, String.t(), pos_integer()}
  | {:table, map()}
  | {:struct, map()}
  | {:enum, map()}

Functions

parse(source)

@spec parse(binary()) :: {:ok, [decl()]} | {:error, term()}