When correcting the parser code, it was noticed that there were two constant arrays that contain text strings for the names of their associated enumerations, namely the token and data type enumerations. These are used, along with the code name array (that is already auto-generated) in the parser test code to output the test results.
The issue is that the text strings must match the enumerations. The code name array was already set up to be auto-generated (getting the text strings by scanning the table.cpp source file). The token and data type enumerations are contained in the ibcp.h header file.
The awk script test_codes.awk was generating the contents (text string elements) of the code names array. This script was renamed to test_names.awk and was modified to generate a complete array definition along with scanning ibcp.h header file for the token and data type enumerations to create name arrays for these also. The generated file was changed from test_codes.h to test_names.h and the CMakeLists.txt was modified accordingly.
Several other minor changes were made along with this commit, for details see the commit log on GitHub. The remaining issue is to add the test programs to CMake, which were in the older make file that has been removed.
Update (9:06): I should now better then to rush out a change without testing on both major platforms. It turns out the updated test_names.awk script reported an error on Windows. The problem was that the awk script was in DOS format and contained line continuations (back-slash at the end of the line). The awk program saw the CR at the end of these continuation lines and got confused. These were removed to eliminate the problem and GitHub was updated.
Sunday, October 14, 2012
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.)