#ifndef CG_chillRepr_h #define CG_chillRepr_h // Repr using chillAst internally #include #include #include #ifndef __STDC_CONSTANT_MACROS #define __STDC_CONSTANT_MACROS #endif #include "chillAST/chillASTs.hh" namespace omega { class CG_chillRepr : public CG_outputRepr { friend class CG_chillBuilder; public: CG_chillRepr() { stmtclassname = strdup("NOTHING"); } char *type() const { return strdup("chill"); }; // std::vector chillnodes; // TODO make private void printChillNodes() const { for (int i=0; iprint(); printf("\n"); } fflush(stdout); }; CG_chillRepr( std::vector cnodes ) { chillnodes = cnodes; } CG_chillRepr( chillAST_node *chillast ) { stmtclassname = strdup(chillast->getTypeString()); //fprintf(stderr, "made new chillRepr of class %s\n", stmtclassname); if (chillast->asttype == CHILLAST_NODETYPE_COMPOUNDSTMT) { std::vector children = chillast->getChildren(); int numchildren = children.size(); for (int i=0; i getChillCode() const { return chillnodes; }; chillAST_node *GetCode() ; ~CG_chillRepr(); CG_outputRepr *clone() const; void clear(); //--------------------------------------------------------------------------- // Dump operations //--------------------------------------------------------------------------- void dump() const { printChillNodes(); }; void Dump() const; //void DumpToFile(FILE *fp = stderr) const; private: char *stmtclassname; // chill }; } // namespace #endif