pstlab / oRatio

oRatio is an Integrated Logic and Constraint based solver
Apache License 2.0
6 stars 1 forks source link

The abstract syntax tree (AST) should maintain information about tokens #16

Closed riccardodebenedictis closed 3 years ago

riccardodebenedictis commented 4 years ago

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() { }

the parser cannot find the predicate symbol A00