Package jminusminus

Interface JLhs

All Known Implementing Classes:
JArrayExpression, JFieldSelection, JVariable

interface JLhs
The type of any expression that can appear on the lhs of an assignment statement: JVariable, JFieldSelection, and JArrayExpression.
  • Method Details

    • analyzeLhs

      JExpression analyzeLhs(Context context)
      Analyzes the lhs of an assignment. This is very much like the analyze() methods, but perhaps a little more selective here and there.
      Parameters:
      context - context in which names are resolved.
      Returns:
      the analyzed (and possibly rewritten) AST subtree.
    • codegenLoadLhsLvalue

      void codegenLoadLhsLvalue(CLEmitter output)
      Generates code to load onto the stack any part of the lhs that must be there, as in a[i] = x.
      Parameters:
      output - the code emitter.
    • codegenLoadLhsRvalue

      void codegenLoadLhsRvalue(CLEmitter output)
      Generates code to load an Rvalue of the lhs, as in a += x.
      Parameters:
      output - the code emitter.
    • codegenDuplicateRvalue

      void codegenDuplicateRvalue(CLEmitter output)
      Generates the code to duplicate the Rvalue that is on the stack because it is to be used in a surrounding expression, as in a[i] = x--.
      Parameters:
      output - the code emitter.
    • codegenStore

      void codegenStore(CLEmitter output)
      Generates the code to do the actual assignment.
      Parameters:
      output - the code emitter.