Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
corrected parser and unary operator issues
parser errors were not being handled correctly in all cases and when a unary operator occurred when a binary operator should, the error message should have included "binary" in front of operator getToken() modified to only return number parser errors in operand mode when the current data type if not a string translate2() expression only test mode modified to look for a non-numeric parser error and set the ExpOpOrEnd status getExpression() for parentheses expression processing modified to see if the terminating token is a unary operand and set status to new ExpBinOpOrParen status; when getting binary operator or end-of-expression token, no longer returns ExpOpOrEnd status (parser error returned and caller determines actual status) getOperand() modified upon an error from getToken() if not reference mode, error status is still returned, but for reference modes, if a parser error then the length of the error is set to one before returning the expected reference status for the current data type and reference mode getInternalFunction() modified if getExpression() returns a parser error, then the parser error is returned if it is a numeric parser error; for other parser errors or if the terminating token is a unary operator, the appropriate error is return, however, for a unary operator, the appropriate error with "binary" in front of "operator" is returned getParenToken() modified to look for a parser error from getExpression() otherwise if the terminating token is a unary operator, then the new ExpBinOpCommaOrParen status is return added new ExpBinOpOrComma, ExpBinOpCommaOrParen, ExpBinOpOrParen(), and ExpBinOpSemiOrComma token statuses for unexpected unary operator errors; reformatted token status messages array to prevent long line and adjusted enums.awk for these changes added several unexpected unary operator error statements to translator test #14 (parser errors), most of which were not previously tested; old translator fails many of these tests, so its output was saved to another file (new translator passes all tests in #14 except for the unimplemented PRINT and INPUT statements
- Loading branch information
1 parent
b4a908b
commit 87e4072
Showing
6 changed files
with
254 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.