Token の位置情報、next
matchedToken も Token クラスだから、それと同じか〜
PARSER_BEGIN(Test) public class Test { public static void main(String args[]) throws ParseException { Test parser = new Test(System.in); parser.Input(); } } PARSER_END(Test) SKIP : { <SPACE: " " | "\t" | "\n" | "\r"> } TOKEN : { <A: "a"> } void Input() : { Token t; } { (t = <A> { System.out.println("*" + t.beginLine + ":" + t.beginColumn + ":" + t.endLine + ":" + t.endColumn + ":" + t.next + "*"); } )+ <EOF> }
で、
a *1:1:1:1:null* a *2:1:2:1:null* a *3:1:3:1:null* aa *4:1:4:1:null* *4:2:4:2:null*
next が null にならない例は?