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

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

Updates for icgrep-0.9: re simplifications, re names, replimit mods, debugged while loops

File size: 1.4 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 COMPILER_H
8#define COMPILER_H
9
10//Regular Expressions
11#include "re_re.h"
12#include "re_name.h"
13#include "re_start.h"
14#include "re_end.h"
15#include "re_seq.h"
16#include "re_alt.h"
17#include "re_rep.h"
18
19//Pablo Expressions
20#include "pe_pabloe.h"
21#include "pe_sel.h"
22#include "pe_advance.h"
23#include "pe_all.h"
24#include "pe_and.h"
25#include "pe_charclass.h"
26#include "pe_matchstar.h"
27#include "pe_not.h"
28#include "pe_or.h"
29#include "pe_var.h"
30#include "pe_xor.h"
31
32//Pablo Statements
33#include "ps_pablos.h"
34#include "ps_assign.h"
35#include "ps_if.h"
36#include "ps_while.h"
37
38//Code Generation
39#include "symbol_generator.h"
40
41#include <iostream>
42#include <string>
43#include <sstream>
44#include <list>
45#include <vector>
46
47
48struct CodeGenState{
49    std::list<PabloS*> stmtsl;
50    std::string newsym;
51};
52
53class Pbix_Compiler
54{
55public:
56    Pbix_Compiler(std::string lf_ccname);
57    CodeGenState compile(RE *re);
58private:
59    CodeGenState re2pablo_helper(RE *re, CodeGenState cg_state);
60    CodeGenState Seq_helper(std::list<RE*>* lst, std::list<RE*>::const_iterator it, CodeGenState cg_state);
61    CodeGenState Alt_helper(std::list<RE*>* lst, std::list<RE*>::const_iterator it, CodeGenState cg_state);
62
63    SymbolGenerator symgen;
64    std::string m_lf_ccname;
65};
66
67#endif // COMPILER_H
Note: See TracBrowser for help on using the repository browser.