flatbuffers- Haskell implementation of the FlatBuffers protocol.

Safe HaskellNone




schema :: Parser Schema Source #

Roughly based on: https://google.github.io/flatbuffers/flatbuffers_grammar.html. Differences between this parser and the above grammar:

  • Unions members now support aliases.
  • An enum's underlying type used to be optional (defaulting to short), but now it's mandatory.
  • Attributes can be reffered to either as an identifier or as a string literal (e.g. attr or "attr").
  • Struct fields can't have default values.
  • The grammar states that tablestruct field defaults can only be scalars (integerfloating point constants), when in reality, it could be also be a boolean or an enum identifier.
  • The grammar says attribute values can be integers, floats or string literals. Flatc only allows integers and string literals. To make things simpler, we decided to go with flatc's approach and disallow floats.
  • The grammar says namespaces must include at least one fragment, but an empty namespace (i.e. namespace ;) is perfectly valid.
  • This supports native_include statements (see: https://google.github.io/flatbuffers/flatbuffers_guide_use_cpp.html#flatbuffers_cpp_object_based_api)

sc :: Parser () Source #

space consumer - this consumes and ignores any whitespace + comments