source: icGREP/icgrep-devel/icgrep/cc_compiler.h @ 4129

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

Revert CR introduction; eliminate unused code for 'predefined' syms

File size: 1.5 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_COMPILER_H
8#define CC_COMPILER_H
9
10#include "ps_pablos.h"
11#include "cc_codegenobject.h"
12#include "utf_encoding.h"
13#include "cc_compiler_helper.h"
14
15#include <math.h>
16#include <utility>
17#include <iostream>
18#include <sstream>
19#include <string>
20#include <list>
21#include <map>
22#include <algorithm>
23
24#include <cassert>
25#include <stdlib.h>
26
27
28class CC_Compiler
29{
30public:
31    CC_Compiler(UTF_Encoding encoding);
32    std::list<PabloS*> compile(std::string basis_pattern,
33                               std::string gensym_pattern,
34                               const std::map<std::string, RE*>& re_map);
35private:
36    void process_re_map(CC_CodeGenObject& cgo, const std::map<std::string, RE*>& re_map);
37    void process_re(CC_CodeGenObject& cgo, RE* re);
38    std::string bit_var(int n);
39    PabloE* make_bitv(int n);
40    PabloE* bit_pattern_expr(int pattern, int selected_bits);
41    PabloE* char_test_expr(int ch);
42    PabloE* make_range(int n1, int n2);
43    PabloE* GE_Range(int N, int n);
44    PabloE* LE_Range(int N, int n);
45    PabloE* char_or_range_expr(CharSetItem charset_item);
46    PabloE* charset_expr(CC* cc);
47    Expression* expr2pabloe(CC_CodeGenObject& cgo, PabloE* expr);
48    CC_CodeGenObject cc2pablos(CC_CodeGenObject cgo, CC* cc);
49
50    UTF_Encoding mEncoding;
51};
52
53#endif // CC_COMPILER_H
54
55
Note: See TracBrowser for help on using the repository browser.