Saturday, February 28, 2015

Table Class Hierarchy – Refactoring (continued)

The two small collection structures (Base Information and Type Information) were moved from the operand source file to the table header file so that they can also be used by the PRINT and INPUT table entry classes.  Unlike with the operand classes, the intermediate Print Item and Input Assign classes are still needed because they contain the common recreate virtual table function for the entry classes.  The intermediate Input Parse class could be removed since these entry classes don't have a recreate function (the blank function in the Internal class is inherited).

As with the operand entry classes, Base Information literal constants were added for the print item, input assign and input parse entries classes, along with the necessary Type Information literal constants.  The input parse table entries previously had a pointer to the Null expression info instance, but now have the same as the input assign entries.  The expression info is not used for these table entries, but the Type Information is used for the data type debug name.  This was done to reduce the number of literal constant definitions needed.

A new table constructor was added that takes the Base Information and Type Information structures, which the Operand and Internal class constructors now call.  This also pushed the call to the append alternate function call up to this Table constructor.  This eliminated the calls to this function in most of the derived classes.  The remaining call is by the Input Assign Double entry class needed because it needs to be assigned to a second primary entry (Input and Input Assign).

[branch table commit a52bd657b2]