Saturday, August 17, 2013

New INPUT Translation – Preparation

In preparation for the new INPUT translate routine, some minor changes were needed.  The first change was add default values to the process final operand routine for the second token and the operand index arguments.  The second token argument is used when processing operators where it is given the first token of the operator being processed and this second token is used for binary operators to set its first token when it is pushed on the done stack.

The old translator routines also set the second token to the closing parentheses token for tokens with parentheses, but the new translator routines do not call the process final operand routine for these tokens.  Also for the new translator, the operand index will only be used for operators.  In addition to operators, the new translator will only use the process final operand routine for special codes like PrintDbl and InputAssignDbl, and these will not require the second operand or operand index arguments.

The other change involved adding a new reference type in additional to None, Variable and All.  The new VarDefFn type is to allow variables and defined function references only and not sub-string references (as in sub-string assignments).  The Variable reference type was modified to only allow variables and not defined function assignments.  The get operand routine was modified to support these changes.  The INPUT command will use the Variable reference type since defined functions cannot be input.  The get internal function routine was modified to use the new reference type for sub-string assignments (because defined functions of type string will support sub-string assignments, at least this is the current plan).

[commit b670ab38f6] [commit a79f117c52]

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.)