Package iota

Class IFormalParameter

java.lang.Object
iota.IAST
iota.IFormalParameter

class IFormalParameter extends IAST
The AST node for a formal parameter declaration.
  • Constructor Details

    • IFormalParameter

      public IFormalParameter(int line, String name, Type type)
      Constructs an AST node for a formal parameter declaration.
      Parameters:
      line - line in which the parameter occurs in the source file.
      name - parameter name.
      type - parameter type.
  • Method Details

    • name

      public String name()
      Returns the parameter's name.
      Returns:
      the parameter's name.
    • type

      public Type type()
      Returns the parameter's type.
      Returns:
      the parameter's type.
    • setType

      public void setType(Type type)
      Sets the parameter's type to the specified type.
      Parameters:
      type - the new type.
    • analyze

      public IAST analyze(Context context)
      Performs second phase of semantic analysis on this AST and returns the (possibly modified) AST.
      Specified by:
      analyze in class IAST
      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 IAST
      Parameters:
      output - the code emitter.