Contents    Page-10    Prev    Next    Page+10    Index   

Additional Considerations

  1. Error checking. A variable that keeps track of the type of the previous token is helpful.

  2. Unary operators, such as unary minus. In the proper context, minus can be converted into a different operator that represents unary-minus.

  3. Right-associative operators. Shift when the top-of-stack has the same precedence if the operator is right-associative.

  4. Type checking and coercion.

  5. Function calls. These can be treated like parenthesized subexpressions, keeping track of the number of arguments.

  6. Array subscripts. These can be treated like function calls, then modified to perform subscript calculations.