1 #ifndef FCONSTRUCT_H
2 #define FCONSTRUCT_H
3 
4 #include <sdk.h>
5 #ifndef CB_PRECOMP
6     #include <wx/string.h>
7     #include <wx/regex.h>
8 #endif
9 #include <vector>
10 #include <map>
11 
12 class FConstruct
13 {
14     public:
15         enum FCLid
16         {
17             fclUnknown,
18             fclIf_if_then,
19             fclIf_else_if_then,
20             fclIf_else,
21             fclIf_end_if,
22             fclDo_do,
23             fclDo_end_do,
24             fclInterf_interf,
25             fclInterf_end_interf,
26             fclSub_sub,
27             fclSub_end_sub,
28             fclFun_fun,
29             fclFun_end_fun,
30             fclProg_prog,
31             fclProg_end_prog,
32             fclMod_module,
33             fclMod_end_module,
34             fclSubmod_submod,
35             fclSubmod_end_submod,
36             fclSelect_end,
37             fclSelectCase_start,
38             fclSelectCase_case,
39             fclSelectType_start,
40             fclSelectType_type_is,
41             fclSelectType_class_is,
42             fclSelectType_class_default,
43             fclType_type,
44             fclType_end_type,
45             fclEnum_enum,
46             fclEnum_end_enum,
47             fclCritical_critical,
48             fclCritical_end_critical,
49             fclForall_forall,
50             fclForall_end_forall,
51             fclAssoc_associate,
52             fclAssoc_end_associate,
53             fclBlock_block,
54             fclBlock_end_block,
55             fclTeam_change_team,
56             fclTeam_end_team,
57             fclWhere_where,
58             fclWhere_else_where,
59             fclWhere_end_where,
60             fclBlockdata_blockdata,
61             fclBlockdata_end_blockdata,
62             fclProc_mod_proc,
63             fclProc_end_proc,
64 
65             fclProgGroup_start,
66             fclProgGroup_end,
67 
68             fclSelGroup_start,
69             fclSelGroup_end,
70         };
71 
72         enum FConstructType
73         {
74             ctProgramGroup,
75             ctSelectGroup,
76             ctIf,
77             ctDo,
78             ctSubroutine,
79             ctFunction,
80             ctInterface,
81             ctAssiciate,
82             ctBlock,
83             ctBlockdata,
84             ctCritical,
85             ctModule,
86             ctProgram,
87             ctCase,
88             ctType,
89             ctWhere,
90             ctEnum,
91             ctForall,
92             ctSubmodule,
93             ctTeam,
94             ctProcedure,
95             ctEnd,
96             ctUnknown
97         };
98 
99         static std::map<FCLid, wxRegEx*> FCLReMap;
100         static void MakeFCLReMap();
101         static void DelFCLReMap();
102 
103         static std::map<FCLid, std::vector<wxString> > FCLWordMap;
104         static void MakeFCLWordMap();
105         static void GetWordsFromFCLid(FCLid flid, wxString& word1, wxString& word2, wxString& word3);
106 
107         static std::map<wxString, std::vector<FCLid> > WordFCLidMap;
108         static void MakeWordFCLidMap();
109 
110     public:
111         FConstruct();
112         virtual ~FConstruct();
113         void Clear();
114         void AddPart(const wxString& word1, const wxString& word2, const wxString& word3);
115         void GetWords(int i, wxString& word1, wxString& word2, wxString& word3, FCLid& flid) const;
Size()116         size_t Size() const {return m_Parts.size();};
SetType(FConstructType fct)117         void SetType(FConstructType fct) {m_Fct = fct;};
GetType()118         FConstructType GetType() const {return m_Fct;};
119 
120     private:
121         FConstructType m_Fct;
122         std::vector<std::vector<wxString> > m_Parts;
123 };
124 
125 #endif // FCONSTRUCT_H
126