Package jminusminus

Class ClassContext

java.lang.Object
jminusminus.Context
jminusminus.ClassContext

class ClassContext extends Context
Represents the context (scope, environment, symbol table) for a type, for example a class, in j--. It also keeps track of its surrounding context(s) and the type whose context it represents.
  • Constructor Details

    • ClassContext

      public ClassContext(JAST definition, Context surrounding)
      Constructs a class context.
      Parameters:
      definition - the AST node of the type that this class represents.
      surrounding - the surrounding context(s).
  • Method Details

    • definition

      public JAST definition()
      Returns the AST node of the type defined by this class.
      Returns:
      the AST of the type defined by this class.
    • toJSON

      public void toJSON(JSONElement json)
      Adds information pertaining to this context to the given JSON element.
      Overrides:
      toJSON in class Context
      Parameters:
      json - JSON element.