Package jminusminus

Class JFieldDeclaration

java.lang.Object
jminusminus.JAST
jminusminus.JFieldDeclaration
All Implemented Interfaces:
JMember

class JFieldDeclaration extends JAST implements JMember
The AST node for a field declaration.
  • Constructor Details

    • JFieldDeclaration

      public JFieldDeclaration(int line, ArrayList<String> mods, ArrayList<JVariableDeclarator> decls)
      Constructs an AST node for a field declaration.
      Parameters:
      line - line in which the variable declaration occurs in the source file.
      mods - field modifiers.
      decls - variable declarators.
  • Method Details

    • mods

      public ArrayList<String> mods()
      Returns the list of modifiers.
      Returns:
      the list of modifiers.
    • 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
      Parameters:
      context - class context in which names are resolved.
      partial - the code emitter.
    • analyze

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

      public void codegen(CLEmitter output)
      Performs code generation for this AST.
      Specified by:
      codegen in class JAST
      Parameters:
      output - the code emitter.
    • codegenInitializations

      public void codegenInitializations(CLEmitter output)
      Generates code for the field initializations.
      Parameters:
      output - the code emitter.
    • toJSON

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