Maintaining information about tokens in the abstract syntax tree allows providing more informative information in case of errors (e.g., row and column of a wrong typed symbol).
In case, for example, of the following code
predicate G0() { goal a0 = new A00(); fact g1 = new G1(); }
predicate G1() { goal a0 = new A01(); fact g0 = new G0(); }
predicate A0() { }
Maintaining information about tokens in the abstract syntax tree allows providing more informative information in case of errors (e.g., row and column of a wrong typed symbol).
In case, for example, of the following code
the parser cannot find the predicate symbol A00