Fantom

 

class

compiler::MethodDef

sys::Obj
  compiler::Node
    compiler::DefNode
      compiler::SlotDef
        compiler::MethodDef : compiler::CMethod

MethodDef models a method definition - it's signature and body.

Slots

accessorForSource

FieldDef? accessorFor

addLocalVarSource

MethodVar addLocalVar(CType ctype, Str? name, Block? scope)

Make and add a MethodVar for a local variable. If name is null then we auto-generate a temporary variable name

addLocalVarForDefSource

MethodVar addLocalVarForDef(LocalDefStmt def, Block? scope)

Make and add a MethodVar for a local variable.

addParamVarSource

MethodVar addParamVar(CType ctype, Str name)

Add a parameter to the end of the method signature and initialize the param MethodVar. Note: currently this only works if no locals are defined.

codeSource

Block? code

ctorChainSource

CallExpr? ctorChain

docMetaSource

override [Str:Str]? docMeta()

inheritedRetSource

CType? inheritedRet

inheritedReturnTypeSource

override CType inheritedReturnType()

isFieldAccessorSource

Bool isFieldAccessor()

Return if getter/setter for FieldDef

isFieldSetterSource

Bool isFieldSetter()

Return if setter for FieldDef

isInstanceInitSource

Bool isInstanceInit()

Return if this a instance initializer block.

isItBlockCtorSource

Bool isItBlockCtor()

Return if this is a constructor with an it-block as last parameter

isNameInstanceInitSource

static Bool isNameInstanceInit(Str name)

isNameStaticInitSource

static Bool isNameStaticInit(Str name)

isOnceSource

Bool isOnce()

Return if this is a once method

isStaticInitSource

Bool isStaticInit()

Return if this a static initializer block.

makeSource

new make(Loc loc, TypeDef parent, Str name := "?", Int flags := 0)

makeInstanceInitSource

static MethodDef makeInstanceInit(Loc loc, TypeDef parent, Block? block)

makeStaticInitSource

static MethodDef makeStaticInit(Loc loc, TypeDef parent, Block? block)

paramDefsSource

ParamDef[] paramDefs

paramsSource

override CParam[] params()

printSource

override Void print(AstWriter out)

Overrides compiler::Node.print

Doc inherited from compiler::Node.print

Pretty print this node and it's descendants.

retSource

CType ret

returnTypeSource

override CType returnType()

signatureSource

override Str signature()

usesCvarsSource

Bool usesCvars

varsSource

MethodVar[] vars

walkSource

override Void walk(Visitor v, VisitDepth depth)