use typename
[prop.git] / prop-src / grsgen.cc
blob37f5314849401bb615a0f0b26d240ab369c0ab53
1 ///////////////////////////////////////////////////////////////////////////////
2 // This file is generated automatically using Prop (version 2.3.6),
3 // last updated on Nov 2, 1999.
4 // The original source file is "grsgen.pcc".
5 ///////////////////////////////////////////////////////////////////////////////
7 #line 1 "grsgen.pcc"
8 ///////////////////////////////////////////////////////////////////////////////
9 //
10 // This file implements the graph rewriting system compiler.
12 ///////////////////////////////////////////////////////////////////////////////
13 #include "ir.h"
14 #include "ast.h"
15 #include "type.h"
16 #include "grsgen.h"
18 #line 11 "grsgen.pcc"
19 #line 11 "grsgen.pcc"
20 ///////////////////////////////////////////////////////////////////////////////
22 // Interface specification of datatype GraphRewritingRule
24 ///////////////////////////////////////////////////////////////////////////////
25 #line 11 "grsgen.pcc"
28 ///////////////////////////////////////////////////////////////////////////////
30 // Interface specification of datatype GRSPat
32 ///////////////////////////////////////////////////////////////////////////////
33 #line 11 "grsgen.pcc"
36 ///////////////////////////////////////////////////////////////////////////////
38 // Interface specification of datatype GRSConclusion
40 ///////////////////////////////////////////////////////////////////////////////
41 #line 11 "grsgen.pcc"
44 ///////////////////////////////////////////////////////////////////////////////
46 // Interface specification of datatype List<GraphRewritingRule>
48 ///////////////////////////////////////////////////////////////////////////////
49 #line 11 "grsgen.pcc"
52 ///////////////////////////////////////////////////////////////////////////////
54 // Interface specification of datatype List<GRSPat>
56 ///////////////////////////////////////////////////////////////////////////////
57 #line 11 "grsgen.pcc"
60 ///////////////////////////////////////////////////////////////////////////////
62 // Interface specification of datatype List<GRSConclusion>
64 ///////////////////////////////////////////////////////////////////////////////
65 #line 11 "grsgen.pcc"
68 ///////////////////////////////////////////////////////////////////////////////
70 // Instantiation of datatype GraphRewritingRule
72 ///////////////////////////////////////////////////////////////////////////////
73 #line 11 "grsgen.pcc"
74 a_GraphRewritingRule::a_GraphRewritingRule (GRSPat x_lhs, GRSConclusions x_rhs)
75 : lhs(x_lhs), rhs(x_rhs)
78 a_GraphRewritingRule * GRSrule (GRSPat x_lhs, GRSConclusions x_rhs)
80 return new a_GraphRewritingRule (x_lhs, x_rhs);
84 ///////////////////////////////////////////////////////////////////////////////
86 // Instantiation of datatype GRSPat
88 ///////////////////////////////////////////////////////////////////////////////
89 #line 11 "grsgen.pcc"
90 GRSPat_EDGEgpat::GRSPat_EDGEgpat (Id x_1, a_List<Pat> * x_2)
91 : a_GRSPat(tag_EDGEgpat), _1(x_1), _2(x_2)
94 a_GRSPat * EDGEgpat (Id x_1, a_List<Pat> * x_2)
96 return new GRSPat_EDGEgpat (x_1, x_2);
98 GRSPat_GUARDgpat::GRSPat_GUARDgpat (Exp x_GUARDgpat)
99 : a_GRSPat(tag_GUARDgpat), GUARDgpat(x_GUARDgpat)
102 a_GRSPat * GUARDgpat (Exp x_GUARDgpat)
104 return new GRSPat_GUARDgpat (x_GUARDgpat);
106 GRSPat_NOTgpat::GRSPat_NOTgpat (GRSPat x_NOTgpat)
107 : a_GRSPat(tag_NOTgpat), NOTgpat(x_NOTgpat)
110 a_GRSPat * NOTgpat (GRSPat x_NOTgpat)
112 return new GRSPat_NOTgpat (x_NOTgpat);
114 GRSPat_ANDgpat::GRSPat_ANDgpat (GRSPat x_1, GRSPat x_2)
115 : a_GRSPat(tag_ANDgpat), _1(x_1), _2(x_2)
118 a_GRSPat * ANDgpat (GRSPat x_1, GRSPat x_2)
120 return new GRSPat_ANDgpat (x_1, x_2);
122 GRSPat_ORgpat::GRSPat_ORgpat (GRSPat x_1, GRSPat x_2)
123 : a_GRSPat(tag_ORgpat), _1(x_1), _2(x_2)
126 a_GRSPat * ORgpat (GRSPat x_1, GRSPat x_2)
128 return new GRSPat_ORgpat (x_1, x_2);
130 GRSPat_FORALLgpat::GRSPat_FORALLgpat (Id x_1, GRSPat x_2)
131 : a_GRSPat(tag_FORALLgpat), _1(x_1), _2(x_2)
134 a_GRSPat * FORALLgpat (Id x_1, GRSPat x_2)
136 return new GRSPat_FORALLgpat (x_1, x_2);
140 ///////////////////////////////////////////////////////////////////////////////
142 // Instantiation of datatype GRSConclusion
144 ///////////////////////////////////////////////////////////////////////////////
145 #line 11 "grsgen.pcc"
146 GRSConclusion_ADDEDGEaction::GRSConclusion_ADDEDGEaction (Id x_1, a_List<Exp> * x_2)
147 : a_GRSConclusion(tag_ADDEDGEaction), _1(x_1), _2(x_2)
150 a_GRSConclusion * ADDEDGEaction (Id x_1, a_List<Exp> * x_2)
152 return new GRSConclusion_ADDEDGEaction (x_1, x_2);
154 GRSConclusion_DELETEEDGEaction::GRSConclusion_DELETEEDGEaction (Id x_1, a_List<Exp> * x_2)
155 : a_GRSConclusion(tag_DELETEEDGEaction), _1(x_1), _2(x_2)
158 a_GRSConclusion * DELETEEDGEaction (Id x_1, a_List<Exp> * x_2)
160 return new GRSConclusion_DELETEEDGEaction (x_1, x_2);
162 GRSConclusion_ADDNODEaction::GRSConclusion_ADDNODEaction (Exp x_ADDNODEaction)
163 : a_GRSConclusion(tag_ADDNODEaction), ADDNODEaction(x_ADDNODEaction)
166 a_GRSConclusion * ADDNODEaction (Exp x_ADDNODEaction)
168 return new GRSConclusion_ADDNODEaction (x_ADDNODEaction);
170 GRSConclusion_DELETENODEaction::GRSConclusion_DELETENODEaction (Exp x_DELETENODEaction)
171 : a_GRSConclusion(tag_DELETENODEaction), DELETENODEaction(x_DELETENODEaction)
174 a_GRSConclusion * DELETENODEaction (Exp x_DELETENODEaction)
176 return new GRSConclusion_DELETENODEaction (x_DELETENODEaction);
178 GRSConclusion_EMBEDDEDaction::GRSConclusion_EMBEDDEDaction (a_List<Decl> * x_EMBEDDEDaction)
179 : a_GRSConclusion(tag_EMBEDDEDaction), EMBEDDEDaction(x_EMBEDDEDaction)
182 a_GRSConclusion * EMBEDDEDaction (a_List<Decl> * x_EMBEDDEDaction)
184 return new GRSConclusion_EMBEDDEDaction (x_EMBEDDEDaction);
188 ///////////////////////////////////////////////////////////////////////////////
190 // Instantiation of datatype List<GraphRewritingRule>
192 ///////////////////////////////////////////////////////////////////////////////
193 #line 11 "grsgen.pcc"
194 #ifdef PROP_EXPLICIT_TEMPLATE_INSTANTIATION
195 template class a_List<GraphRewritingRule>;
196 template a_List<GraphRewritingRule> * list_1_(GRSConclusion x_1, a_List<GRSConclusion> * x_2);
197 template a_List<GraphRewritingRule> * list_1_(GRSConclusion x_list_1_);
198 template int boxed(const a_List<GraphRewritingRule> *);
199 template int untag(const a_List<GraphRewritingRule> *);
200 #endif /* PROP_EXPLICIT_TEMPLATE_INSTANTIATION */
202 ///////////////////////////////////////////////////////////////////////////////
204 // Instantiation of datatype List<GRSPat>
206 ///////////////////////////////////////////////////////////////////////////////
207 #line 11 "grsgen.pcc"
208 #ifdef PROP_EXPLICIT_TEMPLATE_INSTANTIATION
209 template class a_List<GRSPat>;
210 template a_List<GRSPat> * list_1_(GraphRewritingRule x_1, a_List<GraphRewritingRule> * x_2);
211 template a_List<GRSPat> * list_1_(GraphRewritingRule x_list_1_);
212 template int boxed(const a_List<GRSPat> *);
213 template int untag(const a_List<GRSPat> *);
214 #endif /* PROP_EXPLICIT_TEMPLATE_INSTANTIATION */
216 ///////////////////////////////////////////////////////////////////////////////
218 // Instantiation of datatype List<GRSConclusion>
220 ///////////////////////////////////////////////////////////////////////////////
221 #line 11 "grsgen.pcc"
222 #ifdef PROP_EXPLICIT_TEMPLATE_INSTANTIATION
223 template class a_List<GRSConclusion>;
224 template a_List<GRSConclusion> * list_1_(GRSPat x_1, a_List<GRSPat> * x_2);
225 template a_List<GRSConclusion> * list_1_(GRSPat x_list_1_);
226 template int boxed(const a_List<GRSConclusion> *);
227 template int untag(const a_List<GRSConclusion> *);
228 #endif /* PROP_EXPLICIT_TEMPLATE_INSTANTIATION */
230 #line 14 "grsgen.pcc"
231 #line 14 "grsgen.pcc"
234 ///////////////////////////////////////////////////////////////////////////////
236 // Constructor and destructor for the graph rewriting compiler
238 ///////////////////////////////////////////////////////////////////////////////
239 GraphRewritingCompiler::GraphRewritingCompiler() {}
240 GraphRewritingCompiler::~GraphRewritingCompiler() {}
242 ///////////////////////////////////////////////////////////////////////////////
244 // Method to generate a GRS.
246 ///////////////////////////////////////////////////////////////////////////////
247 void GraphRewritingCompiler::gen_graph_rewriting_system
248 ( Id name, LabTys args, GraphRewritingRules rules)
251 #line 33 "grsgen.pcc"
253 ------------------------------- Statistics -------------------------------
254 Merge matching rules = yes
255 Number of DFA nodes merged = 0
256 Number of ifs generated = 0
257 Number of switches generated = 0
258 Number of labels = 0
259 Number of gotos = 0
260 Adaptive matching = enabled
261 Fast string matching = disabled
262 Inline downcasts = enabled
263 --------------------------------------------------------------------------