Struct gallop::Parser[][src]

pub struct Parser<'a> { /* fields omitted */ }

Holds the state of the parser for the provided Grammar

Methods

impl<'a> Parser<'a>
[src]

Creates a Parser from the provided Grammar

This example is not tested
let parser = match Parser::new(&mut grammar) {
  Ok(p)    => p,
  Err(err) => panic!("Error: {:#?}", err),
};

Parse the provided string

This example is not tested
println!("Parse tree: {:#?}", parser.parse("a test string"));

Specify any non-terminals that you want rolled up (see "Rolling Up the Parse Tree" section)

This example is not tested
parser.rollup(vec![
    "digit+",
    "digit*",
]);

Trait Implementations

impl<'a> Clone for Parser<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> Debug for Parser<'a>
[src]

Formats the value using the given formatter. Read more

impl<'a> PartialEq for Parser<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

impl<'a> Send for Parser<'a>

impl<'a> Sync for Parser<'a>