- Every table entry had an expected data type even it is was never used (for example, commands). Even when it was in the Expression Info structure, it was not used for many codes (no argument functions, assignment codes, etc.).
- A separate iteration loop was needed to initialize the expected data types since the alternate code information was used, the alternate code map needed to be initialized first.
- The expected data type initialization took into account if a code had the possibility of having all three data types (Double, Integer, and String) where the expected data type would be set to Any even though there were actually such codes.
- A new entry is added to the name to entry map (a new primary code).
- An entry is replaced in the name to entry map (a new primary when the operand count is less than the current primary; and in this case the old entry is removed for an internal function).
- A new secondary primary is added to the alternate code map (a binary operator to a unary operator).
- A replacement alternate primary is found (one that has the same operands, see last post; the old alternate primary entry is removed).
- A new alternate primary is found (the alternate is added for the first operand of a binary operator, otherwise the current entry of the primary is modified).
The expected data type access function was modified to use the new map. The expected data type member was removed from the Table Entry structure, and its initializer values were removed from the table entries. The separate iteration loop in the table constructor to initialize the expected data types was removed.
A problem was found in the set token code function (used to set the code in a token, possibly an alternate code, depending on its data type) where it could incorrectly add a new blank element to the alternate code map. This did not appear to cause a problem, but was corrected by checking if the code is present before iterating over alternate codes. This issue was that for a standard map, the bracket operator adds blank elements if the key does not exist.
[branch table commit 1374657d7e]
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.)