[Avida-SVN] r2790 - in branches/movement: Avida.xcodeproj source/actions source/cpu source/main source/script
grabow38 at myxo.css.msu.edu
grabow38 at myxo.css.msu.edu
Mon Sep 15 06:06:43 PDT 2008
Author: grabow38
Date: 2008-09-15 09:06:42 -0400 (Mon, 15 Sep 2008)
New Revision: 2790
Added:
branches/movement/source/script/cASCPPParameter.h
branches/movement/source/script/cASNativeObject.h
Modified:
branches/movement/Avida.xcodeproj/project.pbxproj
branches/movement/source/actions/EnvironmentActions.cc
branches/movement/source/actions/LandscapeActions.cc
branches/movement/source/cpu/cHardwareExperimental.cc
branches/movement/source/cpu/cHardwareExperimental.h
branches/movement/source/main/cPopulation.cc
branches/movement/source/script/ASTree.h
branches/movement/source/script/AvidaScript.h
branches/movement/source/script/cASFunction.h
branches/movement/source/script/cDirectInterpretASTVisitor.cc
branches/movement/source/script/cDirectInterpretASTVisitor.h
branches/movement/source/script/cSemanticASTVisitor.cc
Log:
Merged changes from development branch r2771:2789 into branches/movement.
Modified: branches/movement/Avida.xcodeproj/project.pbxproj
===================================================================
--- branches/movement/Avida.xcodeproj/project.pbxproj 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/Avida.xcodeproj/project.pbxproj 2008-09-15 13:06:42 UTC (rev 2790)
@@ -591,6 +591,8 @@
70A778370D69D5C200735F1E /* cDemeProbSchedule.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cDemeProbSchedule.cc; sourceTree = "<group>"; };
70A778380D69D5C200735F1E /* cDemeProbSchedule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cDemeProbSchedule.h; sourceTree = "<group>"; };
70AA941909D486AE006A24C8 /* libtcmalloc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libtcmalloc.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 70AE2D360E7DCAA100A520B5 /* cASNativeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cASNativeObject.h; sourceTree = "<group>"; };
+ 70AE2D3B0E7DF6C500A520B5 /* cASCPPParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cASCPPParameter.h; sourceTree = "<group>"; };
70B0864808F4972600FC65FE /* cLandscape.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cLandscape.h; sourceTree = "<group>"; };
70B0864B08F4972600FC65FE /* cLocalMutations.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cLocalMutations.h; sourceTree = "<group>"; };
70B0864C08F4972600FC65FE /* cMutation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cMutation.h; sourceTree = "<group>"; };
@@ -1243,6 +1245,8 @@
70A33CE80D8DBD1E008EF976 /* cASFunction.h */,
70A33CF40D8DCBB4008EF976 /* ASCoreLib.h */,
70A33CF50D8DCBB4008EF976 /* ASCoreLib.cc */,
+ 70AE2D360E7DCAA100A520B5 /* cASNativeObject.h */,
+ 70AE2D3B0E7DF6C500A520B5 /* cASCPPParameter.h */,
);
path = script;
sourceTree = "<group>";
Modified: branches/movement/source/actions/EnvironmentActions.cc
===================================================================
--- branches/movement/source/actions/EnvironmentActions.cc 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/source/actions/EnvironmentActions.cc 2008-09-15 13:06:42 UTC (rev 2790)
@@ -567,23 +567,27 @@
class cActionSetSeasonalResource1Kyears_1To_1 : public cAction {
private:
cString m_res_name;
+ double m_scale;
public:
- cActionSetSeasonalResource1Kyears_1To_1(cWorld* world, const cString& args): cAction(world, args), m_res_name("")
+ cActionSetSeasonalResource1Kyears_1To_1(cWorld* world, const cString& args): cAction(world, args), m_res_name(""), m_scale(1.0)
{
cString largs(args);
if (largs.GetSize()) m_res_name = largs.PopWord();
+ if (largs.GetSize()) m_scale = largs.PopWord().AsDouble();
}
- static const cString GetDescription() { return "Arguments: <string reaction_name>"; }
+ static const cString GetDescription() { return "Arguments: <string reaction_name> <double scale>"; }
void Process(cAvidaContext& ctx)
{
int time = m_world->GetStats().GetUpdate();
double m_res_count = -1*(tanh((time-182500)/50000)+1)*(0.5*sin(time/58.091)+0.5)+1;
+ if(m_res_count < 0.0)
+ m_res_count = 0.0;
cResource* res = m_world->GetEnvironment().GetResourceLib().GetResource(m_res_name);
if (res != NULL)
- m_world->GetPopulation().SetResource(res->GetID(), m_res_count);
+ m_world->GetPopulation().SetResource(res->GetID(), m_res_count * m_scale);
}
};
@@ -594,23 +598,28 @@
class cActionSetSeasonalResource10Kyears_1To_1 : public cAction {
private:
cString m_res_name;
+ double m_scale;
public:
- cActionSetSeasonalResource10Kyears_1To_1(cWorld* world, const cString& args): cAction(world, args), m_res_name("")
+ cActionSetSeasonalResource10Kyears_1To_1(cWorld* world, const cString& args): cAction(world, args), m_res_name(""), m_scale(1.0)
{
cString largs(args);
if (largs.GetSize()) m_res_name = largs.PopWord();
+ if (largs.GetSize()) m_scale = largs.PopWord().AsDouble();
+
}
- static const cString GetDescription() { return "Arguments: <string reaction_name>"; }
+ static const cString GetDescription() { return "Arguments: <string reaction_name> <double scale>"; }
void Process(cAvidaContext& ctx)
{
int time = m_world->GetStats().GetUpdate();
double m_res_count = -1*(tanh((time-1825000)/500000)+1)*(0.5*sin(time/58.091)+0.5)+1;
+ if(m_res_count < 0.0)
+ m_res_count = 0.0;
cResource* res = m_world->GetEnvironment().GetResourceLib().GetResource(m_res_name);
if (res != NULL)
- m_world->GetPopulation().SetResource(res->GetID(), m_res_count);
+ m_world->GetPopulation().SetResource(res->GetID(), m_res_count* m_scale);
}
};
Modified: branches/movement/source/actions/LandscapeActions.cc
===================================================================
--- branches/movement/source/actions/LandscapeActions.cc 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/source/actions/LandscapeActions.cc 2008-09-15 13:06:42 UTC (rev 2790)
@@ -227,6 +227,11 @@
int update = -1;
cLandscape* land = NULL;
+ if (m_dist < 1) {
+ m_world->GetDriver().RaiseException("landscape distance must be >= 1");
+ return;
+ }
+
if (ctx.GetAnalyzeMode()) {
if (m_world->GetVerbosity() >= VERBOSE_ON) {
cString msg("Full Landscaping batch ");
Modified: branches/movement/source/cpu/cHardwareExperimental.cc
===================================================================
--- branches/movement/source/cpu/cHardwareExperimental.cc 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/source/cpu/cHardwareExperimental.cc 2008-09-15 13:06:42 UTC (rev 2790)
@@ -147,6 +147,7 @@
// Replication Instructions
tInstLibEntry<tMethod>("h-alloc", &cHardwareExperimental::Inst_HeadAlloc, nInstFlag::DEFAULT, "Allocate maximum allowed space"),
tInstLibEntry<tMethod>("h-divide", &cHardwareExperimental::Inst_HeadDivide, (nInstFlag::DEFAULT | nInstFlag::STALL), "Divide code between read and write heads."),
+ tInstLibEntry<tMethod>("h-divide-sex", &cHardwareExperimental::Inst_HeadDivideSex, (nInstFlag::DEFAULT | nInstFlag::STALL), "Divide code between read and write heads."),
tInstLibEntry<tMethod>("h-copy", &cHardwareExperimental::Inst_HeadCopy, nInstFlag::DEFAULT, "Copy from read-head to write-head; advance both"),
tInstLibEntry<tMethod>("if-label", &cHardwareExperimental::Inst_IfLabel, nInstFlag::DEFAULT, "Execute next if we copied complement of attached label"),
@@ -1341,8 +1342,12 @@
return true;
}
+
bool cHardwareExperimental::Inst_HeadDivide(cAvidaContext& ctx)
{
+ organism->GetPhenotype().SetDivideSex(false);
+ organism->GetPhenotype().SetCrossNum(0);
+
AdjustHeads();
const int divide_pos = GetHead(nHardware::HEAD_READ).GetPosition();
int child_end = GetHead(nHardware::HEAD_WRITE).GetPosition();
@@ -1355,6 +1360,23 @@
}
+bool cHardwareExperimental::Inst_HeadDivideSex(cAvidaContext& ctx)
+{
+ organism->GetPhenotype().SetDivideSex(true);
+ organism->GetPhenotype().SetCrossNum(1);
+
+ AdjustHeads();
+ const int divide_pos = GetHead(nHardware::HEAD_READ).GetPosition();
+ int child_end = GetHead(nHardware::HEAD_WRITE).GetPosition();
+ if (child_end == 0) child_end = m_memory.GetSize();
+ const int extra_lines = m_memory.GetSize() - child_end;
+ bool ret_val = Divide_Main(ctx, divide_pos, extra_lines, 1.0);
+ // Re-adjust heads.
+ AdjustHeads();
+ return ret_val;
+}
+
+
bool cHardwareExperimental::Inst_HeadRead(cAvidaContext& ctx)
{
const int dst = FindModifiedRegister(REG_BX);
Modified: branches/movement/source/cpu/cHardwareExperimental.h
===================================================================
--- branches/movement/source/cpu/cHardwareExperimental.h 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/source/cpu/cHardwareExperimental.h 2008-09-15 13:06:42 UTC (rev 2790)
@@ -400,6 +400,7 @@
bool Inst_GetHead(cAvidaContext& ctx);
bool Inst_IfLabel(cAvidaContext& ctx);
bool Inst_HeadDivide(cAvidaContext& ctx);
+ bool Inst_HeadDivideSex(cAvidaContext& ctx);
bool Inst_HeadRead(cAvidaContext& ctx);
bool Inst_HeadWrite(cAvidaContext& ctx);
bool Inst_HeadCopy(cAvidaContext& ctx);
Modified: branches/movement/source/main/cPopulation.cc
===================================================================
--- branches/movement/source/main/cPopulation.cc 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/source/main/cPopulation.cc 2008-09-15 13:06:42 UTC (rev 2790)
@@ -3047,7 +3047,7 @@
assert(parent_cell.IsOccupied());
const int birth_method = m_world->GetConfig().BIRTH_METHOD.Get();
-
+
//@AWC -- decide whether the child will migrate to another deme -- if migrating we ignore the birth method.
if ((m_world->GetConfig().MIGRATION_RATE.Get() > 0.0) //@AWC -- Pedantic test to maintain consistency.
&& m_world->GetRandom().P(m_world->GetConfig().MIGRATION_RATE.Get())) {
Modified: branches/movement/source/script/ASTree.h
===================================================================
--- branches/movement/source/script/ASTree.h 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/source/script/ASTree.h 2008-09-15 13:06:42 UTC (rev 2790)
@@ -600,7 +600,7 @@
public:
cASTObjectCall(const cASFilePosition& fp, cASTNode* object, const cString& name)
- : cASTNode(fp), m_object(object), m_name(name), m_args(NULL), m_type(AS_TYPE_INVALID) { ; }
+ : cASTNode(fp), m_object(object), m_name(name), m_args(NULL), m_type(AS_TYPE_RUNTIME) { ; }
~cASTObjectCall() { delete m_object; delete m_args; }
cASTNode* GetObject() { return m_object; }
@@ -609,10 +609,8 @@
void SetArguments(cASTArgumentList* args) { delete m_args; m_args = args; }
cASTArgumentList* GetArguments() { return m_args; }
- const sASTypeInfo& GetType() const { return m_type; }
- inline void SetType(const sASTypeInfo& type) { m_type = type; }
+ const sASTypeInfo& GetType() const { return m_type; }
-
bool HasArguments() const { return (m_args); }
void Accept(cASTVisitor& visitor);
@@ -628,7 +626,7 @@
public:
cASTObjectReference(const cASFilePosition& fp, cASTNode* object, const cString& name)
- : cASTNode(fp), m_object(object), m_name(name), m_type(AS_TYPE_OBJECT_REF) { ; }
+ : cASTNode(fp), m_object(object), m_name(name), m_type(AS_TYPE_RUNTIME) { ; }
~cASTObjectReference() { delete m_object; }
cASTNode* GetObject() { return m_object; }
Modified: branches/movement/source/script/AvidaScript.h
===================================================================
--- branches/movement/source/script/AvidaScript.h 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/source/script/AvidaScript.h 2008-09-15 13:06:42 UTC (rev 2790)
@@ -242,7 +242,11 @@
bool operator!=(const sASTypeInfo& ot) const { return (type != ot.type || info != ot.info); }
};
+enum eASMethodReturnValues {
+ AS_NOT_FOUND = -1
+};
+
namespace AvidaScript {
const char* mapBuiltIn(ASBuiltIn_t builtin);
const char* mapToken(ASToken_t token);
Copied: branches/movement/source/script/cASCPPParameter.h (from rev 2789, development/source/script/cASCPPParameter.h)
===================================================================
--- branches/movement/source/script/cASCPPParameter.h (rev 0)
+++ branches/movement/source/script/cASCPPParameter.h 2008-09-15 13:06:42 UTC (rev 2790)
@@ -0,0 +1,66 @@
+/*
+ * cASCPPParameter.h
+ * Avida
+ *
+ * Created by David Bryson on 9/14/08.
+ * Copyright 2008 Michigan State University. All rights reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef cASCPPParameter_h
+#define cASCPPParameter_h
+
+#include "avida.h"
+#include "AvidaScript.h"
+
+#include "cString.h"
+
+
+class cASCPPParameter
+{
+private:
+ union {
+ bool m_bool;
+ char m_char;
+ int m_int;
+ double m_float;
+ cString* m_string;
+ };
+
+public:
+ cASCPPParameter() { ; }
+
+ void Set(bool val) { m_bool = val; }
+ void Set(char val) { m_char = val; }
+ void Set(int val) { m_int = val; }
+ void Set(double val) { m_float = val; }
+ void Set(cString* val) { m_string = val; }
+ void Set(const cString& val) { m_string = new cString(val); }
+
+ template<typename T> inline T Get() const { Avida::Exit(AS_EXIT_INTERNAL_ERROR); return m_int; }
+};
+
+template<> inline bool cASCPPParameter::Get<bool>() const { return m_bool; }
+template<> inline char cASCPPParameter::Get<char>() const { return m_char; }
+template<> inline int cASCPPParameter::Get<int>() const { return m_int; }
+template<> inline double cASCPPParameter::Get<double>() const { return m_float; }
+template<> inline const cString& cASCPPParameter::Get<const cString&>() const { return *m_string; }
+template<> inline const cString* cASCPPParameter::Get<const cString*>() const { return m_string; }
+template<> inline cString* cASCPPParameter::Get<cString*>() const { return m_string; }
+
+#endif
Modified: branches/movement/source/script/cASFunction.h
===================================================================
--- branches/movement/source/script/cASFunction.h 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/source/script/cASFunction.h 2008-09-15 13:06:42 UTC (rev 2790)
@@ -25,40 +25,14 @@
#ifndef cASFunction_h
#define cASFunction_h
-#include "avida.h"
#include "AvidaScript.h"
+#include "cASCPPParameter.h"
#include "cString.h"
class cASFunction
{
-public:
- class cParameter
- {
- private:
- union {
- bool m_bool;
- char m_char;
- int m_int;
- double m_float;
- cString* m_string;
- };
-
- public:
- cParameter() { ; }
-
- void Set(bool val) { m_bool = val; }
- void Set(char val) { m_char = val; }
- void Set(int val) { m_int = val; }
- void Set(double val) { m_float = val; }
- void Set(cString* val) { m_string = val; }
- void Set(const cString& val) { m_string = new cString(val); }
-
- template<typename T> inline T Get() const { Avida::Exit(AS_EXIT_INTERNAL_ERROR); return m_int; }
- };
-
-
protected:
cString m_name;
sASTypeInfo m_rtype;
@@ -74,19 +48,10 @@
const sASTypeInfo& GetReturnType() const { return m_rtype; }
virtual const sASTypeInfo& GetArgumentType(int arg) const = 0;
- virtual cParameter Call(cParameter args[]) const = 0;
+ virtual cASCPPParameter Call(cASCPPParameter args[]) const = 0;
};
-template<> inline bool cASFunction::cParameter::Get<bool>() const { return m_bool; }
-template<> inline char cASFunction::cParameter::Get<char>() const { return m_char; }
-template<> inline int cASFunction::cParameter::Get<int>() const { return m_int; }
-template<> inline double cASFunction::cParameter::Get<double>() const { return m_float; }
-template<> inline const cString& cASFunction::cParameter::Get<const cString&>() const { return *m_string; }
-template<> inline const cString* cASFunction::cParameter::Get<const cString*>() const { return m_string; }
-template<> inline cString* cASFunction::cParameter::Get<cString*>() const { return m_string; }
-
-
template<typename FunctionType> class tASFunction;
@@ -110,9 +75,9 @@
int GetArity() const { return 1; }
const sASTypeInfo& GetArgumentType(int arg) const { return m_signature; }
- cParameter Call(cParameter args[]) const
+ cASCPPParameter Call(cASCPPParameter args[]) const
{
- cParameter rvalue;
+ cASCPPParameter rvalue;
rvalue.Set((*m_func)(args[0].Get<Arg1Type>()));
return rvalue;
}
@@ -139,11 +104,11 @@
int GetArity() const { return 1; }
const sASTypeInfo& GetArgumentType(int arg) const { return m_signature; }
- cParameter Call(cParameter args[]) const
+ cASCPPParameter Call(cASCPPParameter args[]) const
{
(*m_func)(args[0].Get<Arg1Type>());
- return cParameter();
+ return cASCPPParameter();
}
};
Copied: branches/movement/source/script/cASNativeObject.h (from rev 2789, development/source/script/cASNativeObject.h)
===================================================================
--- branches/movement/source/script/cASNativeObject.h (rev 0)
+++ branches/movement/source/script/cASNativeObject.h 2008-09-15 13:06:42 UTC (rev 2790)
@@ -0,0 +1,49 @@
+/*
+ * cASNativeObject.h
+ * Avida
+ *
+ * Created by David Bryson on 9/14/08.
+ * Copyright 2008 Michigan State University. All rights reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef cASNativeObject_h
+#define cASNativeObject_h
+
+#include "AvidaScript.h"
+
+#include "cASCPPParameter.h"
+
+class cString;
+
+class cASNativeObject
+{
+
+public:
+ cASNativeObject() { ; }
+ virtual ~cASNativeObject() { ; }
+
+ bool CallMethod(int mid, int argc, cASCPPParameter args[]) { return false; } // @TODO
+
+ int LookupValue(const cString& val_name) { return AS_NOT_FOUND; } // @TODO
+ int LookupMethod(const cString& meth_name) { return AS_NOT_FOUND; } // @TODO
+
+ void Release() { ; }
+};
+
+#endif
Modified: branches/movement/source/script/cDirectInterpretASTVisitor.cc
===================================================================
--- branches/movement/source/script/cDirectInterpretASTVisitor.cc 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/source/script/cDirectInterpretASTVisitor.cc 2008-09-15 13:06:42 UTC (rev 2790)
@@ -1145,7 +1145,7 @@
const cASFunction* func = node.GetASFunction();
// Setup arguments
- cASFunction::cParameter* args = new cASFunction::cParameter[func->GetArity()];
+ cASCPPParameter* args = new cASCPPParameter[func->GetArity()];
tListIterator<cASTNode> cit = node.GetArguments()->Iterator();
cASTNode* an = NULL;
for (int i = 0; i < func->GetArity(); i++) {
@@ -1165,7 +1165,7 @@
}
// Call the function
- cASFunction::cParameter rvalue = func->Call(args);
+ cASCPPParameter rvalue = func->Call(args);
// Handle the return value
switch (node.GetType().type) {
Modified: branches/movement/source/script/cDirectInterpretASTVisitor.h
===================================================================
--- branches/movement/source/script/cDirectInterpretASTVisitor.h 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/source/script/cDirectInterpretASTVisitor.h 2008-09-15 13:06:42 UTC (rev 2790)
@@ -25,6 +25,7 @@
#ifndef cDirectInterpretASTVisitor_h
#define cDirectInterpretASTVisitor_h
+#include "cASNativeObject.h"
#include "cASTVisitor.h"
#include "tHashTable.h"
@@ -306,6 +307,22 @@
bool Set(sAggregateValue& idx, sAggregateValue& val);
};
+ class cNativeObjectRef : public cObjectRef
+ {
+ private:
+ cASNativeObject* m_no;
+
+ public:
+ cNativeObjectRef();
+ ~cNativeObjectRef() { m_no->Release(); }
+
+ bool IsWritable() { return false; }
+ bool Get(sAggregateValue& val) { return false; }
+ bool Get(const sAggregateValue& idx, sAggregateValue& val) { return false; }
+ bool Set(sAggregateValue& val) { return false; }
+ bool Set(sAggregateValue& idx, sAggregateValue& val) { return false; }
+ };
+
class cObjectIndexRef : public cObjectRef
{
private:
Modified: branches/movement/source/script/cSemanticASTVisitor.cc
===================================================================
--- branches/movement/source/script/cSemanticASTVisitor.cc 2008-09-15 03:42:39 UTC (rev 2789)
+++ branches/movement/source/script/cSemanticASTVisitor.cc 2008-09-15 13:06:42 UTC (rev 2790)
@@ -810,15 +810,21 @@
void cSemanticASTVisitor::VisitObjectCall(cASTObjectCall& node)
{
- // @TODO - object call
- SEMANTIC_ERROR(INTERNAL);
+ node.GetObject()->Accept(*this);
+ checkCast(node.GetObject()->GetType(), TYPEINFO(OBJECT_REF));
+
+ if (node.HasArguments()) {
+ tListIterator<cASTNode> it = node.GetArguments()->Iterator();
+ cASTNode* an = NULL;
+ while((an = it.Next())) an->Accept(*this);
+ }
}
void cSemanticASTVisitor::VisitObjectReference(cASTObjectReference& node)
{
- // @TODO - object reference
- SEMANTIC_ERROR(INTERNAL);
+ node.GetObject()->Accept(*this);
+ checkCast(node.GetObject()->GetType(), TYPEINFO(OBJECT_REF));
}
More information about the Avida-cvs
mailing list