示例#1
1
 protected function setUp()
 {
     $this->parser = hammer_indirect();
     hammer_bind_indirect($this->parser, hammer_choice(hammer_sequence($this->parser, hammer_ch("a")), hammer_ch("a")));
 }
示例#2
0
 protected function setUp()
 {
     $this->parser1 = hammer_sequence(hammer_ch("a"), hammer_choice(hammer_ch("+"), hammer_token("++")), hammer_ch("b"));
     $this->parser2 = hammer_sequence(hammer_ch("a"), hammer_choice(hammer_sequence(hammer_ch("+"), hammer_not(hammer_ch("+"))), hammer_token("++")), hammer_ch("b"));
 }
示例#3
0
 protected function setUp()
 {
     $this->parser = hammer_many(hammer_choice(hammer_ch("a"), hammer_ch("b")));
 }
示例#4
0
 protected function setUp()
 {
     $this->parser = hammer_sep_by(hammer_choice(hammer_ch("1"), hammer_ch("2"), hammer_ch("3")), hammer_ch(","));
 }
示例#5
0
 protected function setUp()
 {
     $this->parser = hammer_sequence(hammer_ch("a"), hammer_optional(hammer_choice(hammer_ch("b"), hammer_ch("c"))), hammer_ch("d"));
 }
示例#6
0
 protected function setUp()
 {
     $this->parser = hammer_action(hammer_sequence(hammer_choice(hammer_ch("a"), hammer_ch("A")), hammer_choice(hammer_ch("b"), hammer_ch("B"))), "actTest");
 }
示例#7
0
 protected function setUp()
 {
     $this->parser = hammer_repeat_n(hammer_choice(hammer_ch("a"), hammer_ch("b")), 2);
 }
示例#8
0
 protected function setUp()
 {
     $this->parser = hammer_predicate(hammer_many1(hammer_choice(hammer_ch('a'), hammer_ch('b'))), "predTest");
 }