Fantom

 

class compiler::MethodDef

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

Source

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

accessorFor

FieldDef? accessorFor

Source

addLocalVar

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

Source

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

addLocalVarForDef

MethodVar addLocalVarForDef(LocalDefStmt def, Block? scope)

Source

Make and add a MethodVar for a local variable.

addParamVar

MethodVar addParamVar(CType ctype, Str name)

Source

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.

code

Block? code

Source

ctorChain

CallExpr? ctorChain

Source

inheritedRet

CType? inheritedRet

Source

inheritedReturnType

virtual override CType inheritedReturnType()

Source

isFieldAccessor

Bool isFieldAccessor()

Source

Return if getter/setter for FieldDef

isFieldSetter

Bool isFieldSetter()

Source

Return if setter for FieldDef

isInstanceInit

Bool isInstanceInit()

Source

Return if this a instance initializer block.

isItBlockCtor

Bool isItBlockCtor()

Source

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

isNameInstanceInit

const static Bool isNameInstanceInit(Str name)

Source

isNameStaticInit

const static Bool isNameStaticInit(Str name)

Source

isOnce

Bool isOnce()

Source

Return if this is a once method

isStaticInit

Bool isStaticInit()

Source

Return if this a static initializer block.

make

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

Source

makeInstanceInit

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

Source

makeStaticInit

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

Source

paramDefs

ParamDef[] paramDefs

Source

params

virtual override CParam[] params()

Source

print

virtual override Void print(AstWriter out)

Source

ret

CType ret

Source

returnType

virtual override CType returnType()

Source

signature

virtual override Str signature()

Source

usesCvars

Bool usesCvars

Source

vars

MethodVar[] vars

Source

walk

virtual override Void walk(Visitor v, VisitDepth depth)

Source