Fantom

 

class

compiler::InitEnum

sys::Obj
  compiler::CompilerSupport
    compiler::CompilerStep
      compiler::InitEnum

InitEnum is used to auto-generate EnumDefs into abstract syntax tree representation of the fields and method.

Slots

addCtorSource

Void addCtor()

Add constructor or enhance existing constructor.

addFromStrSource

Void addFromStr()

Add fromStr method.

makeSource

new make(Compiler compiler)

makeFieldSource

FieldDef makeField(EnumDef def)

Make enum value field: public static final Foo name = make(ord, name)

makeValsFieldSource

FieldDef makeValsField()

Make vals field: List of Enum values

runSource

override Void run()

Run the step

visitTypeDefSource

override Void visitTypeDef(TypeDef t)

Callback when visiting a type definition.