- Error checking. A variable that keeps track of the type of
the previous token is helpful.
- Previous token was (
- Previous token was an operator
- Previous token was an operand
- Unary operators, such as unary minus. In the proper
minus can be converted into a different operator that represents
- 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
then modified to perform subscript calculations.