# `Tptp.Bnf.Rule`
[🔗](https://github.com/jcschuster/tptp/blob/v0.1.3/lib/tptp/bnf/rule.ex#L1)

One rule read out of the vendored `SyntaxBNF` file.

`alternatives` is populated only for `::=` and `:==` rules; token rules (`::-`)
and character classes (`:::`) keep their `raw` regex text instead, because that
is what the generated conformance oracle needs.

# `symbol`

```elixir
@type symbol() :: {:ref, binary()} | {:literal, binary()}
```

A single element of an alternative.

`{:ref, name}` is a `<name>` reference — it may resolve to either a nonterminal
or, when `name` is defined by a `::-` or `:::` rule, a terminal. `{:literal,
text}` is a run of literal characters that `Tptp.Bnf.Generator` splits into
terminals against `Tptp.Token.spellings/0`.

# `t`

```elixir
@type t() :: %Tptp.Bnf.Rule{
  alternatives: [[symbol()]] | nil,
  lhs: binary(),
  line: pos_integer(),
  raw: binary(),
  separator: binary()
}
```

One rule: its left-hand side, which of the four separators introduced it, and the alternatives parsed out of it.

---

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