Tuesday, June 15, 2010

Translator – PRINT Working, But...

This release seems to be living up to its unlucky number. I'm going to just put it out shortly and move on. The PRINT command and its error tests are working properly, so there's no reason to do an interim developmental release.  However, not all the error messages are correct.  But first, a few changes need to be described.

A while back, an AssignList flag was added to table entries to identify that the code is an assign list code. This flag was used when processing an operator to identify it as an assign list operator. A temporary flag is set if the operator is an assign list operator before the find code function was called (which only handles the last value in the assignment list and the expression). Upon returning, if this temporary flag is set, then the rest of the assignment list operands are processed.

It turns out this table entry flag is not necessary. Since the temporary flag is set before the find code function (which may change the operator code depending on the data types), the temporary flag can simply be set if the operator code is AssignList.

One other change was made related to list assignments. Previously the AssignList operator was not pushed to the hold stack until the equal token was received, the comma tokens were just deleted. This was changed to push an AssignList Operator token to the hold stack when the first comma token is received (the comma token was changed). This occurs when the mode is changed from Assignment to CommaAssignment (on the first comma token, subsequent comma tokens are still deleted). When the equal token is received, the mode is still changed from CommaAssignment to Expression (but the equal token is now just deleted). This change was necessary to aid in identifying which specific error message is needed when an error occurs (which is still not working correctly).

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