nickovic / rtamt

Specification-based real-time monitoring library
BSD 3-Clause "New" or "Revised" License
50 stars 20 forks source link

Could you give good exception for AbstractAstVisitor? #123

Closed TomyYamy closed 2 years ago

TomyYamy commented 2 years ago

@nickovic I remember you have idea for better exception for AbstractAstVisitor.

https://github.com/nickovic/rtamt/blob/447d5eb6a13e6cc1854c99f13a4950d069bdb4ba/rtamt/ast/visitor/abstract_ast_visitor.py#L19-L28

Could give me that.

TomyYamy commented 2 years ago

@nickovic Perhaps will we keep, visitDefault() for exception raising? If so exception() maybe better...

nickovic commented 2 years ago

created a method raise_exception that is called when the node is not a TL node. The method is overwritten depending whether we call STL or LTL visitor and the exception raised is changed accordingly.