Skip to content

Commit

Permalink
add constructor/destructor into MoeClass
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevan Little committed Feb 12, 2013
1 parent a1886e0 commit 1b090e4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/scala/org/moe/runtime/MoeClass.scala
Expand Up @@ -17,6 +17,9 @@ class MoeClass(
private var superclass: Option[MoeClass] = None
) extends MoeObject {

private var constructor: Option[MoeMethod] // BUILD
private var destructor: Option[MoeMethod] // DEMOLISH

private val methods: Map[String,MoeMethod] = new HashMap[String, MoeMethod]()
private val attributes: Map[String,MoeAttribute] = new HashMap[String, MoeAttribute]()

Expand Down Expand Up @@ -61,6 +64,24 @@ class MoeClass(
s => this :: s.getMRO
).getOrElse(List(this))

// Constructor

def getConstructor: Option[MoeMethod] = constructor

/**
* TODO: add a BUILDALL style method that
* walks the MRO and calls all constructors
*/

// Destructor

def getDestructor: Option[MoeMethod] = destructor

/**
* TODO: add a DEMOLISHALL style method that
* walks the MRO and calls all destructors
*/

// Attributes

/**
Expand Down

0 comments on commit 1b090e4

Please sign in to comment.