extern crate pest_derive;
extern crate pest;

use pest::Parser as PestParser;
use pest_derive::Parser;

#[derive(Parser)]
#[grammar = "sample.pest"]
struct SampleParser;


fn main() {
    let mut pairs = SampleParser::parse(Rule::expression, "111+222").unwrap_or_else(|e| panic!("{}", e));
    println!("{:?}", pairs);
    let a = pairs.next().unwrap().as_str().parse::<i64>().unwrap();
    pairs.next();
    let b = pairs.next().unwrap().as_str().parse::<i64>().unwrap();
}
