logo

class

compiler::TypeDef

sys::Obj
  compiler::Node
    compiler::DefNode
      compiler::TypeDef : compiler::CType

TypeDef models a type definition for a class, mixin or enum

Slots

addSlot

Void addSlot(CSlot s, Int slotDefIndex := def)

Add a slot to the type definition. The method is used to add SlotDefs declared by this type as well as slots inherited by this type.

base

override CType base

baseSpecified

Bool baseSpecified

closure

ClosureExpr closure

closures

ClosureExpr[] closures

enumDef

EnumDef enumDef(Str name)

Return EnumDef for specified name or null.

enumDefs

EnumDef[] enumDefs

fieldDef

FieldDef fieldDef(Str name)

Return FieldDef for specified name or null.

fieldDefs

FieldDef[] fieldDefs()

Get the FieldDefs declared within this TypeDef.

hasSlotDef

Bool hasSlotDef(Str name)

Return if this class has a slot definition for specified name.

indexedFacets

FacetDef[] indexedFacets

instanceFieldDefs

FieldDef[] instanceFieldDefs()

Get the instance FieldDefs declared within this TypeDef.

isClosure

Bool isClosure()

Return if this type is the anonymous class of a closure

isGeneric

override Bool isGeneric()

isGenericParameter

override Bool isGenericParameter()

isParameterized

override Bool isParameterized()

make

new make(Namespace ns, Location location, CompilationUnit unit, Str name)

methodDef

MethodDef methodDef(Str name)

Return MethodDef for specified name or null.

methodDefs

MethodDef[] methodDefs()

Get the MethodDefs declared within this TypeDef.

mixins

override CType[] mixins

name

override readonly Str name

normalizeStaticInits

Void normalizeStaticInits(MethodDef m)

If during parse we added any static initializer methods, now is the time to remove them all and replace them with a single collapsed MethodDef (processed in Normalize step)

ns

override readonly Namespace ns

pod

override readonly CPod pod

print

override Void print(AstWriter out)

qname

override readonly Str qname

replaceSlot

Void replaceSlot(CSlot oldSlot, CSlot newSlot)

Replace oldSlot with newSlot in my slot tables.

signature

override Str signature()

slotDef

SlotDef slotDef(Str name)

Return SlotDef for specified name or null.

slotDefs

SlotDef[] slotDefs()

Get the SlotDefs declared within this TypeDef.

slots

override Str:CSlot slots()

Return all the all slots (inherited and defined)

staticFieldDefs

FieldDef[] staticFieldDefs()

Get the static FieldDefs declared within this TypeDef.

toListOf

override ListType toListOf()

toStr

override Str toStr()

unit

readonly CompilationUnit unit

walk

Void walk(Visitor v, VisitDepth depth)