Wednesday, January 7, 2015

Token – Data Type Member

The data type member of the token class was removed since its value should always the same as the table entry for the code in the token (and all tokens now have a code).  The data type, is data type, and is data type compatible access functions were modified to get its return value from the table entry for the code.  The set data type access function was removed since it is no longer used.

A data type access function was added to the Table Entry class.  To access the data type of the table entry, which is within the expression info member, the Expression Info structure definition was moved from the table source file to the table header file so that its members are available from the in-line table entry functions.

These changes caused a problem with the not yet implemented array, defined function and user function codes.  There were only one table entry for each of these codes and their data type was Double.  This previously worked since the correct data type was in the token.  The problem was corrected by adding the missing table entries for these codes for each of the other data types.

There were several locations (translator and tester routines) that to check for these codes by looking for the one code.  Now with additional codes, the checks needed to expanded to include the additional alternate codes.  This is not ideal, but will be resolved once the code type enumeration is implemented (there will be one code type each for variable, array, defined function and user function codes).

[branch table commit f8d338ae5e]