Expand description

This module contains a collection of all types in the ABNF crate. The types can also be used to manually construct new rules.

Example

use abnf::types::*;

let rule = Rule::new("test", Node::alternatives(&[
    Node::rulename("A"),
    Node::concatenation(&[
        Node::rulename("B"),
        Node::rulename("C")
    ])
]));

println!("{}", rule); // prints "test = A / B C"

Structs

A single ABNF rule with a name, it’s definition (implemented as Node) and a kind (Kind::Basic or Kind::Incremental).
String literal value, either case sensitive or not.

Enums

Is a rule a basic rule or an incremental alternative? See https://tools.ietf.org/html/rfc5234#section-3.3
A Node enumerates all building blocks in ABNF. Any rule is a composition of Nodes.
Defines the kind of repetition. This enum is defined in a way, which makes it possible to preserve the parsed variant. As a consequence, multiple logically equivalent forms can be represented, e.g. 4<element> == 4*4<element>, *5<element> == 0*5<element>, etc.
Terminal created by numerical values.