Contents
Page-10
Prev
Next
Page+10
Index
Additional Considerations
- Error checking. A current status variable that tracks the type of
the previous token is helpful.
- Previous token was ( or start
- Previous token was an operator
- Previous token was an operand
- Unary operators, such as unary minus. In the proper
context,
minus can be converted into a different operator that represents
unary-minus.
- Right-associative operators. Shift when the top-of-stack has
the same precedence if the operator is right-associative.
- Type checking and coercion.
- Function calls. These can be treated like parenthesized
subexpressions, keeping track of the number of arguments.
- Array subscripts. These can be treated like
function calls,
then modified to perform subscript calculations.