gcc config
[prop.git] / prop-src / ast.cc
blob85fe28712c04a08ae6b7029baa99996012ac0c3d
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 "ast.pcc".
5 ///////////////////////////////////////////////////////////////////////////////
7 #line 1 "ast.pcc"
8 ///////////////////////////////////////////////////////////////////////////////
9 //
10 // This file implements some basic AST manipulation routines
12 ///////////////////////////////////////////////////////////////////////////////
13 #include <stdlib.h>
14 #include "basics.h"
15 #include "ast.h"
17 ///////////////////////////////////////////////////////////////////////////////
19 // Select the ith component from an expression list
21 ///////////////////////////////////////////////////////////////////////////////
22 Exp component_exp(Exps exps, int n)
23 { Exps es = exps;
24 int i = n;
26 #line 18 "ast.pcc"
27 #line 20 "ast.pcc"
29 for (;;) {
30 if (es) {
31 if (
32 #line 19 "ast.pcc"
33 (i == 1)
34 #line 19 "ast.pcc"
35 ) {
37 #line 19 "ast.pcc"
38 return es->_1;
39 #line 19 "ast.pcc"
40 } else {
42 #line 20 "ast.pcc"
43 es = es->_2; i--;
44 #line 20 "ast.pcc"
46 } else { goto L1; }
48 L1:;
50 #line 21 "ast.pcc"
51 #line 21 "ast.pcc"
53 error("%Lexpression %e does not have component %i\n",
54 TUPLEexp(exps), n);
55 return NOexp;
58 ///////////////////////////////////////////////////////////////////////////////
60 // Select the ith component from an expression list
62 ///////////////////////////////////////////////////////////////////////////////
63 Exp component_exp(Exps exps, Id n)
64 { return component_exp(exps,atol(n+1)); }
66 ///////////////////////////////////////////////////////////////////////////////
68 // Select the ith component from a labeled expression list
70 ///////////////////////////////////////////////////////////////////////////////
71 Exp component_exp(LabExps labeled_exps, Id n)
72 { LabExps les = labeled_exps;
74 #line 42 "ast.pcc"
75 #line 44 "ast.pcc"
77 for (;;) {
78 if (les) {
79 if (
80 #line 43 "ast.pcc"
81 (les->_1.label == n)
82 #line 43 "ast.pcc"
83 ) {
85 #line 43 "ast.pcc"
86 return les->_1.exp;
87 #line 43 "ast.pcc"
88 } else {
90 #line 44 "ast.pcc"
91 les = les->_2;
92 #line 44 "ast.pcc"
94 } else { goto L2; }
96 L2:;
98 #line 45 "ast.pcc"
99 #line 45 "ast.pcc"
101 error("%Lexpression %e does not have component %s\n",
102 RECORDexp(labeled_exps), n);
103 return NOexp;
105 #line 50 "ast.pcc"
107 ------------------------------- Statistics -------------------------------
108 Merge matching rules = yes
109 Number of DFA nodes merged = 2
110 Number of ifs generated = 4
111 Number of switches generated = 0
112 Number of labels = 0
113 Number of gotos = 0
114 Adaptive matching = enabled
115 Fast string matching = disabled
116 Inline downcasts = enabled
117 --------------------------------------------------------------------------