The translator currently has several outputs depending on the input, either there is an RPN output list (if translation succeeds), or there is an error token and error message (if translation fails). For now, the program model will be changed to hold the RPN output list for each program line instead of the text of the line. However, if there is an error, details of the error (location and message) will need to be stored instead.
A new RpnList class was created to contain the list of RpnItem instances, and any error token (with location) and error message. An instance of this class will be stored in the program model. After making these changes and some other changes (though there is no point in describing these here), because as a result, all of the parser tests failed. Worst, all the expression and translator tests caused the application to crash.
The parser tests failed simply because the copyright year had been updated from 2012 to 2013. The test results could be updated for this, but this will need to be done every year. There is no point for these expected batch test output files to contain the copyright message along with the warranty and table initialization messages anyway.
Therefore, the copyright, warranty and table initialization messages were removed from the output, but these are still appropriately output in console input test mode. Since these messages are no longer being put in the expected results files, the translate tr() function was added to these strings. All of the tests results files were updated, and should not need to be updated again unless the test inputs change or for some reason the outputs change. Now back to the RPN list changes...
[commit ff17139321]
Thursday, March 28, 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)