Package jminusminus

Class JConstructorDeclaration

All Implemented Interfaces:
JMember

class JConstructorDeclaration extends JMethodDeclaration implements JMember
The AST node for a constructor declaration.
  • Constructor Details

    • JConstructorDeclaration

      public JConstructorDeclaration(int line, ArrayList<String> mods, String name, ArrayList<JFormalParameter> params, ArrayList<TypeName> exceptions, JBlock body)
      Constructs an AST node for a constructor declaration.
      Parameters:
      line - line in which the constructor declaration occurs in the source file.
      mods - modifiers.
      name - constructor name.
      params - the formal parameters.
      exceptions - exceptions thrown.
      body - constructor body.
  • Method Details

    • preAnalyze

      public void preAnalyze(Context context, CLEmitter partial)
      Declares the member names in the specified (class) context and generates the member headers in the partial class.
      Specified by:
      preAnalyze in interface JMember
      Overrides:
      preAnalyze in class JMethodDeclaration
      Parameters:
      context - class context in which names are resolved.
      partial - the code emitter.
    • analyze

      public JAST analyze(Context context)
      Performs semantic analysis on this AST and returns the (possibly modified) AST.
      Overrides:
      analyze in class JMethodDeclaration
      Parameters:
      context - the environment (scope) in which code is analyzed.
      Returns:
      the (possibly modified) AST.
    • partialCodegen

      public void partialCodegen(Context context, CLEmitter partial)
      Generates a partial class for a type, reflecting only the member information required to do analysis.
      Overrides:
      partialCodegen in class JMethodDeclaration
      Parameters:
      context - the parent (class) context.
      partial - the code emitter.
    • codegen

      public void codegen(CLEmitter output)
      Performs code generation for this AST.
      Overrides:
      codegen in class JMethodDeclaration
      Parameters:
      output - the code emitter.
    • toJSON

      public void toJSON(JSONElement json)
      Stores information about this AST in JSON format.
      Overrides:
      toJSON in class JMethodDeclaration
      Parameters:
      json - the JSON emitter.