accept.peg 332 B

123456789
  1. start <- abcd+
  2. abcd <- 'a' { printf("A %d\n", yypos); } bc { printf("ABC %d\n", yypos); } &{YYACCEPT}
  3. / 'b' { printf("B %d\n", yypos); } cd { printf("BCD %d\n", yypos); } &{YYACCEPT}
  4. bc <- 'b' { printf("B %d\n", yypos); } 'c' { printf("C %d\n", yypos); }
  5. cd <- 'c' { printf("C %d\n", yypos); } 'd' { printf("D %d\n", yypos); }