Saturday, August 24, 2013

Old Translator Removal – Reference Flag Cleanup

The process done stack top routine (formally the find code routine, see post from August 17) contained a section that for the first operand of a sub-string function used in an assignment or an assignment internal code token (determined if the sub-string token had the reference flag set) if the item on top of the done stack did not have its reference flag set, an “expected assignment item” error was reported. If the reference flag of the token was not set, then the reference flag of the item on top of the done stack was cleared (a reference is not needed). At the end of the routine. if the data type of the done stack top item was not correct or could not be converted, the reference flag state was used to determine which error to return.

This reference flag functionality is no longer needed in this routine since the checking of references is handled else where in the new translator routines (specifically by the using the reference argument of the get operand routine and by the get internal function for sub-string assignments). This code was removed, and since it was removed, the INPUT and LET translate routines no longer need to set the reference flag before calling this routine (indirectly via the process final operand from the INPUT translate routine) and clearing it afterward.

To simply the code a bit more with respect to the reference flag, specifically pertaining to sub-string assignments where the reference flag is set for a sub-string function token in the get operand routine (which the get internal function routine uses to determine if a string reference should be requested for the first operand), the reference flag is cleared upon return since the reference status is not needed (a reference was already obtained).

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