summaryrefslogtreecommitdiff
path: root/lib/rosecg/include/code_gen/CG_roseRepr.h
blob: 28553e7ba0d574ada50ff419139d1fb94edb28e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef CG_roseRepr_h
#define CG_roseRepr_h

#include <code_gen/CG_outputRepr.h>
#include "rose.h"

namespace omega {

class CG_roseRepr : public CG_outputRepr {
  friend class CG_roseBuilder;
public:
  CG_roseRepr();
  CG_roseRepr(SgNode *tnl);
  CG_roseRepr(SgExpression *exp);
  CG_roseRepr(SgStatementPtrList* stmtlist);

  ~CG_roseRepr();
  CG_outputRepr *clone() const;
  void clear();

  SgNode* GetCode() const;
  SgStatementPtrList* GetList() const;
  SgExpression *GetExpression() const;




  //---------------------------------------------------------------------------
  // Dump operations
  //---------------------------------------------------------------------------
  void Dump() const;
private:
  // only one of _tnl and _op would be active at any time, depending on
  // whether it is building a statement list or an expression tree
  SgNode  *tnl_;
  SgExpression  *op_;
  SgStatementPtrList *list_;
  void DumpFileHelper(SgNode* node, FILE* fp) const; 
  //operand op_;
};



} // namespace

#endif