The followings are my grammar rules:
Stmts: (stmts += Stmt ';')* ;
Stmt: Stmt1 | Stmt2 | Stmt3 ... ;
I want to know each Stmt# is #-th stmt in stmts and their exactly location (#-th line in original document). Such that I could point out the location when user make mistakes.
I override the validator constructor and store an HashMap <Stmt, Integer>
to get each Stmt# is the #-th Stmt in stmts(Not sure if this is the correct way to do though...). However I have no idea how to get their line number.
Any help?