00001 #ifndef _MEMBER_H
00002 #define _MEMBER_H
00003
00004 #include "xi-Construct.h"
00005
00006 namespace xi {
00007
00008 class SdagCollection;
00009 class ValueList;
00010 class WhenStatementEChecker;
00011 class Chare;
00012 class CEntry;
00013 class Type;
00014 class NamedType;
00015
00016
00017 class Member : public Construct {
00018
00019 protected:
00020 Chare* container;
00021
00022 public:
00023 TVarList* tspec;
00024 Member() : container(0), tspec(0) {}
00025 inline Chare* getContainer() const { return container; }
00026 virtual void setChare(Chare* c) { container = c; }
00027 virtual void preprocessSDAG() {}
00028 virtual int isSdag(void) { return 0; }
00029 virtual void collectSdagCode(SdagCollection*) { return; }
00030 virtual void collectSdagCode(WhenStatementEChecker*) { return; }
00031 XStr makeDecl(const XStr& returnType, int forProxy = 0, bool isStatic = false, XStr fwdStr = XStr());
00032 virtual void genPythonDecls(XStr&) {}
00033 virtual void genIndexDecls(XStr&) {}
00034 virtual void genPythonDefs(XStr&) {}
00035 virtual void genPythonStaticDefs(XStr&) {}
00036 virtual void genPythonStaticDocs(XStr&) {}
00037 virtual void lookforCEntry(CEntry*) {}
00038 virtual void genTramTypes() {}
00039 virtual bool isTramTarget() { return false; }
00040 };
00041
00042 class Readonly : public Member {
00043 int msg;
00044 Type* type;
00045 const char* name;
00046 ValueList* dims;
00047 XStr qName(void) const;
00048
00049 public:
00050 Readonly(int l, Type* t, const char* n, ValueList* d, int m = 0);
00051 void print(XStr& str);
00052 void genDecls(XStr& str);
00053 void genIndexDecls(XStr& str);
00054 void genDefs(XStr& str);
00055 void genReg(XStr& str);
00056 };
00057
00058 class InitCall : public Member {
00059 const char* name;
00060 int isNodeCall;
00061
00062
00063 int isAccelFlag;
00064
00065 public:
00066 InitCall(int l, const char* n, int nodeCall);
00067 void print(XStr& str);
00068 void genReg(XStr& str);
00069
00070
00071 void genAccels_spe_c_callInits(XStr& str);
00072
00073 void setAccel();
00074 void clearAccel();
00075 int isAccel();
00076 };
00077
00078 class PUPableClass : public Member {
00079 NamedType* type;
00080 PUPableClass* next;
00081 public:
00082 PUPableClass(int l, NamedType* type_, PUPableClass* next_);
00083 void print(XStr& str);
00084 void genDefs(XStr& str);
00085 void genReg(XStr& str);
00086
00087
00088 int genAccels_spe_c_funcBodies(XStr& str);
00089 void genAccels_spe_c_regFuncs(XStr& str);
00090 void genAccels_spe_c_callInits(XStr& str);
00091 void genAccels_spe_h_includes(XStr& str);
00092 void genAccels_spe_h_fiCountDefs(XStr& str);
00093 void genAccels_ppe_c_regFuncs(XStr& str);
00094 };
00095
00096 class IncludeFile : public Member {
00097 const char* name;
00098 public:
00099 IncludeFile(int l, const char* name_);
00100 void print(XStr& str);
00101 void genDecls(XStr& str);
00102 };
00103
00104 class ClassDeclaration : public Member {
00105 const char* name;
00106 public:
00107 ClassDeclaration(int l, const char* name_);
00108 void print(XStr& str);
00109 void genDecls(XStr& str);
00110 };
00111
00112 }
00113
00114 #endif // ifndef _MEMBER_H