source: icGREP/icgrep-devel/icgrep/cc_codegenobject.h @ 3935

Last change on this file since 3935 was 3850, checked in by cameron, 5 years ago

icgrep-0.8 distribution

File size: 1.3 KB
Line 
1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef CC_CODEGENOBJECT_H
8#define CC_CODEGENOBJECT_H
9
10//Pablo Expressions
11#include "pe_pabloe.h"
12#include "pe_sel.h"
13#include "pe_advance.h"
14#include "pe_all.h"
15#include "pe_and.h"
16#include "pe_charclass.h"
17#include "pe_matchstar.h"
18#include "pe_not.h"
19#include "pe_or.h"
20#include "pe_var.h"
21#include "pe_xor.h"
22
23//Pablo Statements
24#include "ps_pablos.h"
25#include "ps_assign.h"
26#include "ps_if.h"
27#include "ps_while.h"
28
29#include <iostream>
30#include <sstream>
31#include <string>
32#include <list>
33#include <map>
34
35#define INT2STRING(i) static_cast<std::ostringstream*>(&(std::ostringstream() << i))->str()
36
37struct Expression{
38    std::string expr_string;
39    PabloE* pablo_expr;
40};
41
42class CC_CodeGenObject
43{
44public:
45    CC_CodeGenObject(std::string gensym_pattern);
46    void add_predefined(std::string key_value, Expression *mapped_value);
47    Expression* add_assignment(std::string value, Expression* expr);
48    Expression* expr_to_variable(Expression* cgo);
49    std::list<PabloS*> get_stmtsl();
50private:
51    std::string mGenSym_Template;
52    int mGenSymCounter;
53    std::list<PabloS*> mStmtsl;
54    std::map<std::string, Expression*> mCommon_Expression_Map;
55};
56
57#endif // CC_CODEGENOBJECT_H
Note: See TracBrowser for help on using the repository browser.