[−][src]Module abnf::types
This module contains a collection of all types in the ABNF crate. The types can be used to manually construct new rules.
Note: currently you need to take care of some internals and
use specific containers to construct the variants (e.g. Vec
for an Alternation
and String
for a Rulename
).
This crate will provide a better abstraction in the future.
Example
use abnf::types::*; let rule = Rule::new("test", Node::Alternation(vec![ Node::Rulename("A".into()), Node::Concatenation(vec![ Node::Rulename("B".into()), Node::Rulename("C".into()) ]) ])); println!("{}", rule); // prints "test = A / B C"
Structs
Repeat | An optionally lower and optionally upper bounded repeat value. Both bounds are inclusive. |
Repetition | Struct to bind a |
Rule | A single ABNF rule with a name, it's definition (implemented as |
Enums
Kind | Is a rule a basic rule or an incremental alternative? See https://tools.ietf.org/html/rfc5234#section-3.3 |
Node | A |
NumVal | A single value within a range (e.g. |