ncsa / qdl

the QDL programming language
Other
2 stars 0 forks source link

[Internal] change Java use of instanceof to querying the node type #30

Open jjg-123 opened 1 year ago

jjg-123 commented 1 year ago

A common construct in the code is to check the type of node from the parser, such as StemListNode and do processing using instanceof on the class. This means the code is getting ever more blocks of conditionals based on instanceof. A few of thewse are no problem, but lots of them will slow down code. each node should have an integer type associated with it and switch statements should handle these cases, not blocks of conditionals.

This was initially just s style issue, but as these proliferate, it is becoming a performance issue.