blob: 3b2c4ee900713520e7c77dee7d1bb5a8a9a2b572 [file] [log] [blame]
Reid Spencer68a24bd2005-08-27 18:50:39 +00001
Chris Lattner8d354e92005-09-30 04:11:27 +00002/* A Bison parser, made from /Users/sabre/llvm/utils/TableGen/FileParser.y
3 by GNU Bison version 1.28 */
Reid Spencer68a24bd2005-08-27 18:50:39 +00004
Chris Lattner8d354e92005-09-30 04:11:27 +00005#define YYBISON 1 /* Identify Bison output. */
Reid Spencer68a24bd2005-08-27 18:50:39 +00006
Reid Spencer68a24bd2005-08-27 18:50:39 +00007#define yyparse Fileparse
Chris Lattner8d354e92005-09-30 04:11:27 +00008#define yylex Filelex
Reid Spencer68a24bd2005-08-27 18:50:39 +00009#define yyerror Fileerror
Chris Lattner8d354e92005-09-30 04:11:27 +000010#define yylval Filelval
11#define yychar Filechar
Reid Spencer68a24bd2005-08-27 18:50:39 +000012#define yydebug Filedebug
13#define yynerrs Filenerrs
Chris Lattner8d354e92005-09-30 04:11:27 +000014#define INT 257
15#define BIT 258
16#define STRING 259
17#define BITS 260
18#define LIST 261
19#define CODE 262
20#define DAG 263
21#define CLASS 264
22#define DEF 265
23#define FIELD 266
24#define LET 267
25#define IN 268
26#define SHLTOK 269
27#define SRATOK 270
28#define SRLTOK 271
29#define INTVAL 272
30#define ID 273
31#define VARNAME 274
32#define STRVAL 275
33#define CODEFRAGMENT 276
Reid Spencer68a24bd2005-08-27 18:50:39 +000034
Chris Lattner8d354e92005-09-30 04:11:27 +000035#line 14 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
Reid Spencer68a24bd2005-08-27 18:50:39 +000036
37#include "Record.h"
38#include "llvm/ADT/StringExtras.h"
39#include <algorithm>
40#include <cstdio>
41#define YYERROR_VERBOSE 1
42
43int yyerror(const char *ErrorMsg);
44int yylex();
45
46namespace llvm {
47
48extern int Filelineno;
49static Record *CurRec = 0;
50static bool ParsingTemplateArgs = false;
51
52typedef std::pair<Record*, std::vector<Init*>*> SubClassRefTy;
53
54struct LetRecord {
55 std::string Name;
56 std::vector<unsigned> Bits;
57 Init *Value;
58 bool HasBits;
59 LetRecord(const std::string &N, std::vector<unsigned> *B, Init *V)
60 : Name(N), Value(V), HasBits(B != 0) {
61 if (HasBits) Bits = *B;
62 }
63};
64
65static std::vector<std::vector<LetRecord> > LetStack;
66
67
68extern std::ostream &err();
69
70static void addValue(const RecordVal &RV) {
71 if (RecordVal *ERV = CurRec->getValue(RV.getName())) {
72 // The value already exists in the class, treat this as a set...
73 if (ERV->setValue(RV.getValue())) {
74 err() << "New definition of '" << RV.getName() << "' of type '"
75 << *RV.getType() << "' is incompatible with previous "
76 << "definition of type '" << *ERV->getType() << "'!\n";
77 exit(1);
78 }
79 } else {
80 CurRec->addValue(RV);
81 }
82}
83
84static void addSuperClass(Record *SC) {
85 if (CurRec->isSubClassOf(SC)) {
86 err() << "Already subclass of '" << SC->getName() << "'!\n";
87 exit(1);
88 }
89 CurRec->addSuperClass(SC);
90}
91
92static void setValue(const std::string &ValName,
93 std::vector<unsigned> *BitList, Init *V) {
94 if (!V) return;
95
96 RecordVal *RV = CurRec->getValue(ValName);
97 if (RV == 0) {
98 err() << "Value '" << ValName << "' unknown!\n";
99 exit(1);
100 }
101
102 // Do not allow assignments like 'X = X'. This will just cause infinite loops
103 // in the resolution machinery.
104 if (!BitList)
105 if (VarInit *VI = dynamic_cast<VarInit*>(V))
106 if (VI->getName() == ValName)
107 return;
108
109 // If we are assigning to a subset of the bits in the value... then we must be
110 // assigning to a field of BitsRecTy, which must have a BitsInit
111 // initializer...
112 //
113 if (BitList) {
114 BitsInit *CurVal = dynamic_cast<BitsInit*>(RV->getValue());
115 if (CurVal == 0) {
116 err() << "Value '" << ValName << "' is not a bits type!\n";
117 exit(1);
118 }
119
120 // Convert the incoming value to a bits type of the appropriate size...
121 Init *BI = V->convertInitializerTo(new BitsRecTy(BitList->size()));
122 if (BI == 0) {
123 V->convertInitializerTo(new BitsRecTy(BitList->size()));
124 err() << "Initializer '" << *V << "' not compatible with bit range!\n";
125 exit(1);
126 }
127
128 // We should have a BitsInit type now...
129 assert(dynamic_cast<BitsInit*>(BI) != 0 || &(std::cerr << *BI) == 0);
130 BitsInit *BInit = (BitsInit*)BI;
131
132 BitsInit *NewVal = new BitsInit(CurVal->getNumBits());
133
134 // Loop over bits, assigning values as appropriate...
135 for (unsigned i = 0, e = BitList->size(); i != e; ++i) {
136 unsigned Bit = (*BitList)[i];
137 if (NewVal->getBit(Bit)) {
138 err() << "Cannot set bit #" << Bit << " of value '" << ValName
139 << "' more than once!\n";
140 exit(1);
141 }
142 NewVal->setBit(Bit, BInit->getBit(i));
143 }
144
145 for (unsigned i = 0, e = CurVal->getNumBits(); i != e; ++i)
146 if (NewVal->getBit(i) == 0)
147 NewVal->setBit(i, CurVal->getBit(i));
148
149 V = NewVal;
150 }
151
152 if (RV->setValue(V)) {
153 err() << "Value '" << ValName << "' of type '" << *RV->getType()
154 << "' is incompatible with initializer '" << *V << "'!\n";
155 exit(1);
156 }
157}
158
159// addSubClass - Add SC as a subclass to CurRec, resolving TemplateArgs as SC's
160// template arguments.
161static void addSubClass(Record *SC, const std::vector<Init*> &TemplateArgs) {
162 // Add all of the values in the subclass into the current class...
163 const std::vector<RecordVal> &Vals = SC->getValues();
164 for (unsigned i = 0, e = Vals.size(); i != e; ++i)
165 addValue(Vals[i]);
166
167 const std::vector<std::string> &TArgs = SC->getTemplateArgs();
168
169 // Ensure that an appropriate number of template arguments are specified...
170 if (TArgs.size() < TemplateArgs.size()) {
171 err() << "ERROR: More template args specified than expected!\n";
172 exit(1);
173 } else { // This class expects template arguments...
174 // Loop over all of the template arguments, setting them to the specified
175 // value or leaving them as the default if necessary.
176 for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
177 if (i < TemplateArgs.size()) { // A value is specified for this temp-arg?
Chris Lattnerba4b1442005-09-08 18:22:57 +0000178 // Set it now.
179 setValue(TArgs[i], 0, TemplateArgs[i]);
Reid Spencer68a24bd2005-08-27 18:50:39 +0000180
181 // Resolve it next.
182 CurRec->resolveReferencesTo(CurRec->getValue(TArgs[i]));
183
184
185 // Now remove it.
186 CurRec->removeValue(TArgs[i]);
187
188 } else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
Chris Lattnerba4b1442005-09-08 18:22:57 +0000189 err() << "ERROR: Value not specified for template argument #"
190 << i << " (" << TArgs[i] << ") of subclass '" << SC->getName()
191 << "'!\n";
192 exit(1);
Reid Spencer68a24bd2005-08-27 18:50:39 +0000193 }
194 }
195 }
196
197 // Since everything went well, we can now set the "superclass" list for the
198 // current record.
199 const std::vector<Record*> &SCs = SC->getSuperClasses();
200 for (unsigned i = 0, e = SCs.size(); i != e; ++i)
201 addSuperClass(SCs[i]);
202 addSuperClass(SC);
203}
204
205} // End llvm namespace
206
207using namespace llvm;
208
209
Chris Lattner8d354e92005-09-30 04:11:27 +0000210#line 189 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
211typedef union {
Reid Spencer68a24bd2005-08-27 18:50:39 +0000212 std::string* StrVal;
213 int IntVal;
214 llvm::RecTy* Ty;
215 llvm::Init* Initializer;
216 std::vector<llvm::Init*>* FieldList;
217 std::vector<unsigned>* BitList;
218 llvm::Record* Rec;
219 SubClassRefTy* SubClassRef;
220 std::vector<SubClassRefTy>* SubClassList;
221 std::vector<std::pair<llvm::Init*, std::string> >* DagValueList;
222} YYSTYPE;
Chris Lattner8d354e92005-09-30 04:11:27 +0000223#include <stdio.h>
224
225#ifndef __cplusplus
226#ifndef __STDC__
227#define const
228#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000229#endif
230
231
232
Chris Lattner8d354e92005-09-30 04:11:27 +0000233#define YYFINAL 158
234#define YYFLAG -32768
235#define YYNTBASE 38
Reid Spencer68a24bd2005-08-27 18:50:39 +0000236
Chris Lattner8d354e92005-09-30 04:11:27 +0000237#define YYTRANSLATE(x) ((unsigned)(x) <= 276 ? yytranslate[x] : 76)
Reid Spencer68a24bd2005-08-27 18:50:39 +0000238
Chris Lattner8d354e92005-09-30 04:11:27 +0000239static const char yytranslate[] = { 0,
240 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
241 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
242 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
243 2, 2, 2, 2, 2, 2, 2, 2, 2, 32,
244 33, 2, 2, 34, 36, 31, 2, 2, 2, 2,
245 2, 2, 2, 2, 2, 2, 2, 35, 37, 23,
246 25, 24, 26, 2, 2, 2, 2, 2, 2, 2,
247 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
248 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
249 29, 2, 30, 2, 2, 2, 2, 2, 2, 2,
250 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
251 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
252 2, 2, 27, 2, 28, 2, 2, 2, 2, 2,
253 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
254 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
255 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
256 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
257 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
258 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
259 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
260 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
261 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
262 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
263 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
264 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
265 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
266 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
267 17, 18, 19, 20, 21, 22
268};
Reid Spencer68a24bd2005-08-27 18:50:39 +0000269
Chris Lattner8d354e92005-09-30 04:11:27 +0000270#if YYDEBUG != 0
271static const short yyprhs[] = { 0,
272 0, 2, 4, 6, 11, 13, 18, 20, 22, 24,
273 25, 27, 28, 31, 33, 35, 37, 39, 43, 48,
274 50, 55, 59, 63, 68, 73, 80, 87, 94, 95,
275 98, 101, 106, 107, 109, 111, 115, 118, 122, 128,
276 133, 135, 136, 140, 141, 143, 145, 149, 154, 157,
277 164, 165, 168, 170, 174, 176, 181, 183, 187, 188,
278 191, 193, 197, 201, 202, 204, 206, 207, 209, 211,
279 213, 214, 219, 223, 227, 229, 231, 236, 238, 242,
280 243, 248, 253, 256, 258, 261
281};
Reid Spencer68a24bd2005-08-27 18:50:39 +0000282
Chris Lattner8d354e92005-09-30 04:11:27 +0000283static const short yyrhs[] = { 19,
284 0, 5, 0, 4, 0, 6, 23, 18, 24, 0,
285 3, 0, 7, 23, 39, 24, 0, 8, 0, 9,
286 0, 38, 0, 0, 12, 0, 0, 25, 42, 0,
287 18, 0, 21, 0, 22, 0, 26, 0, 27, 49,
288 28, 0, 19, 23, 50, 24, 0, 19, 0, 42,
289 27, 47, 28, 0, 29, 49, 30, 0, 42, 31,
290 19, 0, 32, 19, 45, 33, 0, 42, 29, 47,
291 30, 0, 15, 32, 42, 34, 42, 33, 0, 16,
292 32, 42, 34, 42, 33, 0, 17, 32, 42, 34,
293 42, 33, 0, 0, 35, 20, 0, 42, 43, 0,
294 44, 34, 42, 43, 0, 0, 44, 0, 18, 0,
295 18, 36, 18, 0, 18, 18, 0, 46, 34, 18,
296 0, 46, 34, 18, 36, 18, 0, 46, 34, 18,
297 18, 0, 46, 0, 0, 27, 47, 28, 0, 0,
298 50, 0, 42, 0, 50, 34, 42, 0, 40, 39,
299 19, 41, 0, 51, 37, 0, 13, 19, 48, 25,
300 42, 37, 0, 0, 53, 52, 0, 37, 0, 27,
301 53, 28, 0, 38, 0, 38, 23, 50, 24, 0,
302 55, 0, 56, 34, 55, 0, 0, 35, 56, 0,
303 51, 0, 58, 34, 51, 0, 23, 58, 24, 0,
304 0, 59, 0, 19, 0, 0, 61, 0, 62, 0,
305 62, 0, 0, 60, 57, 66, 54, 0, 10, 63,
306 65, 0, 11, 64, 65, 0, 67, 0, 68, 0,
307 19, 48, 25, 42, 0, 70, 0, 71, 34, 70,
308 0, 0, 13, 73, 71, 14, 0, 72, 27, 74,
309 28, 0, 72, 69, 0, 69, 0, 74, 69, 0,
310 74, 0
311};
Reid Spencer68a24bd2005-08-27 18:50:39 +0000312
313#endif
314
Chris Lattner8d354e92005-09-30 04:11:27 +0000315#if YYDEBUG != 0
316static const short yyrline[] = { 0,
317 223, 234, 236, 238, 240, 242, 244, 246, 248, 252,
318 252, 254, 254, 256, 258, 261, 264, 266, 279, 307,
319 322, 329, 332, 339, 347, 355, 361, 367, 375, 378,
320 382, 387, 393, 396, 399, 402, 415, 429, 431, 444,
321 460, 462, 462, 466, 468, 472, 475, 479, 489, 491,
322 497, 497, 498, 498, 500, 502, 506, 511, 516, 519,
323 523, 526, 531, 532, 532, 534, 534, 536, 545, 553,
324 562, 577, 582, 586, 599, 599, 601, 606, 606, 609,
325 609, 612, 615, 619, 619, 621
326};
327#endif
328
329
330#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
331
332static const char * const yytname[] = { "$","error","$undefined.","INT","BIT",
333"STRING","BITS","LIST","CODE","DAG","CLASS","DEF","FIELD","LET","IN","SHLTOK",
334"SRATOK","SRLTOK","INTVAL","ID","VARNAME","STRVAL","CODEFRAGMENT","'<'","'>'",
335"'='","'?'","'{'","'}'","'['","']'","'.'","'('","')'","','","':'","'-'","';'",
336"ClassID","Type","OptPrefix","OptValue","Value","OptVarName","DagArgListNE",
337"DagArgList","RBitList","BitList","OptBitList","ValueList","ValueListNE","Declaration",
338"BodyItem","BodyList","Body","SubClassRef","ClassListNE","ClassList","DeclListNE",
339"TemplateArgList","OptTemplateArgList","OptID","ObjectName","ClassName","DefName",
340"ObjectBody","@1","ClassInst","DefInst","Object","LETItem","LETList","LETCommand",
341"@2","ObjectList","File", NULL
342};
343#endif
344
345static const short yyr1[] = { 0,
346 38, 39, 39, 39, 39, 39, 39, 39, 39, 40,
347 40, 41, 41, 42, 42, 42, 42, 42, 42, 42,
348 42, 42, 42, 42, 42, 42, 42, 42, 43, 43,
349 44, 44, 45, 45, 46, 46, 46, 46, 46, 46,
350 47, 48, 48, 49, 49, 50, 50, 51, 52, 52,
351 53, 53, 54, 54, 55, 55, 56, 56, 57, 57,
352 58, 58, 59, 60, 60, 61, 61, 62, 63, 64,
353 66, 65, 67, 68, 69, 69, 70, 71, 71, 73,
354 72, 69, 69, 74, 74, 75
355};
356
357static const short yyr2[] = { 0,
358 1, 1, 1, 4, 1, 4, 1, 1, 1, 0,
359 1, 0, 2, 1, 1, 1, 1, 3, 4, 1,
360 4, 3, 3, 4, 4, 6, 6, 6, 0, 2,
361 2, 4, 0, 1, 1, 3, 2, 3, 5, 4,
362 1, 0, 3, 0, 1, 1, 3, 4, 2, 6,
363 0, 2, 1, 3, 1, 4, 1, 3, 0, 2,
364 1, 3, 3, 0, 1, 1, 0, 1, 1, 1,
365 0, 4, 3, 3, 1, 1, 4, 1, 3, 0,
366 4, 4, 2, 1, 2, 1
367};
368
369static const short yydefact[] = { 0,
370 67, 67, 80, 75, 76, 84, 0, 86, 66, 68,
371 69, 64, 70, 64, 0, 0, 83, 85, 10, 65,
372 59, 73, 74, 42, 78, 0, 0, 11, 0, 61,
373 0, 0, 71, 0, 0, 81, 0, 82, 5, 3,
374 2, 0, 0, 7, 8, 1, 9, 0, 63, 10,
375 55, 57, 60, 0, 35, 41, 0, 0, 79, 0,
376 0, 12, 62, 0, 0, 51, 53, 72, 37, 0,
377 0, 43, 0, 0, 0, 14, 20, 15, 16, 17,
378 44, 44, 0, 77, 0, 0, 0, 48, 46, 0,
379 58, 10, 36, 38, 0, 0, 0, 0, 0, 45,
380 0, 33, 0, 0, 0, 4, 6, 13, 56, 0,
381 0, 54, 0, 52, 40, 0, 0, 0, 0, 0,
382 18, 22, 29, 34, 0, 0, 0, 23, 47, 42,
383 49, 39, 0, 0, 0, 19, 0, 31, 0, 24,
384 21, 25, 0, 0, 0, 0, 30, 29, 0, 26,
385 27, 28, 32, 0, 50, 0, 0, 0
386};
387
388static const short yydefgoto[] = { 47,
389 48, 29, 88, 89, 138, 124, 125, 56, 57, 35,
390 99, 100, 30, 114, 92, 68, 52, 53, 33, 31,
391 20, 21, 10, 11, 12, 14, 22, 54, 4, 5,
392 6, 25, 26, 7, 15, 8, 156
393};
394
395static const short yypact[] = { 52,
396 15, 15,-32768,-32768,-32768,-32768, 3, 52,-32768,-32768,
397-32768, 4,-32768, 4, 22, 52,-32768,-32768, 34,-32768,
398 -20,-32768,-32768, 28,-32768, -9, -2,-32768, 63,-32768,
399 -3, 37,-32768, 39, 35,-32768, 22,-32768,-32768,-32768,
400-32768, 50, 51,-32768,-32768,-32768,-32768, 59,-32768, 34,
401 66,-32768, 45, -15, -12, 46, 62, 32,-32768, 102,
402 63, 75,-32768, 32, 37,-32768,-32768,-32768,-32768, 104,
403 106,-32768, 93, 94, 95,-32768, 105,-32768,-32768,-32768,
404 32, 32, 110, 77, 107, 108, 32,-32768, 77, 8,
405-32768, 5,-32768, -8, 32, 32, 32, 32, 109, 96,
406 103, 32, 39, 39, 115,-32768,-32768, 77,-32768, 32,
407 116,-32768, 99,-32768,-32768, 120, 67, 68, 76, 11,
408-32768,-32768, 57, 111, 113, 112, 114,-32768, 77, 28,
409-32768,-32768, 32, 32, 32,-32768, 119,-32768, 32,-32768,
410-32768,-32768, 117, 82, 85, 90,-32768, 57, 32,-32768,
411-32768,-32768,-32768, 56,-32768, 141, 143,-32768
412};
413
414static const short yypgoto[] = { -25,
415 86,-32768,-32768, -58, 0,-32768,-32768,-32768, -84, 19,
416 69, -62, -49,-32768,-32768,-32768, 87,-32768,-32768,-32768,
417-32768,-32768,-32768, 148,-32768,-32768, 139,-32768,-32768,-32768,
418 -4, 118,-32768,-32768,-32768, 138,-32768
419};
420
421
422#define YYLAST 155
423
424
425static const short yytable[] = { 84,
426 63, 90, 17, 18, 36, 69, 51, 1, 2, 115,
427 3, 66, 1, 2, 32, 3, 28, 111, 126, 127,
428 49, 67, 18, 70, 37, 38, 19, 116, 108, 16,
429 50, 109, 112, 9, 136, 120, 117, 118, 119, 51,
430 24, 110, 113, 123, 110, 28, 73, 74, 75, 76,
431 77, 129, 78, 79, 34, 46, 55, 80, 81, 58,
432 82, 1, 2, 83, 3, 39, 40, 41, 42, 43,
433 44, 45, 60, 61, 144, 145, 146, 62, 65, 71,
434 148, 46, 103, 103, 104, 104, 105, 105, 64, 72,
435 154, 137, 155, 103, 103, 104, 104, 105, 105, 87,
436 133, 134, 103, 103, 104, 104, 105, 105, 103, 135,
437 104, 103, 105, 104, 150, 105, 103, 151, 104, 85,
438 105, 93, 152, 94, 95, 96, 97, 98, 102, 110,
439 106, 107, 122, 128, 130, 131, 121, 132, 147, 141,
440 157, 149, 158, 142, 139, 140, 86, 153, 143, 13,
441 101, 91, 23, 27, 59
442};
443
444static const short yycheck[] = { 58,
445 50, 64, 7, 8, 14, 18, 32, 10, 11, 18,
446 13, 27, 10, 11, 35, 13, 12, 13, 103, 104,
447 24, 37, 27, 36, 34, 28, 23, 36, 87, 27,
448 34, 24, 28, 19, 24, 98, 95, 96, 97, 65,
449 19, 34, 92, 102, 34, 12, 15, 16, 17, 18,
450 19, 110, 21, 22, 27, 19, 18, 26, 27, 25,
451 29, 10, 11, 32, 13, 3, 4, 5, 6, 7,
452 8, 9, 23, 23, 133, 134, 135, 19, 34, 34,
453 139, 19, 27, 27, 29, 29, 31, 31, 23, 28,
454 149, 35, 37, 27, 27, 29, 29, 31, 31, 25,
455 34, 34, 27, 27, 29, 29, 31, 31, 27, 34,
456 29, 27, 31, 29, 33, 31, 27, 33, 29, 18,
457 31, 18, 33, 18, 32, 32, 32, 23, 19, 34,
458 24, 24, 30, 19, 19, 37, 28, 18, 20, 28,
459 0, 25, 0, 30, 34, 33, 61, 148, 130, 2,
460 82, 65, 14, 16, 37
461};
462/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
463#line 3 "/usr/share/bison.simple"
464/* This file comes from bison-1.28. */
465
466/* Skeleton output parser for bison,
467 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
468
469 This program is free software; you can redistribute it and/or modify
470 it under the terms of the GNU General Public License as published by
471 the Free Software Foundation; either version 2, or (at your option)
472 any later version.
473
474 This program is distributed in the hope that it will be useful,
475 but WITHOUT ANY WARRANTY; without even the implied warranty of
476 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
477 GNU General Public License for more details.
478
479 You should have received a copy of the GNU General Public License
480 along with this program; if not, write to the Free Software
481 Foundation, Inc., 59 Temple Place - Suite 330,
482 Boston, MA 02111-1307, USA. */
483
484/* As a special exception, when this file is copied by Bison into a
485 Bison output file, you may use that output file without restriction.
486 This special exception was added by the Free Software Foundation
487 in version 1.24 of Bison. */
488
489/* This is the parser code that is written into each bison parser
490 when the %semantic_parser declaration is not specified in the grammar.
491 It was written by Richard Stallman by simplifying the hairy parser
492 used when %semantic_parser is specified. */
493
494#ifndef YYSTACK_USE_ALLOCA
495#ifdef alloca
496#define YYSTACK_USE_ALLOCA
497#else /* alloca not defined */
498#ifdef __GNUC__
499#define YYSTACK_USE_ALLOCA
500#define alloca __builtin_alloca
501#else /* not GNU C. */
502#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
503#define YYSTACK_USE_ALLOCA
504#include <alloca.h>
505#else /* not sparc */
506/* We think this test detects Watcom and Microsoft C. */
507/* This used to test MSDOS, but that is a bad idea
508 since that symbol is in the user namespace. */
509#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
510#if 0 /* No need for malloc.h, which pollutes the namespace;
511 instead, just don't use alloca. */
512#include <malloc.h>
513#endif
514#else /* not MSDOS, or __TURBOC__ */
515#if defined(_AIX)
516/* I don't know what this was needed for, but it pollutes the namespace.
517 So I turned it off. rms, 2 May 1997. */
518/* #include <malloc.h> */
519 #pragma alloca
520#define YYSTACK_USE_ALLOCA
521#else /* not MSDOS, or __TURBOC__, or _AIX */
522#if 0
523#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
524 and on HPUX 10. Eventually we can turn this on. */
525#define YYSTACK_USE_ALLOCA
526#define alloca __builtin_alloca
527#endif /* __hpux */
528#endif
529#endif /* not _AIX */
530#endif /* not MSDOS, or __TURBOC__ */
531#endif /* not sparc */
532#endif /* not GNU C */
533#endif /* alloca not defined */
534#endif /* YYSTACK_USE_ALLOCA not defined */
535
536#ifdef YYSTACK_USE_ALLOCA
537#define YYSTACK_ALLOC alloca
Reid Spencer68a24bd2005-08-27 18:50:39 +0000538#else
Chris Lattner8d354e92005-09-30 04:11:27 +0000539#define YYSTACK_ALLOC malloc
Reid Spencer68a24bd2005-08-27 18:50:39 +0000540#endif
541
Chris Lattner8d354e92005-09-30 04:11:27 +0000542/* Note: there must be only one dollar sign in this file.
543 It is replaced by the list of actions, each action
544 as one case of the switch. */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000545
546#define yyerrok (yyerrstatus = 0)
547#define yyclearin (yychar = YYEMPTY)
Chris Lattner8d354e92005-09-30 04:11:27 +0000548#define YYEMPTY -2
Reid Spencer68a24bd2005-08-27 18:50:39 +0000549#define YYEOF 0
Reid Spencer68a24bd2005-08-27 18:50:39 +0000550#define YYACCEPT goto yyacceptlab
Chris Lattner8d354e92005-09-30 04:11:27 +0000551#define YYABORT goto yyabortlab
Chris Lattnerba4b1442005-09-08 18:22:57 +0000552#define YYERROR goto yyerrlab1
Chris Lattner8d354e92005-09-30 04:11:27 +0000553/* Like YYERROR except do call yyerror.
554 This remains here temporarily to ease the
555 transition to the new meaning of YYERROR, for GCC.
Reid Spencer68a24bd2005-08-27 18:50:39 +0000556 Once GCC version 2 has supplanted version 1, this can go. */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000557#define YYFAIL goto yyerrlab
Reid Spencer68a24bd2005-08-27 18:50:39 +0000558#define YYRECOVERING() (!!yyerrstatus)
Chris Lattner8d354e92005-09-30 04:11:27 +0000559#define YYBACKUP(token, value) \
Reid Spencer68a24bd2005-08-27 18:50:39 +0000560do \
561 if (yychar == YYEMPTY && yylen == 1) \
Chris Lattner8d354e92005-09-30 04:11:27 +0000562 { yychar = (token), yylval = (value); \
563 yychar1 = YYTRANSLATE (yychar); \
Reid Spencer68a24bd2005-08-27 18:50:39 +0000564 YYPOPSTACK; \
565 goto yybackup; \
566 } \
567 else \
Chris Lattner8d354e92005-09-30 04:11:27 +0000568 { yyerror ("syntax error: cannot back up"); YYERROR; } \
Reid Spencer68a24bd2005-08-27 18:50:39 +0000569while (0)
570
571#define YYTERROR 1
572#define YYERRCODE 256
573
Chris Lattner8d354e92005-09-30 04:11:27 +0000574#ifndef YYPURE
575#define YYLEX yylex()
Reid Spencer68a24bd2005-08-27 18:50:39 +0000576#endif
577
Chris Lattner8d354e92005-09-30 04:11:27 +0000578#ifdef YYPURE
579#ifdef YYLSP_NEEDED
Reid Spencer68a24bd2005-08-27 18:50:39 +0000580#ifdef YYLEX_PARAM
Chris Lattner8d354e92005-09-30 04:11:27 +0000581#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
Reid Spencer68a24bd2005-08-27 18:50:39 +0000582#else
Chris Lattner8d354e92005-09-30 04:11:27 +0000583#define YYLEX yylex(&yylval, &yylloc)
584#endif
585#else /* not YYLSP_NEEDED */
586#ifdef YYLEX_PARAM
587#define YYLEX yylex(&yylval, YYLEX_PARAM)
588#else
589#define YYLEX yylex(&yylval)
590#endif
591#endif /* not YYLSP_NEEDED */
Chris Lattnerba4b1442005-09-08 18:22:57 +0000592#endif
Chris Lattner2b931e82005-09-12 05:30:06 +0000593
Chris Lattner8d354e92005-09-30 04:11:27 +0000594/* If nonreentrant, generate the variables here */
Chris Lattner2b931e82005-09-12 05:30:06 +0000595
Chris Lattner8d354e92005-09-30 04:11:27 +0000596#ifndef YYPURE
Chris Lattner2b931e82005-09-12 05:30:06 +0000597
Chris Lattner8d354e92005-09-30 04:11:27 +0000598int yychar; /* the lookahead symbol */
599YYSTYPE yylval; /* the semantic value of the */
600 /* lookahead symbol */
Chris Lattner2b931e82005-09-12 05:30:06 +0000601
Chris Lattner8d354e92005-09-30 04:11:27 +0000602#ifdef YYLSP_NEEDED
603YYLTYPE yylloc; /* location data for the lookahead */
604 /* symbol */
Chris Lattnerba4b1442005-09-08 18:22:57 +0000605#endif
Chris Lattner2b931e82005-09-12 05:30:06 +0000606
Chris Lattner8d354e92005-09-30 04:11:27 +0000607int yynerrs; /* number of parse errors so far */
608#endif /* not YYPURE */
Chris Lattner2b931e82005-09-12 05:30:06 +0000609
Chris Lattner8d354e92005-09-30 04:11:27 +0000610#if YYDEBUG != 0
611int yydebug; /* nonzero means print parse trace */
612/* Since this is uninitialized, it does not stop multiple parsers
613 from coexisting. */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000614#endif
615
Chris Lattner8d354e92005-09-30 04:11:27 +0000616/* YYINITDEPTH indicates the initial size of the parser's stacks */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000617
Reid Spencer68a24bd2005-08-27 18:50:39 +0000618#ifndef YYINITDEPTH
Chris Lattner8d354e92005-09-30 04:11:27 +0000619#define YYINITDEPTH 200
Reid Spencer68a24bd2005-08-27 18:50:39 +0000620#endif
621
Chris Lattner8d354e92005-09-30 04:11:27 +0000622/* YYMAXDEPTH is the maximum size the stacks can grow to
623 (effective only if the built-in stack extension method is used). */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000624
Chris Lattnerba4b1442005-09-08 18:22:57 +0000625#if YYMAXDEPTH == 0
Chris Lattner8d354e92005-09-30 04:11:27 +0000626#undef YYMAXDEPTH
Reid Spencer68a24bd2005-08-27 18:50:39 +0000627#endif
628
629#ifndef YYMAXDEPTH
Chris Lattner8d354e92005-09-30 04:11:27 +0000630#define YYMAXDEPTH 10000
Reid Spencer68a24bd2005-08-27 18:50:39 +0000631#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000632
Chris Lattner8d354e92005-09-30 04:11:27 +0000633/* Define __yy_memcpy. Note that the size argument
634 should be passed with type unsigned int, because that is what the non-GCC
635 definitions require. With GCC, __builtin_memcpy takes an arg
636 of type size_t, but it can handle unsigned int. */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000637
Chris Lattner8d354e92005-09-30 04:11:27 +0000638#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
639#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
640#else /* not GNU C or C++ */
641#ifndef __cplusplus
Reid Spencer68a24bd2005-08-27 18:50:39 +0000642
Chris Lattner8d354e92005-09-30 04:11:27 +0000643/* This is the most reliable way to avoid incompatibilities
644 in available built-in functions on various systems. */
Chris Lattner2b931e82005-09-12 05:30:06 +0000645static void
Chris Lattner8d354e92005-09-30 04:11:27 +0000646__yy_memcpy (to, from, count)
647 char *to;
648 char *from;
649 unsigned int count;
650{
651 register char *f = from;
652 register char *t = to;
653 register int i = count;
654
655 while (i-- > 0)
656 *t++ = *f++;
657}
658
659#else /* __cplusplus */
660
661/* This is the most reliable way to avoid incompatibilities
662 in available built-in functions on various systems. */
Chris Lattner2b931e82005-09-12 05:30:06 +0000663static void
Chris Lattner8d354e92005-09-30 04:11:27 +0000664__yy_memcpy (char *to, char *from, unsigned int count)
665{
666 register char *t = to;
667 register char *f = from;
668 register int i = count;
669
670 while (i-- > 0)
671 *t++ = *f++;
672}
673
Reid Spencer68a24bd2005-08-27 18:50:39 +0000674#endif
Chris Lattner2b931e82005-09-12 05:30:06 +0000675#endif
Chris Lattner2b931e82005-09-12 05:30:06 +0000676
Chris Lattner8d354e92005-09-30 04:11:27 +0000677#line 217 "/usr/share/bison.simple"
Chris Lattner2b931e82005-09-12 05:30:06 +0000678
Chris Lattner8d354e92005-09-30 04:11:27 +0000679/* The user can define YYPARSE_PARAM as the name of an argument to be passed
680 into yyparse. The argument should have type void *.
681 It should actually point to an object.
682 Grammar actions can access the variable by casting it
683 to the proper pointer type. */
Chris Lattner2b931e82005-09-12 05:30:06 +0000684
685#ifdef YYPARSE_PARAM
Chris Lattner8d354e92005-09-30 04:11:27 +0000686#ifdef __cplusplus
687#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
688#define YYPARSE_PARAM_DECL
689#else /* not __cplusplus */
690#define YYPARSE_PARAM_ARG YYPARSE_PARAM
691#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
692#endif /* not __cplusplus */
693#else /* not YYPARSE_PARAM */
694#define YYPARSE_PARAM_ARG
695#define YYPARSE_PARAM_DECL
696#endif /* not YYPARSE_PARAM */
697
698/* Prevent warning if -Wstrict-prototypes. */
699#ifdef __GNUC__
700#ifdef YYPARSE_PARAM
701int yyparse (void *);
702#else
Chris Lattner2b931e82005-09-12 05:30:06 +0000703int yyparse (void);
Chris Lattner2b931e82005-09-12 05:30:06 +0000704#endif
Chris Lattner8d354e92005-09-30 04:11:27 +0000705#endif
Chris Lattner2b931e82005-09-12 05:30:06 +0000706
Chris Lattner2b931e82005-09-12 05:30:06 +0000707int
Chris Lattner8d354e92005-09-30 04:11:27 +0000708yyparse(YYPARSE_PARAM_ARG)
709 YYPARSE_PARAM_DECL
Chris Lattner2b931e82005-09-12 05:30:06 +0000710{
Reid Spencer68a24bd2005-08-27 18:50:39 +0000711 register int yystate;
712 register int yyn;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000713 register short *yyssp;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000714 register YYSTYPE *yyvsp;
Chris Lattner8d354e92005-09-30 04:11:27 +0000715 int yyerrstatus; /* number of tokens to shift before error messages enabled */
716 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000717
Chris Lattner8d354e92005-09-30 04:11:27 +0000718 short yyssa[YYINITDEPTH]; /* the state stack */
719 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000720
Chris Lattner8d354e92005-09-30 04:11:27 +0000721 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
722 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000723
Chris Lattner8d354e92005-09-30 04:11:27 +0000724#ifdef YYLSP_NEEDED
725 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
726 YYLTYPE *yyls = yylsa;
727 YYLTYPE *yylsp;
728
729#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
730#else
Reid Spencer68a24bd2005-08-27 18:50:39 +0000731#define YYPOPSTACK (yyvsp--, yyssp--)
Chris Lattner8d354e92005-09-30 04:11:27 +0000732#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000733
Chris Lattner8d354e92005-09-30 04:11:27 +0000734 int yystacksize = YYINITDEPTH;
735 int yyfree_stacks = 0;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000736
Chris Lattner8d354e92005-09-30 04:11:27 +0000737#ifdef YYPURE
738 int yychar;
739 YYSTYPE yylval;
740 int yynerrs;
741#ifdef YYLSP_NEEDED
742 YYLTYPE yylloc;
743#endif
744#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000745
Chris Lattner8d354e92005-09-30 04:11:27 +0000746 YYSTYPE yyval; /* the variable used to return */
747 /* semantic values from the action */
748 /* routines */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000749
Reid Spencer68a24bd2005-08-27 18:50:39 +0000750 int yylen;
751
Chris Lattner8d354e92005-09-30 04:11:27 +0000752#if YYDEBUG != 0
753 if (yydebug)
754 fprintf(stderr, "Starting parse\n");
755#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000756
757 yystate = 0;
758 yyerrstatus = 0;
759 yynerrs = 0;
760 yychar = YYEMPTY; /* Cause a token to be read. */
761
762 /* Initialize stack pointers.
763 Waste one element of value and location stack
764 so that they stay on the same level as the state stack.
765 The wasted elements are never initialized. */
766
Chris Lattner8d354e92005-09-30 04:11:27 +0000767 yyssp = yyss - 1;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000768 yyvsp = yyvs;
Chris Lattner8d354e92005-09-30 04:11:27 +0000769#ifdef YYLSP_NEEDED
770 yylsp = yyls;
771#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000772
Chris Lattner8d354e92005-09-30 04:11:27 +0000773/* Push a new state, which is found in yystate . */
774/* In all cases, when you get here, the value and location stacks
775 have just been pushed. so pushing a state here evens the stacks. */
776yynewstate:
Reid Spencer68a24bd2005-08-27 18:50:39 +0000777
Chris Lattner8d354e92005-09-30 04:11:27 +0000778 *++yyssp = yystate;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000779
Chris Lattner8d354e92005-09-30 04:11:27 +0000780 if (yyssp >= yyss + yystacksize - 1)
Reid Spencer68a24bd2005-08-27 18:50:39 +0000781 {
Chris Lattner8d354e92005-09-30 04:11:27 +0000782 /* Give user a chance to reallocate the stack */
783 /* Use copies of these so that the &'s don't force the real ones into memory. */
784 YYSTYPE *yyvs1 = yyvs;
785 short *yyss1 = yyss;
786#ifdef YYLSP_NEEDED
787 YYLTYPE *yyls1 = yyls;
788#endif
789
Reid Spencer68a24bd2005-08-27 18:50:39 +0000790 /* Get the current used size of the three stacks, in elements. */
Chris Lattner8d354e92005-09-30 04:11:27 +0000791 int size = yyssp - yyss + 1;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000792
793#ifdef yyoverflow
Chris Lattner8d354e92005-09-30 04:11:27 +0000794 /* Each stack pointer address is followed by the size of
795 the data in use in that stack, in bytes. */
796#ifdef YYLSP_NEEDED
797 /* This used to be a conditional around just the two extra args,
798 but that might be undefined if yyoverflow is a macro. */
799 yyoverflow("parser stack overflow",
800 &yyss1, size * sizeof (*yyssp),
801 &yyvs1, size * sizeof (*yyvsp),
802 &yyls1, size * sizeof (*yylsp),
803 &yystacksize);
804#else
805 yyoverflow("parser stack overflow",
806 &yyss1, size * sizeof (*yyssp),
807 &yyvs1, size * sizeof (*yyvsp),
808 &yystacksize);
809#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000810
Chris Lattner8d354e92005-09-30 04:11:27 +0000811 yyss = yyss1; yyvs = yyvs1;
812#ifdef YYLSP_NEEDED
813 yyls = yyls1;
814#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000815#else /* no yyoverflow */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000816 /* Extend the stack our own way. */
Chris Lattner8d354e92005-09-30 04:11:27 +0000817 if (yystacksize >= YYMAXDEPTH)
818 {
819 yyerror("parser stack overflow");
820 if (yyfree_stacks)
821 {
822 free (yyss);
823 free (yyvs);
824#ifdef YYLSP_NEEDED
825 free (yyls);
826#endif
827 }
828 return 2;
829 }
Reid Spencer68a24bd2005-08-27 18:50:39 +0000830 yystacksize *= 2;
Chris Lattner8d354e92005-09-30 04:11:27 +0000831 if (yystacksize > YYMAXDEPTH)
Reid Spencer68a24bd2005-08-27 18:50:39 +0000832 yystacksize = YYMAXDEPTH;
Chris Lattner8d354e92005-09-30 04:11:27 +0000833#ifndef YYSTACK_USE_ALLOCA
834 yyfree_stacks = 1;
835#endif
836 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
837 __yy_memcpy ((char *)yyss, (char *)yyss1,
838 size * (unsigned int) sizeof (*yyssp));
839 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
840 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
841 size * (unsigned int) sizeof (*yyvsp));
842#ifdef YYLSP_NEEDED
843 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
844 __yy_memcpy ((char *)yyls, (char *)yyls1,
845 size * (unsigned int) sizeof (*yylsp));
846#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000847#endif /* no yyoverflow */
848
Chris Lattner8d354e92005-09-30 04:11:27 +0000849 yyssp = yyss + size - 1;
850 yyvsp = yyvs + size - 1;
851#ifdef YYLSP_NEEDED
852 yylsp = yyls + size - 1;
853#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000854
Chris Lattner8d354e92005-09-30 04:11:27 +0000855#if YYDEBUG != 0
856 if (yydebug)
857 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
858#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000859
Chris Lattner8d354e92005-09-30 04:11:27 +0000860 if (yyssp >= yyss + yystacksize - 1)
Reid Spencer68a24bd2005-08-27 18:50:39 +0000861 YYABORT;
862 }
863
Chris Lattner8d354e92005-09-30 04:11:27 +0000864#if YYDEBUG != 0
865 if (yydebug)
866 fprintf(stderr, "Entering state %d\n", yystate);
867#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000868
869 goto yybackup;
Chris Lattner8d354e92005-09-30 04:11:27 +0000870 yybackup:
Reid Spencer68a24bd2005-08-27 18:50:39 +0000871
872/* Do appropriate processing given the current state. */
873/* Read a lookahead token if we need one and don't already have one. */
874/* yyresume: */
875
876 /* First try to decide what to do without reference to lookahead token. */
877
878 yyn = yypact[yystate];
Chris Lattner8d354e92005-09-30 04:11:27 +0000879 if (yyn == YYFLAG)
Reid Spencer68a24bd2005-08-27 18:50:39 +0000880 goto yydefault;
881
882 /* Not known => get a lookahead token if don't already have one. */
883
Chris Lattner8d354e92005-09-30 04:11:27 +0000884 /* yychar is either YYEMPTY or YYEOF
885 or a valid token in external form. */
886
Reid Spencer68a24bd2005-08-27 18:50:39 +0000887 if (yychar == YYEMPTY)
888 {
Chris Lattner8d354e92005-09-30 04:11:27 +0000889#if YYDEBUG != 0
890 if (yydebug)
891 fprintf(stderr, "Reading a token: ");
892#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000893 yychar = YYLEX;
894 }
895
Chris Lattner8d354e92005-09-30 04:11:27 +0000896 /* Convert token to internal form (in yychar1) for indexing tables with */
897
898 if (yychar <= 0) /* This means end of input. */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000899 {
Chris Lattner8d354e92005-09-30 04:11:27 +0000900 yychar1 = 0;
901 yychar = YYEOF; /* Don't call YYLEX any more */
902
903#if YYDEBUG != 0
904 if (yydebug)
905 fprintf(stderr, "Now at end of input.\n");
906#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000907 }
908 else
909 {
Chris Lattner8d354e92005-09-30 04:11:27 +0000910 yychar1 = YYTRANSLATE(yychar);
911
912#if YYDEBUG != 0
913 if (yydebug)
914 {
915 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
916 /* Give the individual parser a way to print the precise meaning
917 of a token, for further debugging info. */
918#ifdef YYPRINT
919 YYPRINT (stderr, yychar, yylval);
920#endif
921 fprintf (stderr, ")\n");
922 }
923#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000924 }
925
Chris Lattner8d354e92005-09-30 04:11:27 +0000926 yyn += yychar1;
927 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
Reid Spencer68a24bd2005-08-27 18:50:39 +0000928 goto yydefault;
Chris Lattner8d354e92005-09-30 04:11:27 +0000929
Reid Spencer68a24bd2005-08-27 18:50:39 +0000930 yyn = yytable[yyn];
Chris Lattner8d354e92005-09-30 04:11:27 +0000931
932 /* yyn is what to do for this token type in this state.
933 Negative => reduce, -yyn is rule number.
934 Positive => shift, yyn is new state.
935 New state is final state => don't bother to shift,
936 just return success.
937 0, or most negative number => error. */
938
939 if (yyn < 0)
Reid Spencer68a24bd2005-08-27 18:50:39 +0000940 {
Chris Lattner8d354e92005-09-30 04:11:27 +0000941 if (yyn == YYFLAG)
Reid Spencer68a24bd2005-08-27 18:50:39 +0000942 goto yyerrlab;
943 yyn = -yyn;
944 goto yyreduce;
945 }
Chris Lattner8d354e92005-09-30 04:11:27 +0000946 else if (yyn == 0)
947 goto yyerrlab;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000948
949 if (yyn == YYFINAL)
950 YYACCEPT;
951
952 /* Shift the lookahead token. */
Chris Lattner8d354e92005-09-30 04:11:27 +0000953
954#if YYDEBUG != 0
955 if (yydebug)
956 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
957#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000958
959 /* Discard the token being shifted unless it is eof. */
960 if (yychar != YYEOF)
961 yychar = YYEMPTY;
962
963 *++yyvsp = yylval;
Chris Lattner8d354e92005-09-30 04:11:27 +0000964#ifdef YYLSP_NEEDED
965 *++yylsp = yylloc;
966#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000967
Chris Lattner8d354e92005-09-30 04:11:27 +0000968 /* count tokens shifted since error; after three, turn off error status. */
969 if (yyerrstatus) yyerrstatus--;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000970
971 yystate = yyn;
972 goto yynewstate;
973
Chris Lattner8d354e92005-09-30 04:11:27 +0000974/* Do the default action for the current state. */
Chris Lattner2b931e82005-09-12 05:30:06 +0000975yydefault:
Chris Lattner8d354e92005-09-30 04:11:27 +0000976
Reid Spencer68a24bd2005-08-27 18:50:39 +0000977 yyn = yydefact[yystate];
978 if (yyn == 0)
979 goto yyerrlab;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000980
Chris Lattner8d354e92005-09-30 04:11:27 +0000981/* Do a reduction. yyn is the number of a rule to reduce with. */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000982yyreduce:
Reid Spencer68a24bd2005-08-27 18:50:39 +0000983 yylen = yyr2[yyn];
Chris Lattner8d354e92005-09-30 04:11:27 +0000984 if (yylen > 0)
985 yyval = yyvsp[1-yylen]; /* implement default value of the action */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000986
Chris Lattner8d354e92005-09-30 04:11:27 +0000987#if YYDEBUG != 0
988 if (yydebug)
Reid Spencer68a24bd2005-08-27 18:50:39 +0000989 {
Chris Lattner8d354e92005-09-30 04:11:27 +0000990 int i;
991
992 fprintf (stderr, "Reducing via rule %d (line %d), ",
993 yyn, yyrline[yyn]);
994
995 /* Print the symbols being reduced, and their result. */
996 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
997 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
998 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
999 }
1000#endif
1001
1002
1003 switch (yyn) {
1004
1005case 1:
1006#line 223 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1007{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001008 yyval.Rec = Records.getClass(*yyvsp[0].StrVal);
1009 if (yyval.Rec == 0) {
1010 err() << "Couldn't find class '" << *yyvsp[0].StrVal << "'!\n";
1011 exit(1);
1012 }
1013 delete yyvsp[0].StrVal;
Chris Lattner8d354e92005-09-30 04:11:27 +00001014 ;
1015 break;}
1016case 2:
1017#line 234 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1018{ // string type
Reid Spencer68a24bd2005-08-27 18:50:39 +00001019 yyval.Ty = new StringRecTy();
Chris Lattner8d354e92005-09-30 04:11:27 +00001020 ;
1021 break;}
1022case 3:
1023#line 236 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1024{ // bit type
Reid Spencer68a24bd2005-08-27 18:50:39 +00001025 yyval.Ty = new BitRecTy();
Chris Lattner8d354e92005-09-30 04:11:27 +00001026 ;
1027 break;}
1028case 4:
1029#line 238 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1030{ // bits<x> type
Reid Spencer68a24bd2005-08-27 18:50:39 +00001031 yyval.Ty = new BitsRecTy(yyvsp[-1].IntVal);
Chris Lattner8d354e92005-09-30 04:11:27 +00001032 ;
1033 break;}
1034case 5:
1035#line 240 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1036{ // int type
Reid Spencer68a24bd2005-08-27 18:50:39 +00001037 yyval.Ty = new IntRecTy();
Chris Lattner8d354e92005-09-30 04:11:27 +00001038 ;
1039 break;}
1040case 6:
1041#line 242 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1042{ // list<x> type
Reid Spencer68a24bd2005-08-27 18:50:39 +00001043 yyval.Ty = new ListRecTy(yyvsp[-1].Ty);
Chris Lattner8d354e92005-09-30 04:11:27 +00001044 ;
1045 break;}
1046case 7:
1047#line 244 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1048{ // code type
Reid Spencer68a24bd2005-08-27 18:50:39 +00001049 yyval.Ty = new CodeRecTy();
Chris Lattner8d354e92005-09-30 04:11:27 +00001050 ;
1051 break;}
1052case 8:
1053#line 246 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1054{ // dag type
Reid Spencer68a24bd2005-08-27 18:50:39 +00001055 yyval.Ty = new DagRecTy();
Chris Lattner8d354e92005-09-30 04:11:27 +00001056 ;
1057 break;}
1058case 9:
1059#line 248 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1060{ // Record Type
Reid Spencer68a24bd2005-08-27 18:50:39 +00001061 yyval.Ty = new RecordRecTy(yyvsp[0].Rec);
Chris Lattner8d354e92005-09-30 04:11:27 +00001062 ;
1063 break;}
1064case 10:
1065#line 252 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1066{ yyval.IntVal = 0; ;
1067 break;}
1068case 11:
1069#line 252 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1070{ yyval.IntVal = 1; ;
1071 break;}
1072case 12:
1073#line 254 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1074{ yyval.Initializer = 0; ;
1075 break;}
1076case 13:
1077#line 254 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1078{ yyval.Initializer = yyvsp[0].Initializer; ;
1079 break;}
1080case 14:
1081#line 256 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1082{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001083 yyval.Initializer = new IntInit(yyvsp[0].IntVal);
Chris Lattner8d354e92005-09-30 04:11:27 +00001084 ;
1085 break;}
1086case 15:
1087#line 258 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1088{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001089 yyval.Initializer = new StringInit(*yyvsp[0].StrVal);
1090 delete yyvsp[0].StrVal;
Chris Lattner8d354e92005-09-30 04:11:27 +00001091 ;
1092 break;}
1093case 16:
1094#line 261 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1095{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001096 yyval.Initializer = new CodeInit(*yyvsp[0].StrVal);
1097 delete yyvsp[0].StrVal;
Chris Lattner8d354e92005-09-30 04:11:27 +00001098 ;
1099 break;}
1100case 17:
1101#line 264 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1102{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001103 yyval.Initializer = new UnsetInit();
Chris Lattner8d354e92005-09-30 04:11:27 +00001104 ;
1105 break;}
1106case 18:
1107#line 266 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1108{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001109 BitsInit *Init = new BitsInit(yyvsp[-1].FieldList->size());
1110 for (unsigned i = 0, e = yyvsp[-1].FieldList->size(); i != e; ++i) {
1111 struct Init *Bit = (*yyvsp[-1].FieldList)[i]->convertInitializerTo(new BitRecTy());
1112 if (Bit == 0) {
Chris Lattnerba4b1442005-09-08 18:22:57 +00001113 err() << "Element #" << i << " (" << *(*yyvsp[-1].FieldList)[i]
1114 << ") is not convertable to a bit!\n";
1115 exit(1);
Reid Spencer68a24bd2005-08-27 18:50:39 +00001116 }
1117 Init->setBit(yyvsp[-1].FieldList->size()-i-1, Bit);
1118 }
1119 yyval.Initializer = Init;
1120 delete yyvsp[-1].FieldList;
Chris Lattner8d354e92005-09-30 04:11:27 +00001121 ;
1122 break;}
1123case 19:
1124#line 279 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1125{
Chris Lattnerca572be2005-09-08 18:48:47 +00001126 // This is a CLASS<initvalslist> expression. This is supposed to synthesize
1127 // a new anonymous definition, deriving from CLASS<initvalslist> with no
1128 // body.
1129 Record *Class = Records.getClass(*yyvsp[-3].StrVal);
1130 if (!Class) {
1131 err() << "Expected a class, got '" << *yyvsp[-3].StrVal << "'!\n";
1132 exit(1);
1133 }
1134 delete yyvsp[-3].StrVal;
1135
1136 static unsigned AnonCounter = 0;
1137 Record *OldRec = CurRec; // Save CurRec.
1138
1139 // Create the new record, set it as CurRec temporarily.
1140 CurRec = new Record("anonymous.val."+utostr(AnonCounter++));
1141 addSubClass(Class, *yyvsp[-1].FieldList); // Add info about the subclass to CurRec.
1142 delete yyvsp[-1].FieldList; // Free up the template args.
1143
Chris Lattner751eabf2005-09-08 19:47:28 +00001144 CurRec->resolveReferences();
Chris Lattnerca572be2005-09-08 18:48:47 +00001145
1146 Records.addDef(CurRec);
1147
1148 // The result of the expression is a reference to the new record.
1149 yyval.Initializer = new DefInit(CurRec);
1150
1151 // Restore the old CurRec
1152 CurRec = OldRec;
Chris Lattner8d354e92005-09-30 04:11:27 +00001153 ;
1154 break;}
1155case 20:
1156#line 307 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1157{
Chris Lattner2b931e82005-09-12 05:30:06 +00001158 if (const RecordVal *RV = (CurRec ? CurRec->getValue(*yyvsp[0].StrVal) : 0)) {
1159 yyval.Initializer = new VarInit(*yyvsp[0].StrVal, RV->getType());
1160 } else if (CurRec && CurRec->isTemplateArg(CurRec->getName()+":"+*yyvsp[0].StrVal)) {
1161 const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*yyvsp[0].StrVal);
1162 assert(RV && "Template arg doesn't exist??");
1163 yyval.Initializer = new VarInit(CurRec->getName()+":"+*yyvsp[0].StrVal, RV->getType());
1164 } else if (Record *D = Records.getDef(*yyvsp[0].StrVal)) {
1165 yyval.Initializer = new DefInit(D);
1166 } else {
1167 err() << "Variable not defined: '" << *yyvsp[0].StrVal << "'!\n";
1168 exit(1);
1169 }
1170
1171 delete yyvsp[0].StrVal;
Chris Lattner8d354e92005-09-30 04:11:27 +00001172 ;
1173 break;}
1174case 21:
1175#line 322 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1176{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001177 yyval.Initializer = yyvsp[-3].Initializer->convertInitializerBitRange(*yyvsp[-1].BitList);
1178 if (yyval.Initializer == 0) {
1179 err() << "Invalid bit range for value '" << *yyvsp[-3].Initializer << "'!\n";
1180 exit(1);
1181 }
1182 delete yyvsp[-1].BitList;
Chris Lattner8d354e92005-09-30 04:11:27 +00001183 ;
1184 break;}
1185case 22:
1186#line 329 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1187{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001188 yyval.Initializer = new ListInit(*yyvsp[-1].FieldList);
1189 delete yyvsp[-1].FieldList;
Chris Lattner8d354e92005-09-30 04:11:27 +00001190 ;
1191 break;}
1192case 23:
1193#line 332 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1194{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001195 if (!yyvsp[-2].Initializer->getFieldType(*yyvsp[0].StrVal)) {
1196 err() << "Cannot access field '" << *yyvsp[0].StrVal << "' of value '" << *yyvsp[-2].Initializer << "!\n";
1197 exit(1);
1198 }
1199 yyval.Initializer = new FieldInit(yyvsp[-2].Initializer, *yyvsp[0].StrVal);
1200 delete yyvsp[0].StrVal;
Chris Lattner8d354e92005-09-30 04:11:27 +00001201 ;
1202 break;}
1203case 24:
1204#line 339 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1205{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001206 Record *D = Records.getDef(*yyvsp[-2].StrVal);
1207 if (D == 0) {
1208 err() << "Invalid def '" << *yyvsp[-2].StrVal << "'!\n";
1209 exit(1);
1210 }
1211 yyval.Initializer = new DagInit(D, *yyvsp[-1].DagValueList);
1212 delete yyvsp[-2].StrVal; delete yyvsp[-1].DagValueList;
Chris Lattner8d354e92005-09-30 04:11:27 +00001213 ;
1214 break;}
1215case 25:
1216#line 347 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1217{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001218 std::reverse(yyvsp[-1].BitList->begin(), yyvsp[-1].BitList->end());
1219 yyval.Initializer = yyvsp[-3].Initializer->convertInitListSlice(*yyvsp[-1].BitList);
1220 if (yyval.Initializer == 0) {
1221 err() << "Invalid list slice for value '" << *yyvsp[-3].Initializer << "'!\n";
1222 exit(1);
1223 }
1224 delete yyvsp[-1].BitList;
Chris Lattner8d354e92005-09-30 04:11:27 +00001225 ;
1226 break;}
1227case 26:
1228#line 355 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1229{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001230 yyval.Initializer = yyvsp[-3].Initializer->getBinaryOp(Init::SHL, yyvsp[-1].Initializer);
1231 if (yyval.Initializer == 0) {
1232 err() << "Cannot shift values '" << *yyvsp[-3].Initializer << "' and '" << *yyvsp[-1].Initializer << "'!\n";
1233 exit(1);
1234 }
Chris Lattner8d354e92005-09-30 04:11:27 +00001235 ;
1236 break;}
1237case 27:
1238#line 361 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1239{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001240 yyval.Initializer = yyvsp[-3].Initializer->getBinaryOp(Init::SRA, yyvsp[-1].Initializer);
1241 if (yyval.Initializer == 0) {
1242 err() << "Cannot shift values '" << *yyvsp[-3].Initializer << "' and '" << *yyvsp[-1].Initializer << "'!\n";
1243 exit(1);
1244 }
Chris Lattner8d354e92005-09-30 04:11:27 +00001245 ;
1246 break;}
1247case 28:
1248#line 367 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1249{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001250 yyval.Initializer = yyvsp[-3].Initializer->getBinaryOp(Init::SRL, yyvsp[-1].Initializer);
1251 if (yyval.Initializer == 0) {
1252 err() << "Cannot shift values '" << *yyvsp[-3].Initializer << "' and '" << *yyvsp[-1].Initializer << "'!\n";
1253 exit(1);
1254 }
Chris Lattner8d354e92005-09-30 04:11:27 +00001255 ;
1256 break;}
1257case 29:
1258#line 375 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1259{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001260 yyval.StrVal = new std::string();
Chris Lattner8d354e92005-09-30 04:11:27 +00001261 ;
1262 break;}
1263case 30:
1264#line 378 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1265{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001266 yyval.StrVal = yyvsp[0].StrVal;
Chris Lattner8d354e92005-09-30 04:11:27 +00001267 ;
1268 break;}
1269case 31:
1270#line 382 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1271{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001272 yyval.DagValueList = new std::vector<std::pair<Init*, std::string> >();
1273 yyval.DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
1274 delete yyvsp[0].StrVal;
Chris Lattner8d354e92005-09-30 04:11:27 +00001275 ;
1276 break;}
1277case 32:
1278#line 387 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1279{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001280 yyvsp[-3].DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
1281 delete yyvsp[0].StrVal;
1282 yyval.DagValueList = yyvsp[-3].DagValueList;
Chris Lattner8d354e92005-09-30 04:11:27 +00001283 ;
1284 break;}
1285case 33:
1286#line 393 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1287{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001288 yyval.DagValueList = new std::vector<std::pair<Init*, std::string> >();
Chris Lattner8d354e92005-09-30 04:11:27 +00001289 ;
1290 break;}
1291case 34:
1292#line 396 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1293{ yyval.DagValueList = yyvsp[0].DagValueList; ;
1294 break;}
1295case 35:
1296#line 399 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1297{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001298 yyval.BitList = new std::vector<unsigned>();
1299 yyval.BitList->push_back(yyvsp[0].IntVal);
Chris Lattner8d354e92005-09-30 04:11:27 +00001300 ;
1301 break;}
1302case 36:
1303#line 402 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1304{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001305 if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
1306 err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
1307 exit(1);
1308 }
1309 yyval.BitList = new std::vector<unsigned>();
1310 if (yyvsp[-2].IntVal < yyvsp[0].IntVal) {
1311 for (int i = yyvsp[-2].IntVal; i <= yyvsp[0].IntVal; ++i)
1312 yyval.BitList->push_back(i);
1313 } else {
1314 for (int i = yyvsp[-2].IntVal; i >= yyvsp[0].IntVal; --i)
1315 yyval.BitList->push_back(i);
1316 }
Chris Lattner8d354e92005-09-30 04:11:27 +00001317 ;
1318 break;}
1319case 37:
1320#line 415 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1321{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001322 yyvsp[0].IntVal = -yyvsp[0].IntVal;
1323 if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
1324 err() << "Invalid range: " << yyvsp[-1].IntVal << "-" << yyvsp[0].IntVal << "!\n";
1325 exit(1);
1326 }
1327 yyval.BitList = new std::vector<unsigned>();
1328 if (yyvsp[-1].IntVal < yyvsp[0].IntVal) {
1329 for (int i = yyvsp[-1].IntVal; i <= yyvsp[0].IntVal; ++i)
1330 yyval.BitList->push_back(i);
1331 } else {
1332 for (int i = yyvsp[-1].IntVal; i >= yyvsp[0].IntVal; --i)
1333 yyval.BitList->push_back(i);
1334 }
Chris Lattner8d354e92005-09-30 04:11:27 +00001335 ;
1336 break;}
1337case 38:
1338#line 429 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1339{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001340 (yyval.BitList=yyvsp[-2].BitList)->push_back(yyvsp[0].IntVal);
Chris Lattner8d354e92005-09-30 04:11:27 +00001341 ;
1342 break;}
1343case 39:
1344#line 431 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1345{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001346 if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
1347 err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
1348 exit(1);
1349 }
1350 yyval.BitList = yyvsp[-4].BitList;
1351 if (yyvsp[-2].IntVal < yyvsp[0].IntVal) {
1352 for (int i = yyvsp[-2].IntVal; i <= yyvsp[0].IntVal; ++i)
1353 yyval.BitList->push_back(i);
1354 } else {
1355 for (int i = yyvsp[-2].IntVal; i >= yyvsp[0].IntVal; --i)
1356 yyval.BitList->push_back(i);
1357 }
Chris Lattner8d354e92005-09-30 04:11:27 +00001358 ;
1359 break;}
1360case 40:
1361#line 444 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1362{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001363 yyvsp[0].IntVal = -yyvsp[0].IntVal;
1364 if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
1365 err() << "Invalid range: " << yyvsp[-1].IntVal << "-" << yyvsp[0].IntVal << "!\n";
1366 exit(1);
1367 }
1368 yyval.BitList = yyvsp[-3].BitList;
1369 if (yyvsp[-1].IntVal < yyvsp[0].IntVal) {
1370 for (int i = yyvsp[-1].IntVal; i <= yyvsp[0].IntVal; ++i)
1371 yyval.BitList->push_back(i);
1372 } else {
1373 for (int i = yyvsp[-1].IntVal; i >= yyvsp[0].IntVal; --i)
1374 yyval.BitList->push_back(i);
1375 }
Chris Lattner8d354e92005-09-30 04:11:27 +00001376 ;
1377 break;}
1378case 41:
1379#line 460 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1380{ yyval.BitList = yyvsp[0].BitList; std::reverse(yyvsp[0].BitList->begin(), yyvsp[0].BitList->end()); ;
1381 break;}
1382case 42:
1383#line 462 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1384{ yyval.BitList = 0; ;
1385 break;}
1386case 43:
1387#line 462 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1388{ yyval.BitList = yyvsp[-1].BitList; ;
1389 break;}
1390case 44:
1391#line 466 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1392{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001393 yyval.FieldList = new std::vector<Init*>();
Chris Lattner8d354e92005-09-30 04:11:27 +00001394 ;
1395 break;}
1396case 45:
1397#line 468 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1398{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001399 yyval.FieldList = yyvsp[0].FieldList;
Chris Lattner8d354e92005-09-30 04:11:27 +00001400 ;
1401 break;}
1402case 46:
1403#line 472 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1404{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001405 yyval.FieldList = new std::vector<Init*>();
1406 yyval.FieldList->push_back(yyvsp[0].Initializer);
Chris Lattner8d354e92005-09-30 04:11:27 +00001407 ;
1408 break;}
1409case 47:
1410#line 475 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1411{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001412 (yyval.FieldList = yyvsp[-2].FieldList)->push_back(yyvsp[0].Initializer);
Chris Lattner8d354e92005-09-30 04:11:27 +00001413 ;
1414 break;}
1415case 48:
1416#line 479 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1417{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001418 std::string DecName = *yyvsp[-1].StrVal;
1419 if (ParsingTemplateArgs)
1420 DecName = CurRec->getName() + ":" + DecName;
1421
1422 addValue(RecordVal(DecName, yyvsp[-2].Ty, yyvsp[-3].IntVal));
1423 setValue(DecName, 0, yyvsp[0].Initializer);
1424 yyval.StrVal = new std::string(DecName);
Chris Lattner8d354e92005-09-30 04:11:27 +00001425;
1426 break;}
1427case 49:
1428#line 489 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1429{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001430 delete yyvsp[-1].StrVal;
Chris Lattner8d354e92005-09-30 04:11:27 +00001431;
1432 break;}
1433case 50:
1434#line 491 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1435{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001436 setValue(*yyvsp[-4].StrVal, yyvsp[-3].BitList, yyvsp[-1].Initializer);
1437 delete yyvsp[-4].StrVal;
1438 delete yyvsp[-3].BitList;
Chris Lattner8d354e92005-09-30 04:11:27 +00001439;
1440 break;}
1441case 55:
1442#line 500 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1443{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001444 yyval.SubClassRef = new SubClassRefTy(yyvsp[0].Rec, new std::vector<Init*>());
Chris Lattner8d354e92005-09-30 04:11:27 +00001445 ;
1446 break;}
1447case 56:
1448#line 502 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1449{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001450 yyval.SubClassRef = new SubClassRefTy(yyvsp[-3].Rec, yyvsp[-1].FieldList);
Chris Lattner8d354e92005-09-30 04:11:27 +00001451 ;
1452 break;}
1453case 57:
1454#line 506 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1455{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001456 yyval.SubClassList = new std::vector<SubClassRefTy>();
1457 yyval.SubClassList->push_back(*yyvsp[0].SubClassRef);
1458 delete yyvsp[0].SubClassRef;
Chris Lattner8d354e92005-09-30 04:11:27 +00001459 ;
1460 break;}
1461case 58:
1462#line 511 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1463{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001464 (yyval.SubClassList=yyvsp[-2].SubClassList)->push_back(*yyvsp[0].SubClassRef);
1465 delete yyvsp[0].SubClassRef;
Chris Lattner8d354e92005-09-30 04:11:27 +00001466 ;
1467 break;}
1468case 59:
1469#line 516 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1470{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001471 yyval.SubClassList = new std::vector<SubClassRefTy>();
Chris Lattner8d354e92005-09-30 04:11:27 +00001472 ;
1473 break;}
1474case 60:
1475#line 519 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1476{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001477 yyval.SubClassList = yyvsp[0].SubClassList;
Chris Lattner8d354e92005-09-30 04:11:27 +00001478 ;
1479 break;}
1480case 61:
1481#line 523 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1482{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001483 CurRec->addTemplateArg(*yyvsp[0].StrVal);
1484 delete yyvsp[0].StrVal;
Chris Lattner8d354e92005-09-30 04:11:27 +00001485;
1486 break;}
1487case 62:
1488#line 526 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1489{
Chris Lattnerca572be2005-09-08 18:48:47 +00001490 CurRec->addTemplateArg(*yyvsp[0].StrVal);
1491 delete yyvsp[0].StrVal;
Chris Lattner8d354e92005-09-30 04:11:27 +00001492;
1493 break;}
1494case 63:
1495#line 531 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1496{;
1497 break;}
1498case 66:
1499#line 534 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1500{ yyval.StrVal = yyvsp[0].StrVal; ;
1501 break;}
1502case 67:
1503#line 534 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1504{ yyval.StrVal = new std::string(); ;
1505 break;}
1506case 68:
1507#line 536 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1508{
1509 static unsigned AnonCounter = 0;
1510 if (yyvsp[0].StrVal->empty())
1511 *yyvsp[0].StrVal = "anonymous."+utostr(AnonCounter++);
1512 CurRec = new Record(*yyvsp[0].StrVal);
1513 delete yyvsp[0].StrVal;
1514 ParsingTemplateArgs = true;
1515;
1516 break;}
1517case 69:
1518#line 545 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1519{
1520 if (Records.getClass(CurRec->getName())) {
1521 err() << "Class '" << CurRec->getName() << "' already defined!\n";
1522 exit(1);
1523 }
1524 Records.addClass(CurRec);
1525;
1526 break;}
1527case 70:
1528#line 553 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1529{
1530 // Ensure redefinition doesn't happen.
1531 if (Records.getDef(CurRec->getName())) {
1532 err() << "Def '" << CurRec->getName() << "' already defined!\n";
1533 exit(1);
1534 }
1535 Records.addDef(CurRec);
1536;
1537 break;}
1538case 71:
1539#line 562 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1540{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001541 ParsingTemplateArgs = false;
1542 for (unsigned i = 0, e = yyvsp[0].SubClassList->size(); i != e; ++i) {
Chris Lattnerba4b1442005-09-08 18:22:57 +00001543 addSubClass((*yyvsp[0].SubClassList)[i].first, *(*yyvsp[0].SubClassList)[i].second);
Reid Spencer68a24bd2005-08-27 18:50:39 +00001544 // Delete the template arg values for the class
1545 delete (*yyvsp[0].SubClassList)[i].second;
1546 }
1547 delete yyvsp[0].SubClassList; // Delete the class list...
1548
Chris Lattnerba4b1442005-09-08 18:22:57 +00001549 // Process any variables on the set stack...
1550 for (unsigned i = 0, e = LetStack.size(); i != e; ++i)
Reid Spencer68a24bd2005-08-27 18:50:39 +00001551 for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j)
1552 setValue(LetStack[i][j].Name,
1553 LetStack[i][j].HasBits ? &LetStack[i][j].Bits : 0,
1554 LetStack[i][j].Value);
Chris Lattner8d354e92005-09-30 04:11:27 +00001555 ;
1556 break;}
1557case 72:
1558#line 577 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1559{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001560 yyval.Rec = CurRec;
1561 CurRec = 0;
Chris Lattner8d354e92005-09-30 04:11:27 +00001562 ;
1563 break;}
1564case 73:
1565#line 582 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1566{
1567 yyval.Rec = yyvsp[0].Rec;
1568;
1569 break;}
1570case 74:
1571#line 586 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1572{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001573 yyvsp[0].Rec->resolveReferences();
1574
Chris Lattnerca572be2005-09-08 18:48:47 +00001575 // If ObjectBody has template arguments, it's an error.
Reid Spencer68a24bd2005-08-27 18:50:39 +00001576 if (!yyvsp[0].Rec->getTemplateArgs().empty()) {
1577 err() << "Def '" << yyvsp[0].Rec->getName()
1578 << "' is not permitted to have template arguments!\n";
1579 exit(1);
1580 }
Chris Lattner8d354e92005-09-30 04:11:27 +00001581 yyval.Rec = yyvsp[0].Rec;
1582;
1583 break;}
1584case 77:
1585#line 601 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1586{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001587 LetStack.back().push_back(LetRecord(*yyvsp[-3].StrVal, yyvsp[-2].BitList, yyvsp[0].Initializer));
1588 delete yyvsp[-3].StrVal; delete yyvsp[-2].BitList;
Chris Lattner8d354e92005-09-30 04:11:27 +00001589;
1590 break;}
1591case 80:
1592#line 609 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1593{ LetStack.push_back(std::vector<LetRecord>()); ;
1594 break;}
1595case 82:
1596#line 612 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1597{
Reid Spencer68a24bd2005-08-27 18:50:39 +00001598 LetStack.pop_back();
Chris Lattner8d354e92005-09-30 04:11:27 +00001599 ;
1600 break;}
1601case 83:
1602#line 615 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1603{
Chris Lattnerca572be2005-09-08 18:48:47 +00001604 LetStack.pop_back();
Chris Lattner8d354e92005-09-30 04:11:27 +00001605 ;
1606 break;}
1607case 84:
1608#line 619 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1609{;
1610 break;}
1611case 85:
1612#line 619 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1613{;
1614 break;}
1615case 86:
1616#line 621 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
1617{;
1618 break;}
1619}
1620 /* the action file gets copied in in place of this dollarsign */
1621#line 543 "/usr/share/bison.simple"
Reid Spencer68a24bd2005-08-27 18:50:39 +00001622
1623 yyvsp -= yylen;
1624 yyssp -= yylen;
Chris Lattner8d354e92005-09-30 04:11:27 +00001625#ifdef YYLSP_NEEDED
1626 yylsp -= yylen;
1627#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +00001628
Chris Lattner8d354e92005-09-30 04:11:27 +00001629#if YYDEBUG != 0
1630 if (yydebug)
1631 {
1632 short *ssp1 = yyss - 1;
1633 fprintf (stderr, "state stack now");
1634 while (ssp1 != yyssp)
1635 fprintf (stderr, " %d", *++ssp1);
1636 fprintf (stderr, "\n");
1637 }
1638#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +00001639
1640 *++yyvsp = yyval;
1641
Chris Lattner8d354e92005-09-30 04:11:27 +00001642#ifdef YYLSP_NEEDED
1643 yylsp++;
1644 if (yylen == 0)
1645 {
1646 yylsp->first_line = yylloc.first_line;
1647 yylsp->first_column = yylloc.first_column;
1648 yylsp->last_line = (yylsp-1)->last_line;
1649 yylsp->last_column = (yylsp-1)->last_column;
1650 yylsp->text = 0;
1651 }
1652 else
1653 {
1654 yylsp->last_line = (yylsp+yylen-1)->last_line;
1655 yylsp->last_column = (yylsp+yylen-1)->last_column;
1656 }
1657#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +00001658
Chris Lattner8d354e92005-09-30 04:11:27 +00001659 /* Now "shift" the result of the reduction.
1660 Determine what state that goes to,
1661 based on the state we popped back to
1662 and the rule number reduced by. */
Reid Spencer68a24bd2005-08-27 18:50:39 +00001663
1664 yyn = yyr1[yyn];
1665
Chris Lattner8d354e92005-09-30 04:11:27 +00001666 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1667 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Reid Spencer68a24bd2005-08-27 18:50:39 +00001668 yystate = yytable[yystate];
1669 else
Chris Lattner8d354e92005-09-30 04:11:27 +00001670 yystate = yydefgoto[yyn - YYNTBASE];
Reid Spencer68a24bd2005-08-27 18:50:39 +00001671
1672 goto yynewstate;
1673
Chris Lattner8d354e92005-09-30 04:11:27 +00001674yyerrlab: /* here on detecting error */
Reid Spencer68a24bd2005-08-27 18:50:39 +00001675
Chris Lattner8d354e92005-09-30 04:11:27 +00001676 if (! yyerrstatus)
1677 /* If not already recovering from an error, report this error. */
Reid Spencer68a24bd2005-08-27 18:50:39 +00001678 {
1679 ++yynerrs;
Chris Lattner8d354e92005-09-30 04:11:27 +00001680
1681#ifdef YYERROR_VERBOSE
Reid Spencer68a24bd2005-08-27 18:50:39 +00001682 yyn = yypact[yystate];
1683
Chris Lattner8d354e92005-09-30 04:11:27 +00001684 if (yyn > YYFLAG && yyn < YYLAST)
Reid Spencer68a24bd2005-08-27 18:50:39 +00001685 {
Chris Lattner8d354e92005-09-30 04:11:27 +00001686 int size = 0;
1687 char *msg;
1688 int x, count;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001689
Chris Lattner8d354e92005-09-30 04:11:27 +00001690 count = 0;
1691 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1692 for (x = (yyn < 0 ? -yyn : 0);
1693 x < (sizeof(yytname) / sizeof(char *)); x++)
1694 if (yycheck[x + yyn] == x)
1695 size += strlen(yytname[x]) + 15, count++;
1696 msg = (char *) malloc(size + 15);
1697 if (msg != 0)
Reid Spencer68a24bd2005-08-27 18:50:39 +00001698 {
Chris Lattner8d354e92005-09-30 04:11:27 +00001699 strcpy(msg, "parse error");
Reid Spencer68a24bd2005-08-27 18:50:39 +00001700
Chris Lattner8d354e92005-09-30 04:11:27 +00001701 if (count < 5)
Reid Spencer68a24bd2005-08-27 18:50:39 +00001702 {
Chris Lattner8d354e92005-09-30 04:11:27 +00001703 count = 0;
1704 for (x = (yyn < 0 ? -yyn : 0);
1705 x < (sizeof(yytname) / sizeof(char *)); x++)
1706 if (yycheck[x + yyn] == x)
Reid Spencer68a24bd2005-08-27 18:50:39 +00001707 {
Chris Lattner8d354e92005-09-30 04:11:27 +00001708 strcat(msg, count == 0 ? ", expecting `" : " or `");
1709 strcat(msg, yytname[x]);
1710 strcat(msg, "'");
1711 count++;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001712 }
1713 }
Chris Lattner8d354e92005-09-30 04:11:27 +00001714 yyerror(msg);
1715 free(msg);
Reid Spencer68a24bd2005-08-27 18:50:39 +00001716 }
1717 else
Chris Lattner8d354e92005-09-30 04:11:27 +00001718 yyerror ("parse error; also virtual memory exceeded");
Reid Spencer68a24bd2005-08-27 18:50:39 +00001719 }
1720 else
1721#endif /* YYERROR_VERBOSE */
Chris Lattner8d354e92005-09-30 04:11:27 +00001722 yyerror("parse error");
Reid Spencer68a24bd2005-08-27 18:50:39 +00001723 }
1724
Chris Lattner8d354e92005-09-30 04:11:27 +00001725 goto yyerrlab1;
1726yyerrlab1: /* here on error raised explicitly by an action */
Reid Spencer68a24bd2005-08-27 18:50:39 +00001727
1728 if (yyerrstatus == 3)
1729 {
Chris Lattner8d354e92005-09-30 04:11:27 +00001730 /* if just tried and failed to reuse lookahead token after an error, discard it. */
Reid Spencer68a24bd2005-08-27 18:50:39 +00001731
Chris Lattner8d354e92005-09-30 04:11:27 +00001732 /* return failure if at end of input */
Chris Lattnerba4b1442005-09-08 18:22:57 +00001733 if (yychar == YYEOF)
Reid Spencer68a24bd2005-08-27 18:50:39 +00001734 YYABORT;
1735
Chris Lattner8d354e92005-09-30 04:11:27 +00001736#if YYDEBUG != 0
1737 if (yydebug)
1738 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1739#endif
Chris Lattnerba4b1442005-09-08 18:22:57 +00001740
Chris Lattner8d354e92005-09-30 04:11:27 +00001741 yychar = YYEMPTY;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001742 }
1743
Chris Lattner8d354e92005-09-30 04:11:27 +00001744 /* Else will try to reuse lookahead token
1745 after shifting the error token. */
1746
1747 yyerrstatus = 3; /* Each real token shifted decrements this */
1748
1749 goto yyerrhandle;
1750
1751yyerrdefault: /* current state does not do anything special for the error token. */
1752
1753#if 0
1754 /* This is wrong; only states that explicitly want error tokens
1755 should shift them. */
1756 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1757 if (yyn) goto yydefault;
1758#endif
1759
1760yyerrpop: /* pop the current state because it cannot handle the error token */
1761
1762 if (yyssp == yyss) YYABORT;
1763 yyvsp--;
1764 yystate = *--yyssp;
1765#ifdef YYLSP_NEEDED
1766 yylsp--;
1767#endif
1768
1769#if YYDEBUG != 0
1770 if (yydebug)
1771 {
1772 short *ssp1 = yyss - 1;
1773 fprintf (stderr, "Error: state stack now");
1774 while (ssp1 != yyssp)
1775 fprintf (stderr, " %d", *++ssp1);
1776 fprintf (stderr, "\n");
1777 }
1778#endif
1779
1780yyerrhandle:
1781
1782 yyn = yypact[yystate];
1783 if (yyn == YYFLAG)
1784 goto yyerrdefault;
1785
1786 yyn += YYTERROR;
1787 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1788 goto yyerrdefault;
1789
1790 yyn = yytable[yyn];
1791 if (yyn < 0)
1792 {
1793 if (yyn == YYFLAG)
1794 goto yyerrpop;
1795 yyn = -yyn;
1796 goto yyreduce;
1797 }
1798 else if (yyn == 0)
1799 goto yyerrpop;
1800
Reid Spencer68a24bd2005-08-27 18:50:39 +00001801 if (yyn == YYFINAL)
1802 YYACCEPT;
1803
Chris Lattner8d354e92005-09-30 04:11:27 +00001804#if YYDEBUG != 0
1805 if (yydebug)
1806 fprintf(stderr, "Shifting error token, ");
1807#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +00001808
1809 *++yyvsp = yylval;
Chris Lattner8d354e92005-09-30 04:11:27 +00001810#ifdef YYLSP_NEEDED
1811 *++yylsp = yylloc;
1812#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +00001813
1814 yystate = yyn;
1815 goto yynewstate;
1816
Chris Lattner8d354e92005-09-30 04:11:27 +00001817 yyacceptlab:
1818 /* YYACCEPT comes here. */
1819 if (yyfree_stacks)
1820 {
1821 free (yyss);
1822 free (yyvs);
1823#ifdef YYLSP_NEEDED
1824 free (yyls);
Reid Spencer68a24bd2005-08-27 18:50:39 +00001825#endif
Chris Lattner8d354e92005-09-30 04:11:27 +00001826 }
1827 return 0;
Chris Lattner2b931e82005-09-12 05:30:06 +00001828
Chris Lattner8d354e92005-09-30 04:11:27 +00001829 yyabortlab:
1830 /* YYABORT comes here. */
1831 if (yyfree_stacks)
1832 {
1833 free (yyss);
1834 free (yyvs);
1835#ifdef YYLSP_NEEDED
1836 free (yyls);
Chris Lattner2b931e82005-09-12 05:30:06 +00001837#endif
Chris Lattner8d354e92005-09-30 04:11:27 +00001838 }
1839 return 1;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001840}
Chris Lattner8d354e92005-09-30 04:11:27 +00001841#line 623 "/Users/sabre/llvm/utils/TableGen/FileParser.y"
Reid Spencer68a24bd2005-08-27 18:50:39 +00001842
1843
1844int yyerror(const char *ErrorMsg) {
1845 err() << "Error parsing: " << ErrorMsg << "\n";
1846 exit(1);
1847}