From ab016596602a4c6bdc27adf01c308b325af221f0 Mon Sep 17 00:00:00 2001 From: Tuowen Zhao Date: Wed, 21 Sep 2016 22:35:47 -0600 Subject: something that only builds ... --- lib/chillcg/include/code_gen/CG_chillRepr.h | 87 +++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100755 lib/chillcg/include/code_gen/CG_chillRepr.h (limited to 'lib/chillcg/include/code_gen/CG_chillRepr.h') diff --git a/lib/chillcg/include/code_gen/CG_chillRepr.h b/lib/chillcg/include/code_gen/CG_chillRepr.h new file mode 100755 index 0000000..3d19de7 --- /dev/null +++ b/lib/chillcg/include/code_gen/CG_chillRepr.h @@ -0,0 +1,87 @@ + +#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 "chill_ast.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 -- cgit v1.2.3-70-g09d2