Crate yarpl[][src]

yarpl, or Yet Another Rust Parsing Library, revolves around the Consumer struct and the Feed trait.

Consumer

A Consumer hold a Vec<String> of parsed tokens as well as the remaining unparsed String.

Parsing individual tokens is done by using Consumer::shift and Consumer::shift_characters methods.

Feed

The Feed trait defines how a trait is parsed using a Consumer using a combination of shift, shift_characters, and consume.

Macros

shift

A macro to quickly define a type that will only shift a string when parsed.

shift_while

A macro to define a type which solely calls Consumer::shift_while when parsed.

Structs

Consumer

Holds tokens (String) that have been parsed, as well as remaining input.

Many

Given a type T : Feed and a range n .. m, parses T between n and m times.

Maybe

When parsed, always returns Ok. Will also construct a Feed object in self if successful.

Must

When parsed, ensures an object of type T : Feed is able to be parsed from a consumer, but will consume no input.

Not

A type that, when parsed, ensures an object of type T : Feed cannot be parsed from some Consumer.

Traits

Feed

Defines how a type may be parsed by mutating self and some Consumer.

Type Definitions

Result