Friday, February 20, 2015

Table Class Hierarchy – PRINT Entries

The PRINT related table entries were put into the  new table class hierarchy.  The diagram below shows the table sub-class hierarchy for the PRINT table entries:
Table
  ── Command
        ── Print [print]
  ── Internal
         ── PrintItem
                  ├── PrintDbl [printDbl]
                  ├── PrintInt [printInt]
                  └── PrintStr [printStr]
  └── SpecialOperator
              ├── Semicolon [semicolon]
              └── Comma [comma]

The Command class was already implemented for the table entries of commands that have not been implemented yet.  The Internal class is for codes that are added to the program to support commands, but are not associated with tokens from the input.  The SpecialOperator class are for special operator codes that do not contain arguments.  The intermediate PrintItem class contains those items shared by each of the print data type entries like their recreate function.

The contents of PRINT translate and various print related recreate functions were moved to the virtual functions of these classes (essentially the names of these functions were renamed).  The current print item recreate function was left in place with the PrintItem recreate calling it.  This function is still called by the print function recreate function, which hasn't been converted to the new table model yet.  This is temporary until function entries are put into the new table model. 

The print translate and various recreate functions are in need of refactoring are large and unwieldy.  This will be done later time when the translator and recreator classes are refactored.  With these PRINT related table entries created in the new table model, their corresponding entries in the old table entries array were removed along with their code index enumerators.  The alternate initializers for these codes in the temporary alternate info initializer were also removed.

[branch table commit e495f246cb]