blob: 702bb09b427cc760d8ec2b5f6cf2ee73b9a97cde [file] [log] [blame]
Jim Laskey2792cfb2006-12-06 11:03:10 +00001/* A Bison parser, made by GNU Bison 2.1. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002
Jim Laskey2792cfb2006-12-06 11:03:10 +00003/* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Reid Spencere7c3c602006-11-30 06:36:44 +00005
Jim Laskey2792cfb2006-12-06 11:03:10 +00006 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
Reid Spencere7c3c602006-11-30 06:36:44 +000010
Jim Laskey2792cfb2006-12-06 11:03:10 +000011 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
20
21/* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
25
26/* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
28
29/* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
35
36/* Identify Bison output. */
37#define YYBISON 1
38
39/* Bison version. */
40#define YYBISON_VERSION "2.1"
41
42/* Skeleton name. */
43#define YYSKELETON_NAME "yacc.c"
44
45/* Pure parsers. */
46#define YYPURE 0
47
48/* Using locations. */
49#define YYLSP_NEEDED 0
50
51/* Substitute the variable and function names. */
Reid Spencere7c3c602006-11-30 06:36:44 +000052#define yyparse Upgradeparse
Jim Laskey2792cfb2006-12-06 11:03:10 +000053#define yylex Upgradelex
Reid Spencere7c3c602006-11-30 06:36:44 +000054#define yyerror Upgradeerror
Jim Laskey2792cfb2006-12-06 11:03:10 +000055#define yylval Upgradelval
56#define yychar Upgradechar
Reid Spencere7c3c602006-11-30 06:36:44 +000057#define yydebug Upgradedebug
58#define yynerrs Upgradenerrs
59
Jim Laskey2792cfb2006-12-06 11:03:10 +000060
61/* Tokens. */
62#ifndef YYTOKENTYPE
63# define YYTOKENTYPE
64 /* Put the tokens into the symbol table, so that GDB and other debuggers
65 know about them. */
66 enum yytokentype {
67 VOID = 258,
68 BOOL = 259,
69 SBYTE = 260,
70 UBYTE = 261,
71 SHORT = 262,
72 USHORT = 263,
73 INT = 264,
74 UINT = 265,
75 LONG = 266,
76 ULONG = 267,
77 FLOAT = 268,
78 DOUBLE = 269,
79 LABEL = 270,
80 OPAQUE = 271,
81 ESINT64VAL = 272,
82 EUINT64VAL = 273,
83 SINTVAL = 274,
84 UINTVAL = 275,
85 FPVAL = 276,
86 NULL_TOK = 277,
87 UNDEF = 278,
88 ZEROINITIALIZER = 279,
89 TRUETOK = 280,
90 FALSETOK = 281,
91 TYPE = 282,
92 VAR_ID = 283,
93 LABELSTR = 284,
94 STRINGCONSTANT = 285,
95 IMPLEMENTATION = 286,
96 BEGINTOK = 287,
97 ENDTOK = 288,
98 DECLARE = 289,
Reid Spencer6fd36ab2006-12-29 20:35:03 +000099 DEFINE = 290,
100 GLOBAL = 291,
101 CONSTANT = 292,
102 SECTION = 293,
103 VOLATILE = 294,
104 TO = 295,
105 DOTDOTDOT = 296,
106 CONST = 297,
107 INTERNAL = 298,
108 LINKONCE = 299,
109 WEAK = 300,
110 DLLIMPORT = 301,
111 DLLEXPORT = 302,
112 EXTERN_WEAK = 303,
113 APPENDING = 304,
114 NOT = 305,
115 EXTERNAL = 306,
116 TARGET = 307,
117 TRIPLE = 308,
118 ENDIAN = 309,
119 POINTERSIZE = 310,
120 LITTLE = 311,
121 BIG = 312,
122 ALIGN = 313,
123 UNINITIALIZED = 314,
124 DEPLIBS = 315,
125 CALL = 316,
126 TAIL = 317,
127 ASM_TOK = 318,
128 MODULE = 319,
129 SIDEEFFECT = 320,
130 CC_TOK = 321,
131 CCC_TOK = 322,
132 CSRETCC_TOK = 323,
133 FASTCC_TOK = 324,
134 COLDCC_TOK = 325,
135 X86_STDCALLCC_TOK = 326,
136 X86_FASTCALLCC_TOK = 327,
137 DATALAYOUT = 328,
138 RET = 329,
139 BR = 330,
140 SWITCH = 331,
141 INVOKE = 332,
142 EXCEPT = 333,
143 UNWIND = 334,
144 UNREACHABLE = 335,
145 ADD = 336,
146 SUB = 337,
147 MUL = 338,
148 DIV = 339,
149 UDIV = 340,
150 SDIV = 341,
151 FDIV = 342,
152 REM = 343,
153 UREM = 344,
154 SREM = 345,
155 FREM = 346,
156 AND = 347,
157 OR = 348,
158 XOR = 349,
159 SETLE = 350,
160 SETGE = 351,
161 SETLT = 352,
162 SETGT = 353,
163 SETEQ = 354,
164 SETNE = 355,
165 ICMP = 356,
166 FCMP = 357,
167 EQ = 358,
168 NE = 359,
169 SLT = 360,
170 SGT = 361,
171 SLE = 362,
172 SGE = 363,
173 OEQ = 364,
174 ONE = 365,
175 OLT = 366,
176 OGT = 367,
177 OLE = 368,
178 OGE = 369,
179 ORD = 370,
180 UNO = 371,
181 UEQ = 372,
182 UNE = 373,
183 ULT = 374,
184 UGT = 375,
185 ULE = 376,
186 UGE = 377,
187 MALLOC = 378,
188 ALLOCA = 379,
189 FREE = 380,
190 LOAD = 381,
191 STORE = 382,
192 GETELEMENTPTR = 383,
193 PHI_TOK = 384,
194 SELECT = 385,
195 SHL = 386,
196 SHR = 387,
197 ASHR = 388,
198 LSHR = 389,
199 VAARG = 390,
200 EXTRACTELEMENT = 391,
201 INSERTELEMENT = 392,
202 SHUFFLEVECTOR = 393,
203 CAST = 394,
204 TRUNC = 395,
205 ZEXT = 396,
206 SEXT = 397,
207 FPTRUNC = 398,
208 FPEXT = 399,
209 FPTOUI = 400,
210 FPTOSI = 401,
211 UITOFP = 402,
212 SITOFP = 403,
213 PTRTOINT = 404,
214 INTTOPTR = 405,
215 BITCAST = 406
Jim Laskey2792cfb2006-12-06 11:03:10 +0000216 };
217#endif
218/* Tokens. */
219#define VOID 258
220#define BOOL 259
221#define SBYTE 260
222#define UBYTE 261
223#define SHORT 262
224#define USHORT 263
225#define INT 264
226#define UINT 265
227#define LONG 266
228#define ULONG 267
229#define FLOAT 268
230#define DOUBLE 269
231#define LABEL 270
232#define OPAQUE 271
233#define ESINT64VAL 272
234#define EUINT64VAL 273
235#define SINTVAL 274
236#define UINTVAL 275
237#define FPVAL 276
238#define NULL_TOK 277
239#define UNDEF 278
240#define ZEROINITIALIZER 279
241#define TRUETOK 280
242#define FALSETOK 281
243#define TYPE 282
244#define VAR_ID 283
245#define LABELSTR 284
246#define STRINGCONSTANT 285
247#define IMPLEMENTATION 286
248#define BEGINTOK 287
249#define ENDTOK 288
250#define DECLARE 289
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000251#define DEFINE 290
252#define GLOBAL 291
253#define CONSTANT 292
254#define SECTION 293
255#define VOLATILE 294
256#define TO 295
257#define DOTDOTDOT 296
258#define CONST 297
259#define INTERNAL 298
260#define LINKONCE 299
261#define WEAK 300
262#define DLLIMPORT 301
263#define DLLEXPORT 302
264#define EXTERN_WEAK 303
265#define APPENDING 304
266#define NOT 305
267#define EXTERNAL 306
268#define TARGET 307
269#define TRIPLE 308
270#define ENDIAN 309
271#define POINTERSIZE 310
272#define LITTLE 311
273#define BIG 312
274#define ALIGN 313
275#define UNINITIALIZED 314
276#define DEPLIBS 315
277#define CALL 316
278#define TAIL 317
279#define ASM_TOK 318
280#define MODULE 319
281#define SIDEEFFECT 320
282#define CC_TOK 321
283#define CCC_TOK 322
284#define CSRETCC_TOK 323
285#define FASTCC_TOK 324
286#define COLDCC_TOK 325
287#define X86_STDCALLCC_TOK 326
288#define X86_FASTCALLCC_TOK 327
289#define DATALAYOUT 328
290#define RET 329
291#define BR 330
292#define SWITCH 331
293#define INVOKE 332
294#define EXCEPT 333
295#define UNWIND 334
296#define UNREACHABLE 335
297#define ADD 336
298#define SUB 337
299#define MUL 338
300#define DIV 339
301#define UDIV 340
302#define SDIV 341
303#define FDIV 342
304#define REM 343
305#define UREM 344
306#define SREM 345
307#define FREM 346
308#define AND 347
309#define OR 348
310#define XOR 349
311#define SETLE 350
312#define SETGE 351
313#define SETLT 352
314#define SETGT 353
315#define SETEQ 354
316#define SETNE 355
317#define ICMP 356
318#define FCMP 357
319#define EQ 358
320#define NE 359
321#define SLT 360
322#define SGT 361
323#define SLE 362
324#define SGE 363
325#define OEQ 364
326#define ONE 365
327#define OLT 366
328#define OGT 367
329#define OLE 368
330#define OGE 369
331#define ORD 370
332#define UNO 371
333#define UEQ 372
334#define UNE 373
335#define ULT 374
336#define UGT 375
337#define ULE 376
338#define UGE 377
339#define MALLOC 378
340#define ALLOCA 379
341#define FREE 380
342#define LOAD 381
343#define STORE 382
344#define GETELEMENTPTR 383
345#define PHI_TOK 384
346#define SELECT 385
347#define SHL 386
348#define SHR 387
349#define ASHR 388
350#define LSHR 389
351#define VAARG 390
352#define EXTRACTELEMENT 391
353#define INSERTELEMENT 392
354#define SHUFFLEVECTOR 393
355#define CAST 394
356#define TRUNC 395
357#define ZEXT 396
358#define SEXT 397
359#define FPTRUNC 398
360#define FPEXT 399
361#define FPTOUI 400
362#define FPTOSI 401
363#define UITOFP 402
364#define SITOFP 403
365#define PTRTOINT 404
366#define INTTOPTR 405
367#define BITCAST 406
Jim Laskey2792cfb2006-12-06 11:03:10 +0000368
369
370
371
372/* Copy the first part of user declarations. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000373#line 14 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +0000374
Reid Spencere7c3c602006-11-30 06:36:44 +0000375#include "ParserInternals.h"
376#include <llvm/ADT/StringExtras.h>
Reid Spencere7c3c602006-11-30 06:36:44 +0000377#include <algorithm>
Reid Spencera50d5962006-12-02 04:11:07 +0000378#include <map>
Reid Spencere7c3c602006-11-30 06:36:44 +0000379#include <utility>
380#include <iostream>
Reid Spencerbec0b592006-12-03 03:16:48 +0000381#include <cassert>
Reid Spencere7c3c602006-11-30 06:36:44 +0000382
Reid Spencere77e35e2006-12-01 20:26:20 +0000383#define YYERROR_VERBOSE 1
Reid Spencer96839be2006-11-30 16:50:26 +0000384#define YYINCLUDED_STDLIB_H
Reid Spencere77e35e2006-12-01 20:26:20 +0000385#define YYDEBUG 1
Reid Spencere7c3c602006-11-30 06:36:44 +0000386
387int yylex(); // declaration" of xxx warnings.
388int yyparse();
Reid Spencere77e35e2006-12-01 20:26:20 +0000389extern int yydebug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000390
391static std::string CurFilename;
Reid Spencere7c3c602006-11-30 06:36:44 +0000392static std::ostream *O = 0;
Reid Spencer96839be2006-11-30 16:50:26 +0000393std::istream* LexInput = 0;
Reid Spencere77e35e2006-12-01 20:26:20 +0000394unsigned SizeOfPointer = 32;
Reid Spencerf459d392006-12-02 16:19:52 +0000395static uint64_t unique = 1;
Reid Spencer96839be2006-11-30 16:50:26 +0000396
Reid Spencera50d5962006-12-02 04:11:07 +0000397typedef std::vector<TypeInfo> TypeVector;
398static TypeVector EnumeratedTypes;
399typedef std::map<std::string,TypeInfo> TypeMap;
400static TypeMap NamedTypes;
Reid Spencerf12ee422006-12-05 19:21:25 +0000401static TypeMap Globals;
Reid Spencera50d5962006-12-02 04:11:07 +0000402
Reid Spencerf8483652006-12-02 15:16:01 +0000403void destroy(ValueList* VL) {
404 while (!VL->empty()) {
405 ValueInfo& VI = VL->back();
406 VI.destroy();
407 VL->pop_back();
408 }
409 delete VL;
410}
411
Reid Spencer96839be2006-11-30 16:50:26 +0000412void UpgradeAssembly(const std::string &infile, std::istream& in,
Reid Spencere77e35e2006-12-01 20:26:20 +0000413 std::ostream &out, bool debug)
Reid Spencere7c3c602006-11-30 06:36:44 +0000414{
415 Upgradelineno = 1;
416 CurFilename = infile;
Reid Spencer96839be2006-11-30 16:50:26 +0000417 LexInput = &in;
Reid Spencere77e35e2006-12-01 20:26:20 +0000418 yydebug = debug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000419 O = &out;
420
421 if (yyparse()) {
422 std::cerr << "Parse failed.\n";
423 exit(1);
424 }
425}
426
Reid Spencera50d5962006-12-02 04:11:07 +0000427static void ResolveType(TypeInfo& Ty) {
428 if (Ty.oldTy == UnresolvedTy) {
429 TypeMap::iterator I = NamedTypes.find(*Ty.newTy);
Reid Spencer78720742006-12-02 20:21:22 +0000430 if (I != NamedTypes.end()) {
Reid Spencera50d5962006-12-02 04:11:07 +0000431 Ty.oldTy = I->second.oldTy;
Reid Spencer78720742006-12-02 20:21:22 +0000432 Ty.elemTy = I->second.elemTy;
433 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000434 std::string msg("Can't resolve type: ");
435 msg += *Ty.newTy;
436 yyerror(msg.c_str());
Reid Spencer280d8012006-12-01 23:40:53 +0000437 }
Reid Spencera50d5962006-12-02 04:11:07 +0000438 } else if (Ty.oldTy == NumericTy) {
439 unsigned ref = atoi(&((Ty.newTy->c_str())[1])); // Skip the '\\'
440 if (ref < EnumeratedTypes.size()) {
441 Ty.oldTy = EnumeratedTypes[ref].oldTy;
Reid Spencer78720742006-12-02 20:21:22 +0000442 Ty.elemTy = EnumeratedTypes[ref].elemTy;
Reid Spencera50d5962006-12-02 04:11:07 +0000443 } else {
444 std::string msg("Can't resolve type: ");
445 msg += *Ty.newTy;
446 yyerror(msg.c_str());
447 }
Reid Spencer280d8012006-12-01 23:40:53 +0000448 }
Reid Spencera50d5962006-12-02 04:11:07 +0000449 // otherwise its already resolved.
Reid Spencer280d8012006-12-01 23:40:53 +0000450}
451
Reid Spencera50d5962006-12-02 04:11:07 +0000452static const char* getCastOpcode(
453 std::string& Source, const TypeInfo& SrcTy, const TypeInfo& DstTy)
454{
Reid Spencere77e35e2006-12-01 20:26:20 +0000455 unsigned SrcBits = SrcTy.getBitWidth();
456 unsigned DstBits = DstTy.getBitWidth();
457 const char* opcode = "bitcast";
458 // Run through the possibilities ...
459 if (DstTy.isIntegral()) { // Casting to integral
460 if (SrcTy.isIntegral()) { // Casting from integral
461 if (DstBits < SrcBits)
462 opcode = "trunc";
463 else if (DstBits > SrcBits) { // its an extension
464 if (SrcTy.isSigned())
465 opcode ="sext"; // signed -> SEXT
466 else
467 opcode = "zext"; // unsigned -> ZEXT
468 } else {
469 opcode = "bitcast"; // Same size, No-op cast
470 }
471 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
472 if (DstTy.isSigned())
473 opcode = "fptosi"; // FP -> sint
474 else
475 opcode = "fptoui"; // FP -> uint
476 } else if (SrcTy.isPacked()) {
477 assert(DstBits == SrcTy.getBitWidth() &&
478 "Casting packed to integer of different width");
479 opcode = "bitcast"; // same size, no-op cast
480 } else {
481 assert(SrcTy.isPointer() &&
482 "Casting from a value that is not first-class type");
483 opcode = "ptrtoint"; // ptr -> int
484 }
485 } else if (DstTy.isFloatingPoint()) { // Casting to floating pt
486 if (SrcTy.isIntegral()) { // Casting from integral
487 if (SrcTy.isSigned())
488 opcode = "sitofp"; // sint -> FP
489 else
490 opcode = "uitofp"; // uint -> FP
491 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
492 if (DstBits < SrcBits) {
493 opcode = "fptrunc"; // FP -> smaller FP
494 } else if (DstBits > SrcBits) {
495 opcode = "fpext"; // FP -> larger FP
496 } else {
497 opcode ="bitcast"; // same size, no-op cast
498 }
499 } else if (SrcTy.isPacked()) {
500 assert(DstBits == SrcTy.getBitWidth() &&
501 "Casting packed to floating point of different width");
502 opcode = "bitcast"; // same size, no-op cast
503 } else {
504 assert(0 && "Casting pointer or non-first class to float");
505 }
506 } else if (DstTy.isPacked()) {
507 if (SrcTy.isPacked()) {
508 assert(DstTy.getBitWidth() == SrcTy.getBitWidth() &&
509 "Casting packed to packed of different widths");
510 opcode = "bitcast"; // packed -> packed
511 } else if (DstTy.getBitWidth() == SrcBits) {
512 opcode = "bitcast"; // float/int -> packed
513 } else {
514 assert(!"Illegal cast to packed (wrong type or size)");
515 }
516 } else if (DstTy.isPointer()) {
517 if (SrcTy.isPointer()) {
518 opcode = "bitcast"; // ptr -> ptr
519 } else if (SrcTy.isIntegral()) {
520 opcode = "inttoptr"; // int -> ptr
521 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000522 assert(!"Casting invalid type to pointer");
Reid Spencere77e35e2006-12-01 20:26:20 +0000523 }
524 } else {
525 assert(!"Casting to type that is not first-class");
526 }
527 return opcode;
528}
529
Reid Spencera50d5962006-12-02 04:11:07 +0000530static std::string getCastUpgrade(
531 const std::string& Src, TypeInfo& SrcTy, TypeInfo& DstTy, bool isConst)
532{
533 std::string Result;
534 std::string Source = Src;
535 if (SrcTy.isFloatingPoint() && DstTy.isPointer()) {
536 // fp -> ptr cast is no longer supported but we must upgrade this
537 // by doing a double cast: fp -> int -> ptr
538 if (isConst)
539 Source = "ulong fptoui(" + Source + " to ulong)";
540 else {
Reid Spencerf459d392006-12-02 16:19:52 +0000541 *O << " %cast_upgrade" << unique << " = fptoui " << Source
542 << " to ulong\n";
543 Source = "ulong %cast_upgrade" + llvm::utostr(unique);
Reid Spencera50d5962006-12-02 04:11:07 +0000544 }
545 // Update the SrcTy for the getCastOpcode call below
546 SrcTy.destroy();
547 SrcTy.newTy = new std::string("ulong");
548 SrcTy.oldTy = ULongTy;
Reid Spencer5fe27e72006-12-09 19:41:25 +0000549 } else if (DstTy.oldTy == BoolTy && SrcTy.oldTy != BoolTy) {
Reid Spencera50d5962006-12-02 04:11:07 +0000550 // cast ptr %x to bool was previously defined as setne ptr %x, null
551 // The ptrtoint semantic is to truncate, not compare so we must retain
552 // the original intent by replace the cast with a setne
553 const char* comparator = SrcTy.isPointer() ? ", null" :
554 (SrcTy.isFloatingPoint() ? ", 0.0" : ", 0");
Reid Spencere4d87aa2006-12-23 06:05:41 +0000555 const char* compareOp = SrcTy.isFloatingPoint() ? "fcmp one " : "icmp ne ";
Reid Spencer187ccf82006-12-09 16:57:22 +0000556 if (isConst) {
557 Result = "(" + Source + comparator + ")";
558 Result = compareOp + Result;
559 } else
560 Result = compareOp + Source + comparator;
Reid Spencera50d5962006-12-02 04:11:07 +0000561 return Result; // skip cast processing below
562 }
563 ResolveType(SrcTy);
564 ResolveType(DstTy);
565 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
566 if (isConst)
567 Result += Opcode + "( " + Source + " to " + *DstTy.newTy + ")";
568 else
569 Result += Opcode + " " + Source + " to " + *DstTy.newTy;
570 return Result;
571}
572
Reid Spencer78720742006-12-02 20:21:22 +0000573const char* getDivRemOpcode(const std::string& opcode, const TypeInfo& TI) {
574 const char* op = opcode.c_str();
575 TypeInfo Ty = TI;
576 ResolveType(Ty);
577 if (Ty.isPacked())
578 Ty.oldTy = Ty.getElementType();
579 if (opcode == "div")
580 if (Ty.isFloatingPoint())
581 op = "fdiv";
582 else if (Ty.isUnsigned())
583 op = "udiv";
584 else if (Ty.isSigned())
585 op = "sdiv";
586 else
587 yyerror("Invalid type for div instruction");
588 else if (opcode == "rem")
589 if (Ty.isFloatingPoint())
590 op = "frem";
591 else if (Ty.isUnsigned())
592 op = "urem";
593 else if (Ty.isSigned())
594 op = "srem";
595 else
596 yyerror("Invalid type for rem instruction");
597 return op;
598}
Reid Spencere7c3c602006-11-30 06:36:44 +0000599
Reid Spencer229e9362006-12-02 22:14:11 +0000600std::string
601getCompareOp(const std::string& setcc, const TypeInfo& TI) {
602 assert(setcc.length() == 5);
603 char cc1 = setcc[3];
604 char cc2 = setcc[4];
605 assert(cc1 == 'e' || cc1 == 'n' || cc1 == 'l' || cc1 == 'g');
606 assert(cc2 == 'q' || cc2 == 'e' || cc2 == 'e' || cc2 == 't');
607 std::string result("xcmp xxx");
608 result[6] = cc1;
609 result[7] = cc2;
610 if (TI.isFloatingPoint()) {
611 result[0] = 'f';
Reid Spencere4d87aa2006-12-23 06:05:41 +0000612 result[5] = 'o';
Reid Spencerf0cf1322006-12-07 04:23:03 +0000613 if (cc1 == 'n')
614 result[5] = 'u'; // NE maps to unordered
615 else
616 result[5] = 'o'; // everything else maps to ordered
Reid Spencer229e9362006-12-02 22:14:11 +0000617 } else if (TI.isIntegral() || TI.isPointer()) {
618 result[0] = 'i';
619 if ((cc1 == 'e' && cc2 == 'q') || (cc1 == 'n' && cc2 == 'e'))
620 result.erase(5,1);
621 else if (TI.isSigned())
622 result[5] = 's';
Reid Spencer3e5ab8c2006-12-06 06:25:46 +0000623 else if (TI.isUnsigned() || TI.isPointer() || TI.isBool())
Reid Spencer229e9362006-12-02 22:14:11 +0000624 result[5] = 'u';
625 else
626 yyerror("Invalid integral type for setcc");
627 }
628 return result;
629}
630
631
Jim Laskey2792cfb2006-12-06 11:03:10 +0000632
633/* Enabling traces. */
634#ifndef YYDEBUG
635# define YYDEBUG 0
636#endif
637
638/* Enabling verbose error messages. */
639#ifdef YYERROR_VERBOSE
640# undef YYERROR_VERBOSE
641# define YYERROR_VERBOSE 1
642#else
643# define YYERROR_VERBOSE 0
644#endif
645
646/* Enabling the token table. */
647#ifndef YYTOKEN_TABLE
648# define YYTOKEN_TABLE 0
649#endif
650
651#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000652#line 275 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +0000653typedef union YYSTYPE {
Reid Spencere77e35e2006-12-01 20:26:20 +0000654 std::string* String;
655 TypeInfo Type;
656 ValueInfo Value;
657 ConstInfo Const;
Reid Spencerf8483652006-12-02 15:16:01 +0000658 ValueList* ValList;
Reid Spencere77e35e2006-12-01 20:26:20 +0000659} YYSTYPE;
Jim Laskey2792cfb2006-12-06 11:03:10 +0000660/* Line 196 of yacc.c. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000661#line 662 "UpgradeParser.tab.c"
Jim Laskey2792cfb2006-12-06 11:03:10 +0000662# define yystype YYSTYPE /* obsolescent; will be withdrawn */
663# define YYSTYPE_IS_DECLARED 1
664# define YYSTYPE_IS_TRIVIAL 1
Reid Spencere7c3c602006-11-30 06:36:44 +0000665#endif
666
667
668
Jim Laskey2792cfb2006-12-06 11:03:10 +0000669/* Copy the second part of user declarations. */
Reid Spencere7c3c602006-11-30 06:36:44 +0000670
671
Jim Laskey2792cfb2006-12-06 11:03:10 +0000672/* Line 219 of yacc.c. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000673#line 674 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +0000674
Jim Laskey2792cfb2006-12-06 11:03:10 +0000675#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
676# define YYSIZE_T __SIZE_TYPE__
677#endif
678#if ! defined (YYSIZE_T) && defined (size_t)
679# define YYSIZE_T size_t
680#endif
681#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
682# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
683# define YYSIZE_T size_t
684#endif
685#if ! defined (YYSIZE_T)
686# define YYSIZE_T unsigned int
687#endif
Reid Spencere7c3c602006-11-30 06:36:44 +0000688
Jim Laskey2792cfb2006-12-06 11:03:10 +0000689#ifndef YY_
690# if YYENABLE_NLS
691# if ENABLE_NLS
692# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
693# define YY_(msgid) dgettext ("bison-runtime", msgid)
694# endif
695# endif
696# ifndef YY_
697# define YY_(msgid) msgid
698# endif
699#endif
700
701#if ! defined (yyoverflow) || YYERROR_VERBOSE
702
703/* The parser invokes alloca or malloc; define the necessary symbols. */
704
705# ifdef YYSTACK_USE_ALLOCA
706# if YYSTACK_USE_ALLOCA
707# ifdef __GNUC__
708# define YYSTACK_ALLOC __builtin_alloca
709# else
710# define YYSTACK_ALLOC alloca
711# if defined (__STDC__) || defined (__cplusplus)
712# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
713# define YYINCLUDED_STDLIB_H
714# endif
715# endif
716# endif
717# endif
718
719# ifdef YYSTACK_ALLOC
720 /* Pacify GCC's `empty if-body' warning. */
721# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
722# ifndef YYSTACK_ALLOC_MAXIMUM
723 /* The OS might guarantee only one guard page at the bottom of the stack,
724 and a page size can be as small as 4096 bytes. So we cannot safely
725 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
726 to allow for a few compiler-allocated temporary stack slots. */
727# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
728# endif
729# else
730# define YYSTACK_ALLOC YYMALLOC
731# define YYSTACK_FREE YYFREE
732# ifndef YYSTACK_ALLOC_MAXIMUM
733# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
734# endif
735# ifdef __cplusplus
736extern "C" {
737# endif
738# ifndef YYMALLOC
739# define YYMALLOC malloc
740# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
741 && (defined (__STDC__) || defined (__cplusplus)))
742void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
743# endif
744# endif
745# ifndef YYFREE
746# define YYFREE free
747# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
748 && (defined (__STDC__) || defined (__cplusplus)))
749void free (void *); /* INFRINGES ON USER NAME SPACE */
750# endif
751# endif
752# ifdef __cplusplus
753}
754# endif
755# endif
756#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
757
758
759#if (! defined (yyoverflow) \
760 && (! defined (__cplusplus) \
761 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
762
763/* A type that is properly aligned for any stack member. */
764union yyalloc
765{
766 short int yyss;
767 YYSTYPE yyvs;
768 };
769
770/* The size of the maximum gap between one aligned stack and the next. */
771# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
772
773/* The size of an array large to enough to hold all stacks, each with
774 N elements. */
775# define YYSTACK_BYTES(N) \
776 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
777 + YYSTACK_GAP_MAXIMUM)
778
779/* Copy COUNT objects from FROM to TO. The source and destination do
780 not overlap. */
781# ifndef YYCOPY
782# if defined (__GNUC__) && 1 < __GNUC__
783# define YYCOPY(To, From, Count) \
784 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
785# else
786# define YYCOPY(To, From, Count) \
787 do \
788 { \
789 YYSIZE_T yyi; \
790 for (yyi = 0; yyi < (Count); yyi++) \
791 (To)[yyi] = (From)[yyi]; \
792 } \
793 while (0)
794# endif
795# endif
796
797/* Relocate STACK from its old location to the new one. The
798 local variables YYSIZE and YYSTACKSIZE give the old and new number of
799 elements in the stack, and YYPTR gives the new location of the
800 stack. Advance YYPTR to a properly aligned location for the next
801 stack. */
802# define YYSTACK_RELOCATE(Stack) \
803 do \
804 { \
805 YYSIZE_T yynewbytes; \
806 YYCOPY (&yyptr->Stack, Stack, yysize); \
807 Stack = &yyptr->Stack; \
808 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
809 yyptr += yynewbytes / sizeof (*yyptr); \
810 } \
811 while (0)
Reid Spencere7c3c602006-11-30 06:36:44 +0000812
813#endif
814
Jim Laskey2792cfb2006-12-06 11:03:10 +0000815#if defined (__STDC__) || defined (__cplusplus)
816 typedef signed char yysigned_char;
Reid Spencere7c3c602006-11-30 06:36:44 +0000817#else
Jim Laskey2792cfb2006-12-06 11:03:10 +0000818 typedef short int yysigned_char;
Reid Spencere7c3c602006-11-30 06:36:44 +0000819#endif
820
Jim Laskey2792cfb2006-12-06 11:03:10 +0000821/* YYFINAL -- State number of the termination state. */
822#define YYFINAL 4
823/* YYLAST -- Last index in YYTABLE. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000824#define YYLAST 1554
Jim Laskey2792cfb2006-12-06 11:03:10 +0000825
826/* YYNTOKENS -- Number of terminals. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000827#define YYNTOKENS 166
Jim Laskey2792cfb2006-12-06 11:03:10 +0000828/* YYNNTS -- Number of nonterminals. */
829#define YYNNTS 75
830/* YYNRULES -- Number of rules. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000831#define YYNRULES 302
Jim Laskey2792cfb2006-12-06 11:03:10 +0000832/* YYNRULES -- Number of states. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000833#define YYNSTATES 590
Jim Laskey2792cfb2006-12-06 11:03:10 +0000834
835/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
836#define YYUNDEFTOK 2
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000837#define YYMAXUTOK 406
Jim Laskey2792cfb2006-12-06 11:03:10 +0000838
839#define YYTRANSLATE(YYX) \
840 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
841
842/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
843static const unsigned char yytranslate[] =
844{
845 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
846 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
847 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
848 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000849 155, 156, 164, 2, 153, 2, 2, 2, 2, 2,
Jim Laskey2792cfb2006-12-06 11:03:10 +0000850 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000851 160, 152, 161, 2, 2, 2, 2, 2, 2, 2,
Jim Laskey2792cfb2006-12-06 11:03:10 +0000852 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
853 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000854 2, 157, 154, 159, 2, 2, 2, 2, 2, 165,
Jim Laskey2792cfb2006-12-06 11:03:10 +0000855 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
856 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000857 158, 2, 2, 162, 2, 163, 2, 2, 2, 2,
Jim Laskey2792cfb2006-12-06 11:03:10 +0000858 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
859 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
860 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
861 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
862 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
863 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
864 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
865 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
866 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
867 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
868 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
869 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
870 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
871 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
872 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
873 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
874 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
875 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
876 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
877 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
878 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
879 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
880 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
881 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
882 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
883 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
884 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000885 145, 146, 147, 148, 149, 150, 151
Jim Laskey2792cfb2006-12-06 11:03:10 +0000886};
887
888#if YYDEBUG
889/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
890 YYRHS. */
891static const unsigned short int yyprhs[] =
892{
893 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
894 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
895 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
896 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
897 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
898 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
899 119, 121, 123, 125, 127, 129, 131, 133, 135, 137,
900 139, 141, 143, 145, 147, 149, 151, 153, 155, 157,
901 159, 161, 164, 165, 167, 169, 171, 173, 175, 177,
902 179, 180, 182, 184, 186, 188, 190, 192, 195, 196,
903 197, 200, 201, 205, 208, 209, 211, 212, 216, 218,
904 221, 223, 225, 227, 229, 231, 233, 235, 237, 239,
905 241, 243, 245, 247, 249, 251, 253, 255, 257, 259,
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000906 261, 264, 269, 275, 281, 285, 288, 294, 299, 302,
907 304, 308, 310, 314, 316, 317, 322, 326, 330, 335,
908 340, 344, 347, 350, 353, 356, 359, 362, 365, 368,
909 371, 374, 381, 387, 396, 403, 410, 417, 425, 433,
910 440, 447, 456, 465, 469, 471, 473, 475, 477, 480,
911 483, 488, 491, 493, 495, 497, 502, 505, 510, 517,
912 524, 531, 538, 542, 547, 548, 550, 552, 554, 558,
913 562, 566, 570, 574, 578, 580, 581, 583, 585, 587,
914 588, 591, 595, 597, 599, 603, 605, 606, 615, 617,
915 619, 623, 628, 630, 632, 636, 637, 639, 641, 645,
916 646, 648, 650, 652, 654, 656, 658, 660, 662, 664,
917 668, 670, 676, 678, 680, 682, 684, 687, 690, 692,
918 695, 698, 699, 701, 703, 705, 708, 711, 715, 725,
919 735, 744, 759, 761, 763, 770, 776, 779, 786, 794,
920 796, 800, 802, 803, 806, 808, 814, 820, 826, 833,
921 840, 843, 848, 853, 860, 865, 870, 877, 884, 887,
922 895, 897, 900, 901, 903, 904, 908, 915, 919, 926,
923 929, 934, 941
Jim Laskey2792cfb2006-12-06 11:03:10 +0000924};
925
926/* YYRHS -- A `-1'-separated list of the rules' RHS. */
927static const short int yyrhs[] =
928{
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000929 200, 0, -1, 19, -1, 20, -1, 17, -1, 18,
930 -1, 81, -1, 82, -1, 83, -1, 84, -1, 85,
931 -1, 86, -1, 87, -1, 88, -1, 89, -1, 90,
932 -1, 91, -1, 92, -1, 93, -1, 94, -1, 95,
933 -1, 96, -1, 97, -1, 98, -1, 99, -1, 100,
934 -1, 103, -1, 104, -1, 105, -1, 106, -1, 107,
935 -1, 108, -1, 119, -1, 120, -1, 121, -1, 122,
936 -1, 109, -1, 110, -1, 111, -1, 112, -1, 113,
937 -1, 114, -1, 115, -1, 116, -1, 117, -1, 118,
938 -1, 119, -1, 120, -1, 121, -1, 122, -1, 25,
939 -1, 26, -1, 131, -1, 132, -1, 133, -1, 134,
940 -1, 140, -1, 141, -1, 142, -1, 143, -1, 144,
941 -1, 145, -1, 146, -1, 147, -1, 148, -1, 149,
942 -1, 150, -1, 151, -1, 139, -1, 11, -1, 9,
Jim Laskey2792cfb2006-12-06 11:03:10 +0000943 -1, 7, -1, 5, -1, 12, -1, 10, -1, 8,
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000944 -1, 6, -1, 176, -1, 177, -1, 13, -1, 14,
945 -1, 209, 152, -1, -1, 43, -1, 44, -1, 45,
946 -1, 49, -1, 46, -1, 47, -1, 48, -1, -1,
947 67, -1, 68, -1, 69, -1, 70, -1, 71, -1,
948 72, -1, 66, 18, -1, -1, -1, 58, 18, -1,
949 -1, 153, 58, 18, -1, 38, 30, -1, -1, 185,
950 -1, -1, 153, 188, 187, -1, 185, -1, 58, 18,
951 -1, 191, -1, 3, -1, 193, -1, 3, -1, 193,
Jim Laskey2792cfb2006-12-06 11:03:10 +0000952 -1, 4, -1, 5, -1, 6, -1, 7, -1, 8,
953 -1, 9, -1, 10, -1, 11, -1, 12, -1, 13,
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000954 -1, 14, -1, 15, -1, 16, -1, 223, -1, 192,
955 -1, 154, 18, -1, 190, 155, 195, 156, -1, 157,
956 18, 158, 193, 159, -1, 160, 18, 158, 193, 161,
957 -1, 162, 194, 163, -1, 162, 163, -1, 160, 162,
958 194, 163, 161, -1, 160, 162, 163, 161, -1, 193,
959 164, -1, 193, -1, 194, 153, 193, -1, 194, -1,
960 194, 153, 41, -1, 41, -1, -1, 191, 157, 198,
961 159, -1, 191, 157, 159, -1, 191, 165, 30, -1,
962 191, 160, 198, 161, -1, 191, 162, 198, 163, -1,
963 191, 162, 163, -1, 191, 22, -1, 191, 23, -1,
964 191, 223, -1, 191, 197, -1, 191, 24, -1, 176,
965 168, -1, 177, 18, -1, 4, 25, -1, 4, 26,
966 -1, 179, 21, -1, 175, 155, 196, 40, 191, 156,
967 -1, 128, 155, 196, 238, 156, -1, 130, 155, 196,
968 153, 196, 153, 196, 156, -1, 169, 155, 196, 153,
969 196, 156, -1, 170, 155, 196, 153, 196, 156, -1,
970 171, 155, 196, 153, 196, 156, -1, 101, 172, 155,
971 196, 153, 196, 156, -1, 102, 173, 155, 196, 153,
972 196, 156, -1, 174, 155, 196, 153, 196, 156, -1,
973 136, 155, 196, 153, 196, 156, -1, 137, 155, 196,
974 153, 196, 153, 196, 156, -1, 138, 155, 196, 153,
975 196, 153, 196, 156, -1, 198, 153, 196, -1, 196,
976 -1, 36, -1, 37, -1, 201, -1, 201, 218, -1,
977 201, 220, -1, 201, 64, 63, 204, -1, 201, 31,
978 -1, 203, -1, 51, -1, 59, -1, 203, 180, 27,
979 189, -1, 203, 220, -1, 203, 64, 63, 204, -1,
980 203, 180, 181, 199, 196, 187, -1, 203, 180, 202,
981 199, 191, 187, -1, 203, 180, 46, 199, 191, 187,
982 -1, 203, 180, 48, 199, 191, 187, -1, 203, 52,
983 206, -1, 203, 60, 152, 207, -1, -1, 30, -1,
984 57, -1, 56, -1, 54, 152, 205, -1, 55, 152,
985 18, -1, 53, 152, 30, -1, 73, 152, 30, -1,
986 157, 208, 159, -1, 208, 153, 30, -1, 30, -1,
987 -1, 28, -1, 30, -1, 209, -1, -1, 191, 210,
988 -1, 212, 153, 211, -1, 211, -1, 212, -1, 212,
989 153, 41, -1, 41, -1, -1, 182, 189, 209, 155,
990 213, 156, 186, 183, -1, 32, -1, 162, -1, 181,
991 214, 215, -1, 35, 181, 214, 215, -1, 33, -1,
992 163, -1, 216, 226, 217, -1, -1, 46, -1, 48,
993 -1, 34, 219, 214, -1, -1, 65, -1, 17, -1,
994 18, -1, 21, -1, 25, -1, 26, -1, 22, -1,
995 23, -1, 24, -1, 160, 198, 161, -1, 197, -1,
996 63, 221, 30, 153, 30, -1, 167, -1, 209, -1,
997 223, -1, 222, -1, 191, 224, -1, 226, 227, -1,
998 227, -1, 228, 230, -1, 228, 232, -1, -1, 29,
999 -1, 79, -1, 78, -1, 74, 225, -1, 74, 3,
1000 -1, 75, 15, 224, -1, 75, 4, 224, 153, 15,
1001 224, 153, 15, 224, -1, 76, 178, 224, 153, 15,
1002 224, 157, 231, 159, -1, 76, 178, 224, 153, 15,
1003 224, 157, 159, -1, 180, 77, 182, 189, 224, 155,
1004 235, 156, 40, 15, 224, 229, 15, 224, -1, 229,
1005 -1, 80, -1, 231, 178, 222, 153, 15, 224, -1,
1006 178, 222, 153, 15, 224, -1, 180, 237, -1, 191,
1007 157, 224, 153, 224, 159, -1, 233, 153, 157, 224,
1008 153, 224, 159, -1, 225, -1, 234, 153, 225, -1,
1009 234, -1, -1, 62, 61, -1, 61, -1, 169, 191,
1010 224, 153, 224, -1, 170, 191, 224, 153, 224, -1,
1011 171, 191, 224, 153, 224, -1, 101, 172, 191, 224,
1012 153, 224, -1, 102, 173, 191, 224, 153, 224, -1,
1013 50, 225, -1, 174, 225, 153, 225, -1, 175, 225,
1014 40, 191, -1, 130, 225, 153, 225, 153, 225, -1,
1015 135, 225, 153, 191, -1, 136, 225, 153, 225, -1,
1016 137, 225, 153, 225, 153, 225, -1, 138, 225, 153,
1017 225, 153, 225, -1, 129, 233, -1, 236, 182, 189,
1018 224, 155, 235, 156, -1, 240, -1, 153, 234, -1,
1019 -1, 39, -1, -1, 123, 191, 184, -1, 123, 191,
1020 153, 10, 224, 184, -1, 124, 191, 184, -1, 124,
1021 191, 153, 10, 224, 184, -1, 125, 225, -1, 239,
1022 126, 191, 224, -1, 239, 127, 225, 153, 191, 224,
1023 -1, 128, 191, 224, 238, -1
Jim Laskey2792cfb2006-12-06 11:03:10 +00001024};
1025
1026/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1027static const unsigned short int yyrline[] =
1028{
Reid Spencere4d87aa2006-12-23 06:05:41 +00001029 0, 338, 338, 338, 339, 339, 343, 343, 343, 343,
1030 343, 343, 343, 344, 344, 344, 344, 345, 345, 345,
1031 346, 346, 346, 346, 346, 346, 347, 347, 347, 347,
1032 347, 347, 347, 347, 347, 347, 348, 348, 348, 348,
1033 348, 348, 348, 348, 348, 348, 349, 349, 349, 349,
1034 349, 349, 350, 350, 350, 350, 351, 351, 351, 351,
1035 351, 351, 351, 352, 352, 352, 352, 352, 352, 357,
1036 357, 357, 357, 358, 358, 358, 358, 359, 359, 360,
1037 360, 363, 366, 371, 371, 371, 371, 371, 371, 372,
1038 373, 376, 376, 376, 376, 376, 377, 378, 383, 388,
1039 389, 392, 393, 401, 407, 408, 411, 412, 421, 422,
1040 435, 435, 436, 436, 437, 441, 441, 441, 441, 441,
1041 441, 441, 442, 442, 442, 442, 442, 444, 448, 452,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001042 455, 460, 466, 474, 482, 488, 492, 498, 502, 513,
1043 516, 524, 525, 530, 533, 543, 549, 554, 560, 566,
1044 572, 577, 583, 589, 595, 601, 607, 613, 619, 625,
1045 631, 639, 653, 665, 670, 676, 681, 687, 692, 697,
1046 705, 710, 715, 725, 730, 735, 735, 745, 750, 753,
1047 758, 762, 766, 768, 768, 771, 783, 788, 793, 802,
1048 811, 820, 829, 834, 839, 844, 846, 846, 849, 854,
1049 861, 866, 873, 880, 885, 886, 894, 894, 895, 895,
1050 897, 904, 908, 912, 915, 920, 923, 925, 945, 946,
1051 949, 958, 969, 970, 972, 980, 981, 982, 986, 999,
1052 1000, 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1004, 1005,
1053 1010, 1011, 1020, 1020, 1024, 1030, 1041, 1047, 1050, 1058,
1054 1062, 1067, 1070, 1076, 1076, 1078, 1083, 1088, 1093, 1101,
1055 1108, 1114, 1134, 1139, 1145, 1150, 1158, 1167, 1174, 1182,
1056 1186, 1193, 1194, 1198, 1203, 1206, 1212, 1217, 1223, 1228,
1057 1233, 1238, 1246, 1260, 1265, 1270, 1275, 1280, 1285, 1290,
1058 1307, 1312, 1313, 1317, 1318, 1321, 1328, 1335, 1342, 1349,
1059 1354, 1361, 1368
Jim Laskey2792cfb2006-12-06 11:03:10 +00001060};
1061#endif
1062
1063#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1064/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1065 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1066static const char *const yytname[] =
1067{
1068 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
1069 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
1070 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
1071 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
1072 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001073 "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL", "CONSTANT",
1074 "SECTION", "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL",
1075 "LINKONCE", "WEAK", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING",
1076 "NOT", "EXTERNAL", "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE",
1077 "BIG", "ALIGN", "UNINITIALIZED", "DEPLIBS", "CALL", "TAIL", "ASM_TOK",
1078 "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
Jim Laskey2792cfb2006-12-06 11:03:10 +00001079 "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1080 "RET", "BR", "SWITCH", "INVOKE", "EXCEPT", "UNWIND", "UNREACHABLE",
1081 "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
1082 "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
1083 "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1084 "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
1085 "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1086 "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
1087 "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
1088 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
1089 "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
1090 "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1091 "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
1092 "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
1093 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
1094 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
1095 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
1096 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
1097 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1098 "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
1099 "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
1100 "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
1101 "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
1102 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1103 "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock",
1104 "InstructionList", "Unwind", "BBTerminatorInst", "JumpTable", "Inst",
1105 "PHIList", "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal",
1106 "IndexList", "OptVolatile", "MemoryInst", 0
1107};
1108#endif
1109
1110# ifdef YYPRINT
1111/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1112 token YYLEX-NUM. */
1113static const unsigned short int yytoknum[] =
1114{
1115 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1116 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1117 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1118 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1119 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1120 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1121 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1122 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1123 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1124 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1125 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1126 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1127 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1128 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1129 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001130 405, 406, 61, 44, 92, 40, 41, 91, 120, 93,
1131 60, 62, 123, 125, 42, 99
Jim Laskey2792cfb2006-12-06 11:03:10 +00001132};
1133# endif
1134
1135/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1136static const unsigned char yyr1[] =
1137{
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001138 0, 166, 167, 167, 168, 168, 169, 169, 169, 169,
1139 169, 169, 169, 169, 169, 169, 169, 170, 170, 170,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001140 171, 171, 171, 171, 171, 171, 172, 172, 172, 172,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001141 172, 172, 172, 172, 172, 172, 173, 173, 173, 173,
1142 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
1143 173, 173, 174, 174, 174, 174, 175, 175, 175, 175,
1144 175, 175, 175, 175, 175, 175, 175, 175, 175, 176,
1145 176, 176, 176, 177, 177, 177, 177, 178, 178, 179,
1146 179, 180, 180, 181, 181, 181, 181, 181, 181, 181,
1147 181, 182, 182, 182, 182, 182, 182, 182, 182, 183,
1148 183, 184, 184, 185, 186, 186, 187, 187, 188, 188,
1149 189, 189, 190, 190, 191, 192, 192, 192, 192, 192,
1150 192, 192, 192, 192, 192, 192, 192, 193, 193, 193,
1151 193, 193, 193, 193, 193, 193, 193, 193, 193, 194,
1152 194, 195, 195, 195, 195, 196, 196, 196, 196, 196,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001153 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001154 196, 197, 197, 197, 197, 197, 197, 197, 197, 197,
1155 197, 197, 197, 198, 198, 199, 199, 200, 201, 201,
1156 201, 201, 201, 202, 202, 203, 203, 203, 203, 203,
1157 203, 203, 203, 203, 203, 204, 205, 205, 206, 206,
1158 206, 206, 207, 208, 208, 208, 209, 209, 210, 210,
1159 211, 212, 212, 213, 213, 213, 213, 214, 215, 215,
1160 216, 216, 217, 217, 218, 219, 219, 219, 220, 221,
1161 221, 222, 222, 222, 222, 222, 222, 222, 222, 222,
1162 222, 222, 223, 223, 224, 224, 225, 226, 226, 227,
1163 228, 228, 228, 229, 229, 230, 230, 230, 230, 230,
1164 230, 230, 230, 230, 231, 231, 232, 233, 233, 234,
1165 234, 235, 235, 236, 236, 237, 237, 237, 237, 237,
1166 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
1167 237, 238, 238, 239, 239, 240, 240, 240, 240, 240,
1168 240, 240, 240
Jim Laskey2792cfb2006-12-06 11:03:10 +00001169};
1170
1171/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1172static const unsigned char yyr2[] =
1173{
1174 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1175 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1176 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1177 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1178 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1179 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1180 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1181 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1182 1, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1183 0, 1, 1, 1, 1, 1, 1, 2, 0, 0,
1184 2, 0, 3, 2, 0, 1, 0, 3, 1, 2,
1185 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1186 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001187 2, 4, 5, 5, 3, 2, 5, 4, 2, 1,
1188 3, 1, 3, 1, 0, 4, 3, 3, 4, 4,
1189 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1190 2, 6, 5, 8, 6, 6, 6, 7, 7, 6,
1191 6, 8, 8, 3, 1, 1, 1, 1, 2, 2,
1192 4, 2, 1, 1, 1, 4, 2, 4, 6, 6,
1193 6, 6, 3, 4, 0, 1, 1, 1, 3, 3,
1194 3, 3, 3, 3, 1, 0, 1, 1, 1, 0,
1195 2, 3, 1, 1, 3, 1, 0, 8, 1, 1,
1196 3, 4, 1, 1, 3, 0, 1, 1, 3, 0,
1197 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
1198 1, 5, 1, 1, 1, 1, 2, 2, 1, 2,
1199 2, 0, 1, 1, 1, 2, 2, 3, 9, 9,
1200 8, 14, 1, 1, 6, 5, 2, 6, 7, 1,
1201 3, 1, 0, 2, 1, 5, 5, 5, 6, 6,
1202 2, 4, 4, 6, 4, 4, 6, 6, 2, 7,
1203 1, 2, 0, 1, 0, 3, 6, 3, 6, 2,
1204 4, 6, 4
Jim Laskey2792cfb2006-12-06 11:03:10 +00001205};
1206
1207/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1208 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1209 means the default is an error. */
1210static const unsigned short int yydefact[] =
1211{
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001212 194, 0, 90, 182, 1, 181, 225, 90, 83, 84,
1213 85, 87, 88, 89, 86, 0, 98, 251, 178, 179,
1214 206, 207, 0, 0, 0, 90, 0, 186, 226, 227,
1215 98, 98, 0, 0, 91, 92, 93, 94, 95, 96,
1216 0, 0, 252, 251, 248, 82, 0, 0, 0, 0,
1217 192, 0, 0, 0, 0, 0, 183, 184, 0, 0,
1218 81, 228, 0, 195, 180, 97, 111, 115, 116, 117,
1219 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
1220 2, 3, 0, 0, 0, 0, 242, 0, 0, 110,
1221 129, 114, 243, 128, 218, 219, 220, 222, 223, 224,
1222 247, 0, 0, 0, 254, 253, 263, 294, 262, 249,
1223 250, 0, 0, 0, 0, 205, 193, 187, 185, 175,
1224 176, 0, 0, 0, 0, 221, 130, 0, 0, 0,
1225 113, 135, 139, 0, 0, 144, 138, 256, 0, 255,
1226 0, 0, 72, 76, 71, 75, 70, 74, 69, 73,
1227 77, 78, 0, 293, 0, 274, 0, 98, 6, 7,
1228 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
1229 18, 19, 20, 21, 22, 23, 24, 25, 0, 0,
1230 0, 0, 0, 0, 0, 0, 52, 53, 54, 55,
1231 0, 0, 0, 0, 68, 56, 57, 58, 59, 60,
1232 61, 62, 63, 64, 65, 66, 67, 0, 0, 0,
1233 0, 0, 98, 266, 0, 290, 200, 197, 196, 198,
1234 199, 201, 204, 0, 106, 106, 115, 116, 117, 118,
1235 119, 120, 121, 122, 123, 124, 125, 0, 0, 0,
1236 0, 106, 106, 0, 0, 0, 0, 0, 134, 216,
1237 143, 141, 0, 231, 232, 233, 236, 237, 238, 234,
1238 235, 229, 0, 0, 0, 0, 0, 0, 0, 0,
1239 0, 0, 0, 0, 0, 240, 245, 244, 246, 0,
1240 257, 0, 280, 273, 0, 26, 27, 28, 29, 30,
1241 31, 32, 33, 34, 35, 0, 50, 51, 36, 37,
1242 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
1243 48, 49, 0, 101, 101, 299, 0, 0, 288, 0,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001244 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001245 0, 0, 0, 202, 0, 190, 191, 158, 159, 4,
1246 5, 156, 157, 160, 151, 152, 155, 0, 0, 0,
1247 0, 154, 153, 188, 189, 112, 112, 137, 0, 140,
1248 215, 209, 212, 213, 0, 0, 131, 230, 0, 0,
1249 0, 0, 0, 0, 0, 0, 174, 0, 0, 0,
1250 0, 0, 0, 0, 0, 0, 0, 0, 0, 295,
1251 0, 297, 292, 0, 0, 0, 0, 0, 0, 0,
1252 0, 0, 0, 0, 0, 0, 0, 0, 203, 0,
1253 0, 108, 106, 146, 0, 0, 150, 0, 147, 132,
1254 133, 136, 208, 210, 0, 104, 142, 0, 0, 0,
1255 292, 0, 0, 0, 0, 0, 239, 0, 0, 0,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001256 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001257 0, 302, 0, 0, 0, 284, 285, 0, 0, 0,
1258 0, 0, 281, 282, 0, 300, 0, 103, 109, 107,
1259 145, 148, 149, 214, 211, 105, 99, 0, 0, 0,
1260 0, 0, 0, 0, 0, 173, 0, 0, 0, 0,
1261 0, 0, 0, 272, 0, 0, 101, 102, 101, 269,
1262 291, 0, 0, 0, 0, 0, 275, 276, 277, 272,
1263 0, 0, 217, 241, 0, 0, 162, 0, 0, 0,
1264 0, 0, 0, 0, 0, 0, 0, 0, 271, 0,
1265 278, 279, 0, 296, 298, 0, 0, 0, 283, 286,
1266 287, 0, 301, 100, 0, 0, 0, 170, 0, 0,
1267 164, 165, 166, 169, 161, 0, 260, 0, 0, 0,
1268 270, 267, 0, 289, 167, 168, 0, 0, 0, 258,
1269 0, 259, 0, 0, 268, 163, 171, 172, 0, 0,
1270 0, 0, 0, 0, 265, 0, 0, 264, 0, 261
Jim Laskey2792cfb2006-12-06 11:03:10 +00001271};
1272
1273/* YYDEFGOTO[NTERM-NUM]. */
1274static const short int yydefgoto[] =
1275{
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001276 -1, 86, 341, 270, 271, 272, 295, 312, 273, 274,
1277 237, 238, 152, 239, 25, 16, 40, 512, 389, 411,
1278 476, 335, 412, 87, 88, 240, 90, 91, 133, 252,
1279 376, 275, 377, 121, 1, 2, 59, 3, 64, 219,
1280 50, 116, 223, 92, 423, 362, 363, 364, 41, 96,
1281 17, 99, 18, 30, 19, 368, 276, 93, 278, 499,
1282 43, 44, 45, 108, 109, 558, 110, 318, 528, 529,
1283 212, 213, 451, 214, 215
Jim Laskey2792cfb2006-12-06 11:03:10 +00001284};
1285
1286/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1287 STATE-NUM. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001288#define YYPACT_NINF -543
Jim Laskey2792cfb2006-12-06 11:03:10 +00001289static const short int yypact[] =
1290{
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001291 -543, 41, 25, 215, -543, -543, 82, 277, -543, -543,
1292 -543, -543, -543, -543, -543, -10, 300, 62, -543, -543,
1293 -543, -543, 22, -95, 57, 78, 30, -543, -543, -543,
1294 300, 300, 156, 170, -543, -543, -543, -543, -543, -543,
1295 887, -26, -543, -17, -543, 37, 39, 42, 46, 48,
1296 -543, 77, 156, 887, 43, 43, -543, -543, 43, 43,
1297 -543, -543, -26, -543, -543, -543, 53, -543, -543, -543,
1298 -543, -543, -543, -543, -543, -543, -543, -543, -543, -543,
1299 -543, -543, 188, 196, -8, 561, -543, 153, 81, -543,
1300 -543, -70, -543, -543, -543, -543, -543, -543, -543, -543,
1301 -543, 924, 13, 307, -543, -543, -543, 1403, -543, -543,
1302 -543, 207, 101, 220, 210, 211, -543, -543, -543, -543,
1303 -543, 969, 969, 1008, 969, -543, -543, 88, 89, 603,
1304 -543, -543, -70, -75, 93, 676, -543, 53, 1201, -543,
1305 1201, 1201, -543, -543, -543, -543, -543, -543, -543, -543,
1306 -543, -543, 1201, -543, 969, -543, 189, 300, -543, -543,
1307 -543, -543, -543, -543, -543, -543, -543, -543, -543, -543,
1308 -543, -543, -543, -543, -543, -543, -543, -543, 58, 109,
1309 969, 969, 969, 969, 969, 969, -543, -543, -543, -543,
1310 969, 969, 969, 969, -543, -543, -543, -543, -543, -543,
1311 -543, -543, -543, -543, -543, -543, -543, 969, 969, 969,
1312 969, 969, 300, -543, -19, -543, -543, -543, -543, -543,
1313 -543, -543, -543, -133, 100, 100, 149, 167, 236, 179,
1314 238, 185, 239, 187, 247, 248, 249, 193, 250, 252,
1315 1052, 100, 100, 969, 969, 110, -66, 969, -543, 723,
1316 -543, 128, 127, -543, -543, -543, -543, -543, -543, -543,
1317 -543, 221, 58, 109, 130, 132, 133, 137, 138, 1008,
1318 140, 143, 144, 145, 146, -543, -543, -543, -543, 151,
1319 -543, 155, -543, -543, 887, -543, -543, -543, -543, -543,
1320 -543, -543, -543, -543, -543, 969, -543, -543, -543, -543,
1321 -543, -543, -543, -543, -543, -543, -543, -543, -543, -543,
1322 -543, -543, 969, 157, 174, -543, 1201, 152, 175, 176,
1323 177, 178, 182, 183, 1201, 1201, 1201, 184, 262, 887,
1324 969, 969, 302, -543, 45, -543, -543, -543, -543, -543,
1325 -543, -543, -543, -543, -543, -543, -543, 764, 1008, 647,
1326 309, -543, -543, -543, -543, -4, -5, -543, 180, -70,
1327 -543, 153, -543, 190, 186, 809, -543, -543, 315, 191,
1328 192, 1008, 1008, 1008, 1008, 1008, -543, -134, 1008, 1008,
1329 1008, 1008, 1008, 333, 334, 1201, 1201, 1201, -3, -543,
1330 8, -543, 200, 1201, 197, 969, 969, 969, 969, 969,
1331 208, 209, 223, 969, 969, 1201, 1201, 224, -543, 348,
1332 361, -543, 100, -543, -21, -57, -543, -61, -543, -543,
1333 -543, -543, -543, -543, 848, 342, -543, 228, 1008, 1008,
1334 200, 229, 230, 234, 235, 1008, -543, 237, 240, 241,
1335 242, 349, 1201, 1201, 243, 244, 246, 1201, 373, 1201,
1336 969, -543, 251, 1201, 253, -543, -543, 254, 255, 1201,
1337 1201, 1201, -543, -543, 245, -543, 969, -543, -543, -543,
1338 -543, -543, -543, -543, -543, -543, 338, 372, 256, 261,
1339 259, 1008, 1008, 1008, 1008, -543, 1008, 1008, 1008, 1008,
1340 969, 263, 260, 969, 1201, 1201, 265, -543, 265, -543,
1341 266, 1201, 267, 969, 969, 969, -543, -543, -543, 969,
1342 1201, 385, -543, -543, 1008, 1008, -543, 268, 273, 269,
1343 270, 274, 275, 276, 281, 282, 390, 28, 266, 283,
1344 -543, -543, 366, -543, -543, 969, 285, 1201, -543, -543,
1345 -543, 284, -543, -543, 289, 291, 1008, -543, 1008, 1008,
1346 -543, -543, -543, -543, -543, 1201, -543, 1290, 40, 393,
1347 -543, -543, 290, -543, -543, -543, 292, 295, 296, -543,
1348 288, -543, 1290, 442, -543, -543, -543, -543, 444, 308,
1349 1201, 1201, 445, 134, -543, 1201, 447, -543, 1201, -543
Jim Laskey2792cfb2006-12-06 11:03:10 +00001350};
1351
1352/* YYPGOTO[NTERM-NUM]. */
1353static const short int yypgoto[] =
1354{
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001355 -543, -543, -543, 359, 360, 363, 206, 212, 367, 370,
1356 -102, -100, -504, -543, 428, 17, -149, -543, -303, 55,
1357 -543, -220, -543, -49, -543, -40, -543, -71, 4, -543,
1358 159, 257, -200, 51, -543, -543, -543, -543, 426, -543,
1359 -543, -543, -543, -1, -543, 59, -543, -543, 202, 419,
1360 -543, -543, -543, -543, 479, -543, -542, -109, 49, -92,
1361 -543, 441, -543, -98, -543, -543, -543, -543, 36, -22,
1362 -543, -543, 60, -543, -543
Jim Laskey2792cfb2006-12-06 11:03:10 +00001363};
1364
1365/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1366 positive, shift that token. If negative, reduce the rule which
1367 number is the opposite. If zero, do what YYDEFACT says.
1368 If YYTABLE_NINF, syntax error. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001369#define YYTABLE_NINF -178
Jim Laskey2792cfb2006-12-06 11:03:10 +00001370static const short int yytable[] =
1371{
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001372 89, 150, 26, 151, 118, 336, 94, 447, 284, 139,
1373 128, 391, 42, 89, 132, 570, 97, 140, 449, 435,
1374 332, 353, 354, 557, 31, -177, 333, 436, 141, 277,
1375 579, 277, 277, 142, 143, 144, 145, 146, 147, 148,
1376 149, 4, 58, 277, 26, 142, 143, 144, 145, 146,
1377 147, 148, 149, 32, 572, 448, 5, 51, 132, 6,
1378 7, 138, 282, 329, 132, 20, 448, 21, 8, 9,
1379 10, 11, 12, 13, 14, 46, 47, 48, 247, 119,
1380 120, 224, 225, 409, 242, -112, 134, 247, 248, 15,
1381 315, 42, 435, 319, 136, 49, 435, 358, 320, 321,
1382 322, 323, 472, 410, 471, 53, 122, 330, 331, 123,
1383 124, 101, 102, 103, 138, 104, 105, 106, 327, 328,
1384 52, 8, 9, 10, 54, 12, 55, 14, 28, 56,
1385 29, 352, 435, 246, 296, 297, 95, 57, 470, 251,
1386 313, 314, 138, 316, 317, 138, 98, 414, 415, 417,
1387 138, 138, 138, 138, 129, 419, 420, 217, 218, 136,
1388 136, 285, 286, 287, 288, 289, 290, 324, 325, 326,
1389 138, 138, 355, 356, 337, 338, 359, 291, 292, 293,
1390 294, 20, 60, 21, -72, -72, 63, 556, 65, 279,
1391 280, 111, 469, 533, 112, 534, -71, -71, 113, 571,
1392 114, 281, -70, -70, -69, -69, 126, 277, -113, 361,
1393 339, 340, 104, 105, 127, 277, 277, 277, 298, 299,
1394 300, 301, 302, 303, 304, 305, 306, 307, 308, 309,
1395 310, 311, 61, 62, 115, 385, 135, 216, 220, 407,
1396 221, 222, -82, 20, 89, 21, 243, 244, 249, 6,
1397 283, -82, -82, 334, -76, 386, -75, -74, -82, -82,
1398 -82, -82, -82, -82, -82, -73, -82, 22, 342, -79,
1399 -80, 357, 387, 343, -82, 23, 277, 277, 277, 24,
1400 405, 365, 241, 366, 277, 371, 367, 372, 373, 89,
1401 406, 138, 374, 375, 359, 378, 277, 277, 379, 380,
1402 381, 382, 404, 454, 383, 456, 457, 458, 384, 393,
1403 388, 462, 142, 143, 144, 145, 146, 147, 148, 149,
1404 8, 9, 10, 11, 12, 13, 14, 390, 394, 395,
1405 396, 397, 408, 277, 277, 398, 399, 403, 277, 418,
1406 277, 421, 425, 424, 277, 427, 428, 429, 442, 443,
1407 277, 277, 277, 450, 453, 138, 455, 138, 138, 138,
1408 422, 459, 460, 138, 463, 392, 33, 34, 35, 36,
1409 37, 38, 39, 400, 401, 402, 461, 466, 467, 468,
1410 409, 477, 481, 482, 361, 277, 277, 483, 484, 490,
1411 486, 497, 277, 487, 488, 489, 511, 494, 493, 495,
1412 509, 277, 513, 543, 501, 555, 503, 504, 505, 514,
1413 138, 538, 539, 540, 515, 516, 526, 527, 532, 535,
1414 537, 546, 548, 549, 448, 150, 510, 151, 277, 547,
1415 550, 551, 552, 573, 444, 445, 446, 553, 554, 559,
1416 563, 578, 452, 560, 561, 564, 277, 565, 575, 574,
1417 525, 576, 577, 138, 464, 465, 150, 580, 151, 581,
1418 585, 582, 588, 138, 138, 138, 207, 208, 369, 138,
1419 209, 277, 277, 107, 210, 370, 277, 211, 117, 277,
1420 475, 125, 27, 474, 100, 586, 500, 541, 0, 0,
1421 480, 491, 492, 0, 0, 138, 496, 351, 498, 0,
1422 0, 0, 502, 0, 0, 0, 0, 0, 506, 507,
1423 508, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001424 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001425 430, 431, 432, 433, 434, 0, 0, 437, 438, 439,
1426 440, 441, 0, 530, 531, 0, 0, 0, 0, 0,
1427 536, 0, 0, 0, 0, 0, 0, 0, 0, 542,
1428 0, 0, 0, 0, 130, 67, 68, 69, 70, 71,
1429 72, 73, 74, 75, 76, 77, 78, 79, 0, 0,
1430 80, 81, 0, 0, 0, 0, 562, 478, 479, 20,
1431 0, 21, 0, 0, 485, 0, 0, 0, 0, 0,
1432 0, 0, 0, 0, 569, 0, 130, 67, 68, 69,
1433 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
1434 0, 0, 80, 81, 0, 0, 0, 0, 0, 583,
1435 584, 20, 0, 21, 587, 0, 0, 589, 0, 0,
1436 517, 518, 519, 520, 0, 521, 522, 523, 524, 0,
1437 130, 226, 227, 228, 229, 230, 231, 232, 233, 234,
1438 235, 236, 78, 79, 0, 0, 80, 81, 0, 0,
1439 0, 0, 0, 544, 545, 20, 0, 21, 0, 130,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001440 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001441 77, 78, 79, 0, 0, 80, 81, 0, 0, 0,
1442 0, 0, 0, 0, 20, 566, 21, 567, 568, 0,
1443 0, 0, 0, 0, 0, 82, 0, 250, 83, 0,
1444 0, 84, 0, 85, 131, 0, 130, 67, 68, 69,
1445 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
1446 0, 0, 80, 81, 0, 0, 0, 0, 0, 0,
1447 0, 20, 0, 21, 0, 0, 0, 82, 0, 0,
1448 83, 0, 0, 84, 360, 85, 245, 130, 226, 227,
1449 228, 229, 230, 231, 232, 233, 234, 235, 236, 78,
1450 79, 0, 0, 80, 81, 0, 0, 0, 0, 0,
1451 0, 0, 20, 0, 21, 0, 0, 0, 0, 0,
1452 0, 82, 0, 0, 83, 0, 0, 84, 0, 85,
1453 416, 0, 130, 67, 68, 69, 70, 71, 72, 73,
1454 74, 75, 76, 77, 78, 79, 0, 0, 80, 81,
1455 82, 0, 0, 83, 0, 0, 84, 20, 85, 21,
1456 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1457 426, 130, 67, 68, 69, 70, 71, 72, 73, 74,
1458 75, 76, 77, 78, 79, 0, 0, 80, 81, 0,
1459 0, 0, 0, 0, 0, 0, 20, 82, 21, 0,
1460 83, 0, 0, 84, 0, 85, 0, 0, 0, 473,
1461 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1462 76, 77, 78, 79, 0, 0, 80, 81, 0, 0,
1463 0, 0, 0, 0, 0, 20, 0, 21, 82, 0,
1464 0, 83, 0, 413, 84, 0, 85, 137, 67, 68,
1465 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
1466 79, 0, 0, 80, 81, 0, 0, 0, 0, 0,
1467 0, 0, 20, 0, 21, 0, 0, 0, 0, 0,
1468 0, 0, 0, 82, 0, 0, 83, 0, 0, 84,
1469 0, 85, 130, 67, 68, 69, 70, 71, 72, 73,
1470 74, 75, 76, 77, 78, 79, 0, 0, 80, 81,
1471 0, 0, 0, 0, 0, 0, 0, 20, 0, 21,
1472 0, 0, 82, 0, 0, 83, 0, 0, 84, 0,
1473 85, 130, 226, 227, 228, 229, 230, 231, 232, 233,
1474 234, 235, 236, 78, 79, 0, 0, 80, 81, 0,
1475 0, 0, 0, 0, 0, 0, 20, 0, 21, 0,
1476 0, 82, 0, 0, 83, 0, 0, 84, 0, 85,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001477 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1478 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001479 0, 80, 81, 0, 344, 345, 346, 0, 82, 0,
1480 20, 83, 21, 0, 84, 0, 85, 0, 0, 0,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001481 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1482 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001483 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001484 0, 0, 0, 82, 0, 0, 83, 0, 0, 84,
1485 0, 85, 0, 158, 159, 160, 161, 162, 163, 164,
1486 165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
1487 175, 176, 177, 262, 263, 0, 0, 0, 0, 0,
1488 0, 0, 82, 0, 0, 83, 0, 0, 84, 0,
1489 85, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1490 264, 0, 265, 186, 187, 188, 189, 0, 266, 267,
1491 268, 194, 195, 196, 197, 198, 199, 200, 201, 202,
1492 203, 204, 205, 206, 0, 0, 0, 0, 0, 347,
1493 0, 0, 348, 0, 349, 0, 0, 350, 253, 254,
1494 80, 81, 255, 256, 257, 258, 259, 260, 0, 20,
1495 0, 21, 0, 0, 0, 0, 0, 0, 0, 0,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001496 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001497 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1498 0, 0, 0, 0, 261, 0, 0, 0, 0, 0,
1499 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1500 0, 0, 158, 159, 160, 161, 162, 163, 164, 165,
1501 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
1502 176, 177, 262, 263, 0, 0, 0, 253, 254, 0,
1503 0, 255, 256, 257, 258, 259, 260, 0, 0, 0,
1504 0, 0, 0, 0, 0, 0, 0, 0, 0, 264,
1505 0, 265, 186, 187, 188, 189, 0, 266, 267, 268,
1506 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
1507 204, 205, 206, 261, 0, 0, 0, 0, 0, 0,
1508 0, 269, 0, 0, 0, 0, 0, 0, 0, 0,
1509 0, 158, 159, 160, 161, 162, 163, 164, 165, 166,
1510 167, 168, 169, 170, 171, 172, 173, 174, 175, 176,
1511 177, 262, 263, 0, 0, 0, 0, 0, 0, 0,
1512 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1513 0, 0, 0, 0, 0, 0, 0, 0, 264, 0,
1514 265, 186, 187, 188, 189, 0, 266, 267, 268, 194,
1515 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
1516 205, 206, 153, 0, 0, 0, 0, 0, 0, 0,
1517 269, 0, 0, 154, 0, 0, 0, 0, 0, 0,
1518 0, 0, 0, 0, 155, 156, 0, 0, 0, 0,
1519 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1520 157, 0, 0, 0, 158, 159, 160, 161, 162, 163,
1521 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
1522 174, 175, 176, 177, 178, 179, 0, 0, 0, 0,
1523 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1524 0, 0, 0, 0, 0, 0, 180, 181, 182, 0,
1525 0, 183, 184, 185, 186, 187, 188, 189, 190, 191,
1526 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
1527 202, 203, 204, 205, 206
Jim Laskey2792cfb2006-12-06 11:03:10 +00001528};
1529
1530static const short int yycheck[] =
1531{
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001532 40, 103, 3, 103, 53, 225, 32, 10, 157, 101,
1533 18, 314, 29, 53, 85, 557, 33, 4, 10, 153,
1534 153, 241, 242, 527, 7, 0, 159, 161, 15, 138,
1535 572, 140, 141, 5, 6, 7, 8, 9, 10, 11,
1536 12, 0, 25, 152, 45, 5, 6, 7, 8, 9,
1537 10, 11, 12, 63, 558, 58, 31, 152, 129, 34,
1538 35, 101, 154, 212, 135, 28, 58, 30, 43, 44,
1539 45, 46, 47, 48, 49, 53, 54, 55, 153, 36,
1540 37, 121, 122, 38, 124, 155, 87, 153, 163, 64,
1541 182, 29, 153, 185, 164, 73, 153, 163, 190, 191,
1542 192, 193, 163, 58, 161, 27, 55, 126, 127, 58,
1543 59, 74, 75, 76, 154, 78, 79, 80, 210, 211,
1544 63, 43, 44, 45, 46, 47, 48, 49, 46, 51,
1545 48, 240, 153, 129, 25, 26, 162, 59, 159, 135,
1546 180, 181, 182, 183, 184, 185, 163, 347, 348, 349,
1547 190, 191, 192, 193, 162, 159, 161, 56, 57, 164,
1548 164, 103, 104, 105, 106, 107, 108, 207, 208, 209,
1549 210, 211, 243, 244, 25, 26, 247, 119, 120, 121,
1550 122, 28, 152, 30, 17, 18, 30, 159, 18, 140,
1551 141, 152, 412, 496, 152, 498, 17, 18, 152, 159,
1552 152, 152, 17, 18, 17, 18, 18, 316, 155, 249,
1553 17, 18, 78, 79, 18, 324, 325, 326, 109, 110,
1554 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
1555 121, 122, 30, 31, 157, 284, 155, 30, 18, 331,
1556 30, 30, 27, 28, 284, 30, 158, 158, 155, 34,
1557 61, 36, 37, 153, 18, 295, 18, 18, 43, 44,
1558 45, 46, 47, 48, 49, 18, 51, 52, 18, 21,
1559 21, 161, 312, 21, 59, 60, 385, 386, 387, 64,
1560 329, 153, 123, 156, 393, 155, 65, 155, 155, 329,
1561 330, 331, 155, 155, 365, 155, 405, 406, 155, 155,
1562 155, 155, 40, 395, 153, 397, 398, 399, 153, 157,
1563 153, 403, 5, 6, 7, 8, 9, 10, 11, 12,
1564 43, 44, 45, 46, 47, 48, 49, 153, 153, 153,
1565 153, 153, 30, 442, 443, 153, 153, 153, 447, 30,
1566 449, 161, 156, 153, 453, 30, 155, 155, 15, 15,
1567 459, 460, 461, 153, 157, 395, 396, 397, 398, 399,
1568 361, 153, 153, 403, 404, 316, 66, 67, 68, 69,
1569 70, 71, 72, 324, 325, 326, 153, 153, 30, 18,
1570 38, 153, 153, 153, 424, 494, 495, 153, 153, 40,
1571 153, 18, 501, 153, 153, 153, 58, 153, 155, 153,
1572 155, 510, 30, 18, 153, 15, 153, 153, 153, 153,
1573 450, 503, 504, 505, 153, 156, 153, 157, 153, 153,
1574 153, 153, 153, 153, 58, 527, 466, 527, 537, 156,
1575 156, 156, 156, 40, 385, 386, 387, 156, 156, 156,
1576 156, 153, 393, 535, 159, 156, 555, 156, 156, 159,
1577 490, 156, 156, 493, 405, 406, 558, 15, 558, 15,
1578 15, 153, 15, 503, 504, 505, 107, 107, 262, 509,
1579 107, 580, 581, 45, 107, 263, 585, 107, 52, 588,
1580 425, 62, 3, 424, 43, 583, 450, 509, -1, -1,
1581 430, 442, 443, -1, -1, 535, 447, 240, 449, -1,
1582 -1, -1, 453, -1, -1, -1, -1, -1, 459, 460,
1583 461, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001584 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001585 371, 372, 373, 374, 375, -1, -1, 378, 379, 380,
1586 381, 382, -1, 494, 495, -1, -1, -1, -1, -1,
1587 501, -1, -1, -1, -1, -1, -1, -1, -1, 510,
1588 -1, -1, -1, -1, 3, 4, 5, 6, 7, 8,
1589 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
1590 19, 20, -1, -1, -1, -1, 537, 428, 429, 28,
1591 -1, 30, -1, -1, 435, -1, -1, -1, -1, -1,
1592 -1, -1, -1, -1, 555, -1, 3, 4, 5, 6,
1593 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1594 -1, -1, 19, 20, -1, -1, -1, -1, -1, 580,
1595 581, 28, -1, 30, 585, -1, -1, 588, -1, -1,
1596 481, 482, 483, 484, -1, 486, 487, 488, 489, -1,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001597 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1598 13, 14, 15, 16, -1, -1, 19, 20, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001599 -1, -1, -1, 514, 515, 28, -1, 30, -1, 3,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001600 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1601 14, 15, 16, -1, -1, 19, 20, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001602 -1, -1, -1, -1, 28, 546, 30, 548, 549, -1,
1603 -1, -1, -1, -1, -1, 154, -1, 41, 157, -1,
1604 -1, 160, -1, 162, 163, -1, 3, 4, 5, 6,
1605 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1606 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
1607 -1, 28, -1, 30, -1, -1, -1, 154, -1, -1,
1608 157, -1, -1, 160, 41, 162, 163, 3, 4, 5,
1609 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1610 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
1611 -1, -1, 28, -1, 30, -1, -1, -1, -1, -1,
1612 -1, 154, -1, -1, 157, -1, -1, 160, -1, 162,
1613 163, -1, 3, 4, 5, 6, 7, 8, 9, 10,
1614 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
1615 154, -1, -1, 157, -1, -1, 160, 28, 162, 30,
1616 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1617 41, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1618 12, 13, 14, 15, 16, -1, -1, 19, 20, -1,
1619 -1, -1, -1, -1, -1, -1, 28, 154, 30, -1,
1620 157, -1, -1, 160, -1, 162, -1, -1, -1, 41,
1621 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1622 13, 14, 15, 16, -1, -1, 19, 20, -1, -1,
1623 -1, -1, -1, -1, -1, 28, -1, 30, 154, -1,
1624 -1, 157, -1, 159, 160, -1, 162, 3, 4, 5,
1625 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1626 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
1627 -1, -1, 28, -1, 30, -1, -1, -1, -1, -1,
1628 -1, -1, -1, 154, -1, -1, 157, -1, -1, 160,
1629 -1, 162, 3, 4, 5, 6, 7, 8, 9, 10,
1630 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
1631 -1, -1, -1, -1, -1, -1, -1, 28, -1, 30,
1632 -1, -1, 154, -1, -1, 157, -1, -1, 160, -1,
1633 162, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1634 12, 13, 14, 15, 16, -1, -1, 19, 20, -1,
1635 -1, -1, -1, -1, -1, -1, 28, -1, 30, -1,
1636 -1, 154, -1, -1, 157, -1, -1, 160, -1, 162,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001637 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1638 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001639 -1, 19, 20, -1, 22, 23, 24, -1, 154, -1,
1640 28, 157, 30, -1, 160, -1, 162, -1, -1, -1,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001641 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1642 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001643 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1644 -1, -1, -1, 154, -1, -1, 157, -1, -1, 160,
1645 -1, 162, -1, 81, 82, 83, 84, 85, 86, 87,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001646 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001647 98, 99, 100, 101, 102, -1, -1, -1, -1, -1,
1648 -1, -1, 154, -1, -1, 157, -1, -1, 160, -1,
1649 162, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1650 128, -1, 130, 131, 132, 133, 134, -1, 136, 137,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001651 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001652 148, 149, 150, 151, -1, -1, -1, -1, -1, 157,
1653 -1, -1, 160, -1, 162, -1, -1, 165, 17, 18,
1654 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
1655 -1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
1656 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1657 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1658 -1, -1, -1, -1, 63, -1, -1, -1, -1, -1,
1659 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1660 -1, -1, 81, 82, 83, 84, 85, 86, 87, 88,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001661 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001662 99, 100, 101, 102, -1, -1, -1, 17, 18, -1,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001663 -1, 21, 22, 23, 24, 25, 26, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001664 -1, -1, -1, -1, -1, -1, -1, -1, -1, 128,
1665 -1, 130, 131, 132, 133, 134, -1, 136, 137, 138,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001666 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001667 149, 150, 151, 63, -1, -1, -1, -1, -1, -1,
1668 -1, 160, -1, -1, -1, -1, -1, -1, -1, -1,
1669 -1, 81, 82, 83, 84, 85, 86, 87, 88, 89,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001670 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001671 100, 101, 102, -1, -1, -1, -1, -1, -1, -1,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001672 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001673 -1, -1, -1, -1, -1, -1, -1, -1, 128, -1,
1674 130, 131, 132, 133, 134, -1, 136, 137, 138, 139,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001675 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001676 150, 151, 39, -1, -1, -1, -1, -1, -1, -1,
1677 160, -1, -1, 50, -1, -1, -1, -1, -1, -1,
1678 -1, -1, -1, -1, 61, 62, -1, -1, -1, -1,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001679 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001680 77, -1, -1, -1, 81, 82, 83, 84, 85, 86,
1681 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
1682 97, 98, 99, 100, 101, 102, -1, -1, -1, -1,
1683 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1684 -1, -1, -1, -1, -1, -1, 123, 124, 125, -1,
1685 -1, 128, 129, 130, 131, 132, 133, 134, 135, 136,
Jim Laskey2792cfb2006-12-06 11:03:10 +00001686 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001687 147, 148, 149, 150, 151
Jim Laskey2792cfb2006-12-06 11:03:10 +00001688};
1689
1690/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1691 symbol of state STATE-NUM. */
1692static const unsigned char yystos[] =
1693{
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001694 0, 200, 201, 203, 0, 31, 34, 35, 43, 44,
1695 45, 46, 47, 48, 49, 64, 181, 216, 218, 220,
1696 28, 30, 52, 60, 64, 180, 209, 220, 46, 48,
1697 219, 181, 63, 66, 67, 68, 69, 70, 71, 72,
1698 182, 214, 29, 226, 227, 228, 53, 54, 55, 73,
1699 206, 152, 63, 27, 46, 48, 51, 59, 181, 202,
1700 152, 214, 214, 30, 204, 18, 3, 4, 5, 6,
1701 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1702 19, 20, 154, 157, 160, 162, 167, 189, 190, 191,
1703 192, 193, 209, 223, 32, 162, 215, 33, 163, 217,
1704 227, 74, 75, 76, 78, 79, 80, 180, 229, 230,
1705 232, 152, 152, 152, 152, 157, 207, 204, 189, 36,
1706 37, 199, 199, 199, 199, 215, 18, 18, 18, 162,
1707 3, 163, 193, 194, 209, 155, 164, 3, 191, 225,
1708 4, 15, 5, 6, 7, 8, 9, 10, 11, 12,
1709 176, 177, 178, 39, 50, 61, 62, 77, 81, 82,
1710 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
1711 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
1712 123, 124, 125, 128, 129, 130, 131, 132, 133, 134,
1713 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1714 145, 146, 147, 148, 149, 150, 151, 169, 170, 171,
1715 174, 175, 236, 237, 239, 240, 30, 56, 57, 205,
1716 18, 30, 30, 208, 191, 191, 4, 5, 6, 7,
1717 8, 9, 10, 11, 12, 13, 14, 176, 177, 179,
1718 191, 196, 191, 158, 158, 163, 194, 153, 163, 155,
1719 41, 194, 195, 17, 18, 21, 22, 23, 24, 25,
1720 26, 63, 101, 102, 128, 130, 136, 137, 138, 160,
1721 169, 170, 171, 174, 175, 197, 222, 223, 224, 224,
1722 224, 224, 225, 61, 182, 103, 104, 105, 106, 107,
1723 108, 119, 120, 121, 122, 172, 25, 26, 109, 110,
1724 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
1725 121, 122, 173, 191, 191, 225, 191, 191, 233, 225,
1726 225, 225, 225, 225, 191, 191, 191, 225, 225, 182,
1727 126, 127, 153, 159, 153, 187, 187, 25, 26, 17,
1728 18, 168, 18, 21, 22, 23, 24, 157, 160, 162,
1729 165, 197, 223, 187, 187, 193, 193, 161, 163, 193,
1730 41, 191, 211, 212, 213, 153, 156, 65, 221, 172,
1731 173, 155, 155, 155, 155, 155, 196, 198, 155, 155,
1732 155, 155, 155, 153, 153, 189, 191, 191, 153, 184,
1733 153, 184, 224, 157, 153, 153, 153, 153, 153, 153,
1734 224, 224, 224, 153, 40, 189, 191, 225, 30, 38,
1735 58, 185, 188, 159, 198, 198, 163, 198, 30, 159,
1736 161, 161, 209, 210, 153, 156, 41, 30, 155, 155,
1737 196, 196, 196, 196, 196, 153, 161, 196, 196, 196,
1738 196, 196, 15, 15, 224, 224, 224, 10, 58, 10,
1739 153, 238, 224, 157, 225, 191, 225, 225, 225, 153,
1740 153, 153, 225, 191, 224, 224, 153, 30, 18, 187,
1741 159, 161, 163, 41, 211, 185, 186, 153, 196, 196,
1742 238, 153, 153, 153, 153, 196, 153, 153, 153, 153,
1743 40, 224, 224, 155, 153, 153, 224, 18, 224, 225,
1744 234, 153, 224, 153, 153, 153, 224, 224, 224, 155,
1745 191, 58, 183, 30, 153, 153, 156, 196, 196, 196,
1746 196, 196, 196, 196, 196, 191, 153, 157, 234, 235,
1747 224, 224, 153, 184, 184, 153, 224, 153, 225, 225,
1748 225, 235, 224, 18, 196, 196, 153, 156, 153, 153,
1749 156, 156, 156, 156, 156, 15, 159, 178, 231, 156,
1750 225, 159, 224, 156, 156, 156, 196, 196, 196, 224,
1751 222, 159, 178, 40, 159, 156, 156, 156, 153, 222,
1752 15, 15, 153, 224, 224, 15, 229, 224, 15, 224
Jim Laskey2792cfb2006-12-06 11:03:10 +00001753};
Reid Spencere7c3c602006-11-30 06:36:44 +00001754
1755#define yyerrok (yyerrstatus = 0)
1756#define yyclearin (yychar = YYEMPTY)
Jim Laskey2792cfb2006-12-06 11:03:10 +00001757#define YYEMPTY (-2)
Reid Spencere7c3c602006-11-30 06:36:44 +00001758#define YYEOF 0
Jim Laskey2792cfb2006-12-06 11:03:10 +00001759
Reid Spencere7c3c602006-11-30 06:36:44 +00001760#define YYACCEPT goto yyacceptlab
Jim Laskey2792cfb2006-12-06 11:03:10 +00001761#define YYABORT goto yyabortlab
1762#define YYERROR goto yyerrorlab
1763
1764
1765/* Like YYERROR except do call yyerror. This remains here temporarily
1766 to ease the transition to the new meaning of YYERROR, for GCC.
Reid Spencere7c3c602006-11-30 06:36:44 +00001767 Once GCC version 2 has supplanted version 1, this can go. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00001768
Reid Spencere7c3c602006-11-30 06:36:44 +00001769#define YYFAIL goto yyerrlab
Jim Laskey2792cfb2006-12-06 11:03:10 +00001770
Reid Spencere7c3c602006-11-30 06:36:44 +00001771#define YYRECOVERING() (!!yyerrstatus)
Jim Laskey2792cfb2006-12-06 11:03:10 +00001772
1773#define YYBACKUP(Token, Value) \
Reid Spencere7c3c602006-11-30 06:36:44 +00001774do \
1775 if (yychar == YYEMPTY && yylen == 1) \
Jim Laskey2792cfb2006-12-06 11:03:10 +00001776 { \
1777 yychar = (Token); \
1778 yylval = (Value); \
1779 yytoken = YYTRANSLATE (yychar); \
Reid Spencere7c3c602006-11-30 06:36:44 +00001780 YYPOPSTACK; \
1781 goto yybackup; \
1782 } \
1783 else \
Jim Laskey2792cfb2006-12-06 11:03:10 +00001784 { \
1785 yyerror (YY_("syntax error: cannot back up")); \
1786 YYERROR; \
1787 } \
Reid Spencere7c3c602006-11-30 06:36:44 +00001788while (0)
1789
Jim Laskey2792cfb2006-12-06 11:03:10 +00001790
Reid Spencere7c3c602006-11-30 06:36:44 +00001791#define YYTERROR 1
1792#define YYERRCODE 256
1793
Jim Laskey2792cfb2006-12-06 11:03:10 +00001794
1795/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1796 If N is 0, then set CURRENT to the empty location which ends
1797 the previous symbol: RHS[0] (always defined). */
1798
1799#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1800#ifndef YYLLOC_DEFAULT
1801# define YYLLOC_DEFAULT(Current, Rhs, N) \
1802 do \
1803 if (N) \
1804 { \
1805 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1806 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1807 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1808 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1809 } \
1810 else \
1811 { \
1812 (Current).first_line = (Current).last_line = \
1813 YYRHSLOC (Rhs, 0).last_line; \
1814 (Current).first_column = (Current).last_column = \
1815 YYRHSLOC (Rhs, 0).last_column; \
1816 } \
1817 while (0)
Reid Spencere7c3c602006-11-30 06:36:44 +00001818#endif
1819
Jim Laskey2792cfb2006-12-06 11:03:10 +00001820
1821/* YY_LOCATION_PRINT -- Print the location on the stream.
1822 This macro was not mandated originally: define only if we know
1823 we won't break user code: when these are the locations we know. */
1824
1825#ifndef YY_LOCATION_PRINT
1826# if YYLTYPE_IS_TRIVIAL
1827# define YY_LOCATION_PRINT(File, Loc) \
1828 fprintf (File, "%d.%d-%d.%d", \
1829 (Loc).first_line, (Loc).first_column, \
1830 (Loc).last_line, (Loc).last_column)
1831# else
1832# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1833# endif
1834#endif
1835
1836
1837/* YYLEX -- calling `yylex' with the right arguments. */
1838
Reid Spencere7c3c602006-11-30 06:36:44 +00001839#ifdef YYLEX_PARAM
Jim Laskey2792cfb2006-12-06 11:03:10 +00001840# define YYLEX yylex (YYLEX_PARAM)
Reid Spencere7c3c602006-11-30 06:36:44 +00001841#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00001842# define YYLEX yylex ()
Jim Laskey98ba5882006-12-06 10:57:33 +00001843#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001844
1845/* Enable debugging if requested. */
1846#if YYDEBUG
1847
1848# ifndef YYFPRINTF
1849# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1850# define YYFPRINTF fprintf
1851# endif
1852
1853# define YYDPRINTF(Args) \
1854do { \
1855 if (yydebug) \
1856 YYFPRINTF Args; \
1857} while (0)
1858
1859# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1860do { \
1861 if (yydebug) \
1862 { \
1863 YYFPRINTF (stderr, "%s ", Title); \
1864 yysymprint (stderr, \
1865 Type, Value); \
1866 YYFPRINTF (stderr, "\n"); \
1867 } \
1868} while (0)
1869
1870/*------------------------------------------------------------------.
1871| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1872| TOP (included). |
1873`------------------------------------------------------------------*/
1874
1875#if defined (__STDC__) || defined (__cplusplus)
1876static void
1877yy_stack_print (short int *bottom, short int *top)
Jim Laskey98ba5882006-12-06 10:57:33 +00001878#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00001879static void
1880yy_stack_print (bottom, top)
1881 short int *bottom;
1882 short int *top;
Jim Laskey98ba5882006-12-06 10:57:33 +00001883#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001884{
1885 YYFPRINTF (stderr, "Stack now");
1886 for (/* Nothing. */; bottom <= top; ++bottom)
1887 YYFPRINTF (stderr, " %d", *bottom);
1888 YYFPRINTF (stderr, "\n");
1889}
1890
1891# define YY_STACK_PRINT(Bottom, Top) \
1892do { \
1893 if (yydebug) \
1894 yy_stack_print ((Bottom), (Top)); \
1895} while (0)
1896
1897
1898/*------------------------------------------------.
1899| Report that the YYRULE is going to be reduced. |
1900`------------------------------------------------*/
1901
1902#if defined (__STDC__) || defined (__cplusplus)
1903static void
1904yy_reduce_print (int yyrule)
1905#else
1906static void
1907yy_reduce_print (yyrule)
1908 int yyrule;
Reid Spencere7c3c602006-11-30 06:36:44 +00001909#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001910{
1911 int yyi;
1912 unsigned long int yylno = yyrline[yyrule];
1913 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
1914 yyrule - 1, yylno);
1915 /* Print the symbols being reduced, and their result. */
1916 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1917 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1918 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
1919}
Reid Spencere7c3c602006-11-30 06:36:44 +00001920
Jim Laskey2792cfb2006-12-06 11:03:10 +00001921# define YY_REDUCE_PRINT(Rule) \
1922do { \
1923 if (yydebug) \
1924 yy_reduce_print (Rule); \
1925} while (0)
Reid Spencere7c3c602006-11-30 06:36:44 +00001926
Jim Laskey2792cfb2006-12-06 11:03:10 +00001927/* Nonzero means print parse trace. It is left uninitialized so that
1928 multiple parsers can coexist. */
1929int yydebug;
1930#else /* !YYDEBUG */
1931# define YYDPRINTF(Args)
1932# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1933# define YY_STACK_PRINT(Bottom, Top)
1934# define YY_REDUCE_PRINT(Rule)
1935#endif /* !YYDEBUG */
Reid Spencere7c3c602006-11-30 06:36:44 +00001936
Reid Spencere7c3c602006-11-30 06:36:44 +00001937
Jim Laskey2792cfb2006-12-06 11:03:10 +00001938/* YYINITDEPTH -- initial size of the parser's stacks. */
Reid Spencere7c3c602006-11-30 06:36:44 +00001939#ifndef YYINITDEPTH
Jim Laskey2792cfb2006-12-06 11:03:10 +00001940# define YYINITDEPTH 200
Reid Spencere7c3c602006-11-30 06:36:44 +00001941#endif
1942
Jim Laskey2792cfb2006-12-06 11:03:10 +00001943/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1944 if the built-in stack extension method is used).
Reid Spencere7c3c602006-11-30 06:36:44 +00001945
Jim Laskey2792cfb2006-12-06 11:03:10 +00001946 Do not make this value too large; the results are undefined if
1947 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1948 evaluated with infinite-precision integer arithmetic. */
Reid Spencere7c3c602006-11-30 06:36:44 +00001949
1950#ifndef YYMAXDEPTH
Jim Laskey2792cfb2006-12-06 11:03:10 +00001951# define YYMAXDEPTH 10000
Reid Spencere7c3c602006-11-30 06:36:44 +00001952#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001953
Reid Spencere7c3c602006-11-30 06:36:44 +00001954
1955
Jim Laskey2792cfb2006-12-06 11:03:10 +00001956#if YYERROR_VERBOSE
Reid Spencere7c3c602006-11-30 06:36:44 +00001957
Jim Laskey2792cfb2006-12-06 11:03:10 +00001958# ifndef yystrlen
1959# if defined (__GLIBC__) && defined (_STRING_H)
1960# define yystrlen strlen
1961# else
1962/* Return the length of YYSTR. */
1963static YYSIZE_T
1964# if defined (__STDC__) || defined (__cplusplus)
1965yystrlen (const char *yystr)
1966# else
1967yystrlen (yystr)
1968 const char *yystr;
1969# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00001970{
Jim Laskey2792cfb2006-12-06 11:03:10 +00001971 const char *yys = yystr;
Jim Laskey98ba5882006-12-06 10:57:33 +00001972
Jim Laskey2792cfb2006-12-06 11:03:10 +00001973 while (*yys++ != '\0')
1974 continue;
1975
1976 return yys - yystr - 1;
Jim Laskey98ba5882006-12-06 10:57:33 +00001977}
Jim Laskey2792cfb2006-12-06 11:03:10 +00001978# endif
1979# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00001980
Jim Laskey2792cfb2006-12-06 11:03:10 +00001981# ifndef yystpcpy
1982# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1983# define yystpcpy stpcpy
1984# else
1985/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1986 YYDEST. */
1987static char *
1988# if defined (__STDC__) || defined (__cplusplus)
1989yystpcpy (char *yydest, const char *yysrc)
1990# else
1991yystpcpy (yydest, yysrc)
1992 char *yydest;
1993 const char *yysrc;
1994# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00001995{
Jim Laskey2792cfb2006-12-06 11:03:10 +00001996 char *yyd = yydest;
1997 const char *yys = yysrc;
Jim Laskey98ba5882006-12-06 10:57:33 +00001998
Jim Laskey2792cfb2006-12-06 11:03:10 +00001999 while ((*yyd++ = *yys++) != '\0')
2000 continue;
2001
2002 return yyd - 1;
Jim Laskey98ba5882006-12-06 10:57:33 +00002003}
Jim Laskey2792cfb2006-12-06 11:03:10 +00002004# endif
2005# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00002006
Jim Laskey2792cfb2006-12-06 11:03:10 +00002007# ifndef yytnamerr
2008/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2009 quotes and backslashes, so that it's suitable for yyerror. The
2010 heuristic is that double-quoting is unnecessary unless the string
2011 contains an apostrophe, a comma, or backslash (other than
2012 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2013 null, do not copy; instead, return the length of what the result
2014 would have been. */
2015static YYSIZE_T
2016yytnamerr (char *yyres, const char *yystr)
2017{
2018 if (*yystr == '"')
2019 {
2020 size_t yyn = 0;
2021 char const *yyp = yystr;
2022
2023 for (;;)
2024 switch (*++yyp)
2025 {
2026 case '\'':
2027 case ',':
2028 goto do_not_strip_quotes;
2029
2030 case '\\':
2031 if (*++yyp != '\\')
2032 goto do_not_strip_quotes;
2033 /* Fall through. */
2034 default:
2035 if (yyres)
2036 yyres[yyn] = *yyp;
2037 yyn++;
2038 break;
2039
2040 case '"':
2041 if (yyres)
2042 yyres[yyn] = '\0';
2043 return yyn;
2044 }
2045 do_not_strip_quotes: ;
2046 }
2047
2048 if (! yyres)
2049 return yystrlen (yystr);
2050
2051 return yystpcpy (yyres, yystr) - yyres;
2052}
2053# endif
2054
2055#endif /* YYERROR_VERBOSE */
2056
Reid Spencere7c3c602006-11-30 06:36:44 +00002057
2058
Jim Laskey2792cfb2006-12-06 11:03:10 +00002059#if YYDEBUG
2060/*--------------------------------.
2061| Print this symbol on YYOUTPUT. |
2062`--------------------------------*/
Reid Spencere7c3c602006-11-30 06:36:44 +00002063
Jim Laskey2792cfb2006-12-06 11:03:10 +00002064#if defined (__STDC__) || defined (__cplusplus)
2065static void
2066yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
Jim Laskey98ba5882006-12-06 10:57:33 +00002067#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00002068static void
2069yysymprint (yyoutput, yytype, yyvaluep)
2070 FILE *yyoutput;
2071 int yytype;
2072 YYSTYPE *yyvaluep;
2073#endif
2074{
2075 /* Pacify ``unused variable'' warnings. */
2076 (void) yyvaluep;
2077
2078 if (yytype < YYNTOKENS)
2079 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2080 else
2081 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2082
2083
2084# ifdef YYPRINT
2085 if (yytype < YYNTOKENS)
2086 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2087# endif
2088 switch (yytype)
2089 {
2090 default:
2091 break;
2092 }
2093 YYFPRINTF (yyoutput, ")");
2094}
2095
2096#endif /* ! YYDEBUG */
2097/*-----------------------------------------------.
2098| Release the memory associated to this symbol. |
2099`-----------------------------------------------*/
2100
2101#if defined (__STDC__) || defined (__cplusplus)
2102static void
2103yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2104#else
2105static void
2106yydestruct (yymsg, yytype, yyvaluep)
2107 const char *yymsg;
2108 int yytype;
2109 YYSTYPE *yyvaluep;
2110#endif
2111{
2112 /* Pacify ``unused variable'' warnings. */
2113 (void) yyvaluep;
2114
2115 if (!yymsg)
2116 yymsg = "Deleting";
2117 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2118
2119 switch (yytype)
2120 {
2121
2122 default:
2123 break;
2124 }
2125}
2126
2127
2128/* Prevent warnings from -Wmissing-prototypes. */
2129
2130#ifdef YYPARSE_PARAM
2131# if defined (__STDC__) || defined (__cplusplus)
2132int yyparse (void *YYPARSE_PARAM);
2133# else
2134int yyparse ();
2135# endif
2136#else /* ! YYPARSE_PARAM */
2137#if defined (__STDC__) || defined (__cplusplus)
Reid Spencere7c3c602006-11-30 06:36:44 +00002138int yyparse (void);
Jim Laskey98ba5882006-12-06 10:57:33 +00002139#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00002140int yyparse ();
2141#endif
2142#endif /* ! YYPARSE_PARAM */
2143
2144
2145
2146/* The look-ahead symbol. */
2147int yychar;
2148
2149/* The semantic value of the look-ahead symbol. */
2150YYSTYPE yylval;
2151
2152/* Number of syntax errors so far. */
2153int yynerrs;
2154
2155
2156
2157/*----------.
2158| yyparse. |
2159`----------*/
2160
2161#ifdef YYPARSE_PARAM
2162# if defined (__STDC__) || defined (__cplusplus)
2163int yyparse (void *YYPARSE_PARAM)
2164# else
2165int yyparse (YYPARSE_PARAM)
2166 void *YYPARSE_PARAM;
2167# endif
2168#else /* ! YYPARSE_PARAM */
2169#if defined (__STDC__) || defined (__cplusplus)
2170int
2171yyparse (void)
2172#else
2173int
2174yyparse ()
2175
2176#endif
2177#endif
2178{
2179
2180 int yystate;
2181 int yyn;
2182 int yyresult;
2183 /* Number of tokens to shift before error messages enabled. */
2184 int yyerrstatus;
2185 /* Look-ahead token as an internal (translated) token number. */
2186 int yytoken = 0;
2187
2188 /* Three stacks and their tools:
2189 `yyss': related to states,
2190 `yyvs': related to semantic values,
2191 `yyls': related to locations.
2192
2193 Refer to the stacks thru separate pointers, to allow yyoverflow
2194 to reallocate them elsewhere. */
2195
2196 /* The state stack. */
2197 short int yyssa[YYINITDEPTH];
2198 short int *yyss = yyssa;
2199 short int *yyssp;
2200
2201 /* The semantic value stack. */
2202 YYSTYPE yyvsa[YYINITDEPTH];
2203 YYSTYPE *yyvs = yyvsa;
2204 YYSTYPE *yyvsp;
2205
2206
2207
Reid Spencere7c3c602006-11-30 06:36:44 +00002208#define YYPOPSTACK (yyvsp--, yyssp--)
2209
Jim Laskey2792cfb2006-12-06 11:03:10 +00002210 YYSIZE_T yystacksize = YYINITDEPTH;
Reid Spencere7c3c602006-11-30 06:36:44 +00002211
Jim Laskey2792cfb2006-12-06 11:03:10 +00002212 /* The variables used to return semantic value and location from the
2213 action routines. */
2214 YYSTYPE yyval;
Reid Spencere7c3c602006-11-30 06:36:44 +00002215
2216
Jim Laskey2792cfb2006-12-06 11:03:10 +00002217 /* When reducing, the number of symbols on the RHS of the reduced
2218 rule. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002219 int yylen;
2220
Jim Laskey2792cfb2006-12-06 11:03:10 +00002221 YYDPRINTF ((stderr, "Starting parse\n"));
Reid Spencere7c3c602006-11-30 06:36:44 +00002222
2223 yystate = 0;
2224 yyerrstatus = 0;
2225 yynerrs = 0;
2226 yychar = YYEMPTY; /* Cause a token to be read. */
2227
2228 /* Initialize stack pointers.
2229 Waste one element of value and location stack
2230 so that they stay on the same level as the state stack.
2231 The wasted elements are never initialized. */
2232
Jim Laskey2792cfb2006-12-06 11:03:10 +00002233 yyssp = yyss;
Reid Spencere7c3c602006-11-30 06:36:44 +00002234 yyvsp = yyvs;
2235
Jim Laskey2792cfb2006-12-06 11:03:10 +00002236 goto yysetstate;
Reid Spencere7c3c602006-11-30 06:36:44 +00002237
Jim Laskey2792cfb2006-12-06 11:03:10 +00002238/*------------------------------------------------------------.
2239| yynewstate -- Push a new state, which is found in yystate. |
2240`------------------------------------------------------------*/
2241 yynewstate:
2242 /* In all cases, when you get here, the value and location stacks
2243 have just been pushed. so pushing a state here evens the stacks.
2244 */
2245 yyssp++;
Reid Spencere7c3c602006-11-30 06:36:44 +00002246
Jim Laskey2792cfb2006-12-06 11:03:10 +00002247 yysetstate:
2248 *yyssp = yystate;
2249
2250 if (yyss + yystacksize - 1 <= yyssp)
Reid Spencere7c3c602006-11-30 06:36:44 +00002251 {
2252 /* Get the current used size of the three stacks, in elements. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002253 YYSIZE_T yysize = yyssp - yyss + 1;
Reid Spencere7c3c602006-11-30 06:36:44 +00002254
2255#ifdef yyoverflow
Jim Laskey2792cfb2006-12-06 11:03:10 +00002256 {
2257 /* Give user a chance to reallocate the stack. Use copies of
2258 these so that the &'s don't force the real ones into
2259 memory. */
2260 YYSTYPE *yyvs1 = yyvs;
2261 short int *yyss1 = yyss;
Reid Spencere7c3c602006-11-30 06:36:44 +00002262
Jim Laskey2792cfb2006-12-06 11:03:10 +00002263
2264 /* Each stack pointer address is followed by the size of the
2265 data in use in that stack, in bytes. This used to be a
2266 conditional around just the two extra args, but that might
2267 be undefined if yyoverflow is a macro. */
2268 yyoverflow (YY_("memory exhausted"),
2269 &yyss1, yysize * sizeof (*yyssp),
2270 &yyvs1, yysize * sizeof (*yyvsp),
2271
2272 &yystacksize);
2273
2274 yyss = yyss1;
2275 yyvs = yyvs1;
2276 }
Reid Spencere7c3c602006-11-30 06:36:44 +00002277#else /* no yyoverflow */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002278# ifndef YYSTACK_RELOCATE
2279 goto yyexhaustedlab;
2280# else
Reid Spencere7c3c602006-11-30 06:36:44 +00002281 /* Extend the stack our own way. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002282 if (YYMAXDEPTH <= yystacksize)
2283 goto yyexhaustedlab;
Reid Spencere7c3c602006-11-30 06:36:44 +00002284 yystacksize *= 2;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002285 if (YYMAXDEPTH < yystacksize)
Reid Spencere7c3c602006-11-30 06:36:44 +00002286 yystacksize = YYMAXDEPTH;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002287
2288 {
2289 short int *yyss1 = yyss;
2290 union yyalloc *yyptr =
2291 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2292 if (! yyptr)
2293 goto yyexhaustedlab;
2294 YYSTACK_RELOCATE (yyss);
2295 YYSTACK_RELOCATE (yyvs);
2296
2297# undef YYSTACK_RELOCATE
2298 if (yyss1 != yyssa)
2299 YYSTACK_FREE (yyss1);
2300 }
2301# endif
Reid Spencere7c3c602006-11-30 06:36:44 +00002302#endif /* no yyoverflow */
2303
Jim Laskey2792cfb2006-12-06 11:03:10 +00002304 yyssp = yyss + yysize - 1;
2305 yyvsp = yyvs + yysize - 1;
Reid Spencere7c3c602006-11-30 06:36:44 +00002306
2307
Jim Laskey2792cfb2006-12-06 11:03:10 +00002308 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2309 (unsigned long int) yystacksize));
2310
2311 if (yyss + yystacksize - 1 <= yyssp)
Reid Spencere7c3c602006-11-30 06:36:44 +00002312 YYABORT;
2313 }
2314
Jim Laskey2792cfb2006-12-06 11:03:10 +00002315 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
Reid Spencere7c3c602006-11-30 06:36:44 +00002316
2317 goto yybackup;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002318
2319/*-----------.
2320| yybackup. |
2321`-----------*/
2322yybackup:
Reid Spencere7c3c602006-11-30 06:36:44 +00002323
2324/* Do appropriate processing given the current state. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002325/* Read a look-ahead token if we need one and don't already have one. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002326/* yyresume: */
2327
Jim Laskey2792cfb2006-12-06 11:03:10 +00002328 /* First try to decide what to do without reference to look-ahead token. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002329
2330 yyn = yypact[yystate];
Jim Laskey2792cfb2006-12-06 11:03:10 +00002331 if (yyn == YYPACT_NINF)
Reid Spencere7c3c602006-11-30 06:36:44 +00002332 goto yydefault;
2333
Jim Laskey2792cfb2006-12-06 11:03:10 +00002334 /* Not known => get a look-ahead token if don't already have one. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002335
Jim Laskey2792cfb2006-12-06 11:03:10 +00002336 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002337 if (yychar == YYEMPTY)
2338 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002339 YYDPRINTF ((stderr, "Reading a token: "));
Reid Spencere7c3c602006-11-30 06:36:44 +00002340 yychar = YYLEX;
2341 }
2342
Jim Laskey2792cfb2006-12-06 11:03:10 +00002343 if (yychar <= YYEOF)
Reid Spencere7c3c602006-11-30 06:36:44 +00002344 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002345 yychar = yytoken = YYEOF;
2346 YYDPRINTF ((stderr, "Now at end of input.\n"));
Reid Spencere7c3c602006-11-30 06:36:44 +00002347 }
2348 else
2349 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002350 yytoken = YYTRANSLATE (yychar);
2351 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
Reid Spencere7c3c602006-11-30 06:36:44 +00002352 }
2353
Jim Laskey2792cfb2006-12-06 11:03:10 +00002354 /* If the proper action on seeing token YYTOKEN is to reduce or to
2355 detect an error, take that action. */
2356 yyn += yytoken;
2357 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
Reid Spencere7c3c602006-11-30 06:36:44 +00002358 goto yydefault;
2359 yyn = yytable[yyn];
Jim Laskey2792cfb2006-12-06 11:03:10 +00002360 if (yyn <= 0)
Reid Spencere7c3c602006-11-30 06:36:44 +00002361 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002362 if (yyn == 0 || yyn == YYTABLE_NINF)
Reid Spencere7c3c602006-11-30 06:36:44 +00002363 goto yyerrlab;
2364 yyn = -yyn;
2365 goto yyreduce;
2366 }
2367
2368 if (yyn == YYFINAL)
2369 YYACCEPT;
2370
Jim Laskey2792cfb2006-12-06 11:03:10 +00002371 /* Shift the look-ahead token. */
2372 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
Reid Spencere7c3c602006-11-30 06:36:44 +00002373
2374 /* Discard the token being shifted unless it is eof. */
2375 if (yychar != YYEOF)
2376 yychar = YYEMPTY;
2377
2378 *++yyvsp = yylval;
2379
Jim Laskey2792cfb2006-12-06 11:03:10 +00002380
2381 /* Count tokens shifted since error; after three, turn off error
2382 status. */
2383 if (yyerrstatus)
2384 yyerrstatus--;
Reid Spencere7c3c602006-11-30 06:36:44 +00002385
2386 yystate = yyn;
2387 goto yynewstate;
2388
Jim Laskey98ba5882006-12-06 10:57:33 +00002389
Jim Laskey2792cfb2006-12-06 11:03:10 +00002390/*-----------------------------------------------------------.
2391| yydefault -- do the default action for the current state. |
2392`-----------------------------------------------------------*/
2393yydefault:
Reid Spencere7c3c602006-11-30 06:36:44 +00002394 yyn = yydefact[yystate];
2395 if (yyn == 0)
2396 goto yyerrlab;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002397 goto yyreduce;
Reid Spencere7c3c602006-11-30 06:36:44 +00002398
Jim Laskey2792cfb2006-12-06 11:03:10 +00002399
2400/*-----------------------------.
2401| yyreduce -- Do a reduction. |
2402`-----------------------------*/
Reid Spencere7c3c602006-11-30 06:36:44 +00002403yyreduce:
Jim Laskey2792cfb2006-12-06 11:03:10 +00002404 /* yyn is the number of a rule to reduce with. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002405 yylen = yyr2[yyn];
2406
Jim Laskey2792cfb2006-12-06 11:03:10 +00002407 /* If YYLEN is nonzero, implement the default value of the action:
2408 `$$ = $1'.
2409
2410 Otherwise, the following line sets YYVAL to garbage.
2411 This behavior is undocumented and Bison
2412 users should not rely upon it. Assigning to YYVAL
2413 unconditionally makes the parser a bit smaller, and it avoids a
2414 GCC warning that YYVAL may be used uninitialized. */
2415 yyval = yyvsp[1-yylen];
2416
2417
2418 YY_REDUCE_PRINT (yyn);
2419 switch (yyn)
Reid Spencere7c3c602006-11-30 06:36:44 +00002420 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002421 case 81:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002422#line 363 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002423 {
2424 (yyval.String) = (yyvsp[-1].String);
2425 ;}
2426 break;
Reid Spencere7c3c602006-11-30 06:36:44 +00002427
Jim Laskey2792cfb2006-12-06 11:03:10 +00002428 case 82:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002429#line 366 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002430 {
2431 (yyval.String) = new std::string("");
2432 ;}
2433 break;
Reid Spencere7c3c602006-11-30 06:36:44 +00002434
Jim Laskey2792cfb2006-12-06 11:03:10 +00002435 case 90:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002436#line 373 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002437 { (yyval.String) = new std::string(""); ;}
2438 break;
Reid Spencere77e35e2006-12-01 20:26:20 +00002439
Jim Laskey2792cfb2006-12-06 11:03:10 +00002440 case 97:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002441#line 378 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002442 {
2443 *(yyvsp[-1].String) += *(yyvsp[0].String);
2444 delete (yyvsp[0].String);
2445 (yyval.String) = (yyvsp[-1].String);
2446 ;}
2447 break;
Reid Spencer16244f42006-12-01 21:10:07 +00002448
Jim Laskey2792cfb2006-12-06 11:03:10 +00002449 case 98:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002450#line 383 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002451 { (yyval.String) = new std::string(""); ;}
2452 break;
Reid Spencere7c3c602006-11-30 06:36:44 +00002453
Jim Laskey2792cfb2006-12-06 11:03:10 +00002454 case 99:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002455#line 388 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002456 { (yyval.String) = new std::string(); ;}
2457 break;
2458
2459 case 100:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002460#line 389 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002461 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
2462 break;
2463
2464 case 101:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002465#line 392 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002466 { (yyval.String) = new std::string(); ;}
2467 break;
2468
2469 case 102:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002470#line 393 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002471 {
2472 (yyvsp[-1].String)->insert(0, ", ");
2473 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2474 delete (yyvsp[0].String);
2475 (yyval.String) = (yyvsp[-1].String);
2476 ;}
2477 break;
2478
2479 case 103:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002480#line 401 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002481 {
2482 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2483 delete (yyvsp[0].String);
2484 (yyval.String) = (yyvsp[-1].String);
2485 ;}
2486 break;
2487
2488 case 104:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002489#line 407 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002490 { (yyval.String) = new std::string(); ;}
2491 break;
2492
2493 case 106:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002494#line 411 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002495 { (yyval.String) = new std::string(); ;}
2496 break;
2497
2498 case 107:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002499#line 412 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002500 {
2501 (yyvsp[-1].String)->insert(0, ", ");
2502 if (!(yyvsp[0].String)->empty())
2503 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2504 delete (yyvsp[0].String);
2505 (yyval.String) = (yyvsp[-1].String);
2506 ;}
2507 break;
2508
2509 case 109:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002510#line 422 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002511 {
2512 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2513 delete (yyvsp[0].String);
2514 (yyval.String) = (yyvsp[-1].String);
2515 ;}
2516 break;
2517
2518 case 127:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002519#line 444 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002520 {
2521 (yyval.Type).newTy = (yyvsp[0].String);
2522 (yyval.Type).oldTy = OpaqueTy;
2523 ;}
2524 break;
2525
2526 case 128:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002527#line 448 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002528 {
2529 (yyval.Type).newTy = (yyvsp[0].String);
2530 (yyval.Type).oldTy = UnresolvedTy;
2531 ;}
2532 break;
2533
2534 case 129:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002535#line 452 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002536 {
2537 (yyval.Type) = (yyvsp[0].Type);
2538 ;}
2539 break;
2540
2541 case 130:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002542#line 455 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002543 { // Type UpReference
2544 (yyvsp[0].String)->insert(0, "\\");
2545 (yyval.Type).newTy = (yyvsp[0].String);
2546 (yyval.Type).oldTy = NumericTy;
2547 ;}
2548 break;
2549
2550 case 131:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002551#line 460 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002552 { // Function derived type?
2553 *(yyvsp[-3].Type).newTy += "( " + *(yyvsp[-1].String) + " )";
2554 delete (yyvsp[-1].String);
2555 (yyval.Type).newTy = (yyvsp[-3].Type).newTy;
2556 (yyval.Type).oldTy = FunctionTy;
2557 ;}
2558 break;
2559
2560 case 132:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002561#line 466 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002562 { // Sized array type?
2563 (yyvsp[-3].String)->insert(0,"[ ");
2564 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " ]";
2565 delete (yyvsp[-1].Type).newTy;
2566 (yyval.Type).newTy = (yyvsp[-3].String);
2567 (yyval.Type).oldTy = ArrayTy;
2568 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
2569 ;}
2570 break;
2571
2572 case 133:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002573#line 474 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002574 { // Packed array type?
2575 (yyvsp[-3].String)->insert(0,"< ");
2576 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " >";
2577 delete (yyvsp[-1].Type).newTy;
2578 (yyval.Type).newTy = (yyvsp[-3].String);
2579 (yyval.Type).oldTy = PackedTy;
2580 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
2581 ;}
2582 break;
2583
2584 case 134:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002585#line 482 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002586 { // Structure type?
2587 (yyvsp[-1].String)->insert(0, "{ ");
2588 *(yyvsp[-1].String) += " }";
2589 (yyval.Type).newTy = (yyvsp[-1].String);
2590 (yyval.Type).oldTy = StructTy;
2591 ;}
2592 break;
2593
2594 case 135:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002595#line 488 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002596 { // Empty structure type?
2597 (yyval.Type).newTy = new std::string("{}");
2598 (yyval.Type).oldTy = StructTy;
2599 ;}
2600 break;
2601
2602 case 136:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002603#line 492 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2604 { // Packed Structure type?
2605 (yyvsp[-2].String)->insert(0, "<{ ");
2606 *(yyvsp[-2].String) += " }>";
2607 (yyval.Type).newTy = (yyvsp[-2].String);
2608 (yyval.Type).oldTy = StructTy;
2609 ;}
2610 break;
2611
2612 case 137:
2613#line 498 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2614 { // Empty packed structure type?
2615 (yyval.Type).newTy = new std::string("<{}>");
2616 (yyval.Type).oldTy = StructTy;
2617 ;}
2618 break;
2619
2620 case 138:
2621#line 502 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002622 { // Pointer type?
2623 *(yyvsp[-1].Type).newTy += '*';
2624 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
2625 (yyvsp[-1].Type).oldTy = PointerTy;
2626 (yyval.Type) = (yyvsp[-1].Type);
2627 ;}
2628 break;
2629
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002630 case 139:
2631#line 513 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002632 {
2633 (yyval.String) = (yyvsp[0].Type).newTy;
2634 ;}
2635 break;
2636
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002637 case 140:
2638#line 516 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002639 {
2640 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Type).newTy;
2641 delete (yyvsp[0].Type).newTy;
2642 (yyval.String) = (yyvsp[-2].String);
2643 ;}
2644 break;
2645
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002646 case 142:
2647#line 525 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002648 {
2649 *(yyvsp[-2].String) += ", ...";
2650 delete (yyvsp[0].String);
2651 (yyval.String) = (yyvsp[-2].String);
2652 ;}
2653 break;
2654
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002655 case 143:
2656#line 530 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002657 {
2658 (yyval.String) = (yyvsp[0].String);
2659 ;}
2660 break;
2661
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002662 case 144:
2663#line 533 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002664 {
2665 (yyval.String) = new std::string();
2666 ;}
2667 break;
2668
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002669 case 145:
2670#line 543 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002671 { // Nonempty unsized arr
2672 (yyval.Const).type = (yyvsp[-3].Type);
2673 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2674 *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]";
2675 delete (yyvsp[-1].String);
2676 ;}
2677 break;
2678
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002679 case 146:
2680#line 549 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002681 {
2682 (yyval.Const).type = (yyvsp[-2].Type);
2683 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2684 *(yyval.Const).cnst += "[ ]";
2685 ;}
2686 break;
2687
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002688 case 147:
2689#line 554 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002690 {
2691 (yyval.Const).type = (yyvsp[-2].Type);
2692 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2693 *(yyval.Const).cnst += " c" + *(yyvsp[0].String);
2694 delete (yyvsp[0].String);
2695 ;}
2696 break;
2697
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002698 case 148:
2699#line 560 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002700 { // Nonempty unsized arr
2701 (yyval.Const).type = (yyvsp[-3].Type);
2702 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2703 *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >";
2704 delete (yyvsp[-1].String);
2705 ;}
2706 break;
2707
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002708 case 149:
2709#line 566 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002710 {
2711 (yyval.Const).type = (yyvsp[-3].Type);
2712 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2713 *(yyval.Const).cnst += " { " + *(yyvsp[-1].String) + " }";
2714 delete (yyvsp[-1].String);
2715 ;}
2716 break;
2717
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002718 case 150:
2719#line 572 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002720 {
2721 (yyval.Const).type = (yyvsp[-2].Type);
2722 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2723 *(yyval.Const).cnst += " {}";
2724 ;}
2725 break;
2726
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002727 case 151:
2728#line 577 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002729 {
2730 (yyval.Const).type = (yyvsp[-1].Type);
2731 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2732 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2733 delete (yyvsp[0].String);
2734 ;}
2735 break;
2736
Reid Spencer187ccf82006-12-09 16:57:22 +00002737 case 152:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002738#line 583 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002739 {
2740 (yyval.Const).type = (yyvsp[-1].Type);
2741 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2742 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2743 delete (yyvsp[0].String);
2744 ;}
2745 break;
2746
Reid Spencer187ccf82006-12-09 16:57:22 +00002747 case 153:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002748#line 589 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer187ccf82006-12-09 16:57:22 +00002749 {
2750 (yyval.Const).type = (yyvsp[-1].Type);
2751 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2752 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2753 delete (yyvsp[0].String);
2754 ;}
2755 break;
2756
2757 case 154:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002758#line 595 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2759 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002760 (yyval.Const).type = (yyvsp[-1].Type);
2761 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2762 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2763 delete (yyvsp[0].String);
2764 ;}
2765 break;
2766
2767 case 155:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002768#line 601 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2769 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002770 (yyval.Const).type = (yyvsp[-1].Type);
2771 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2772 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2773 delete (yyvsp[0].String);
2774 ;}
2775 break;
2776
2777 case 156:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002778#line 607 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2779 { // integral constants
Jim Laskey2792cfb2006-12-06 11:03:10 +00002780 (yyval.Const).type = (yyvsp[-1].Type);
2781 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2782 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2783 delete (yyvsp[0].String);
2784 ;}
2785 break;
2786
2787 case 157:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002788#line 613 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2789 { // integral constants
Jim Laskey2792cfb2006-12-06 11:03:10 +00002790 (yyval.Const).type = (yyvsp[-1].Type);
2791 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2792 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2793 delete (yyvsp[0].String);
2794 ;}
2795 break;
2796
2797 case 158:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002798#line 619 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2799 { // Boolean constants
Jim Laskey2792cfb2006-12-06 11:03:10 +00002800 (yyval.Const).type = (yyvsp[-1].Type);
2801 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2802 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2803 delete (yyvsp[0].String);
2804 ;}
2805 break;
2806
2807 case 159:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002808#line 625 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2809 { // Boolean constants
2810 (yyval.Const).type = (yyvsp[-1].Type);
2811 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2812 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2813 delete (yyvsp[0].String);
2814 ;}
2815 break;
2816
2817 case 160:
2818#line 631 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2819 { // Float & Double constants
2820 (yyval.Const).type = (yyvsp[-1].Type);
2821 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2822 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2823 delete (yyvsp[0].String);
2824 ;}
2825 break;
2826
2827 case 161:
2828#line 639 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002829 {
2830 std::string source = *(yyvsp[-3].Const).cnst;
2831 TypeInfo DstTy = (yyvsp[-1].Type);
Reid Spencera50d5962006-12-02 04:11:07 +00002832 ResolveType(DstTy);
Jim Laskey2792cfb2006-12-06 11:03:10 +00002833 if (*(yyvsp[-5].String) == "cast") {
Reid Spencera50d5962006-12-02 04:11:07 +00002834 // Call getCastUpgrade to upgrade the old cast
Jim Laskey2792cfb2006-12-06 11:03:10 +00002835 (yyval.String) = new std::string(getCastUpgrade(source, (yyvsp[-3].Const).type, (yyvsp[-1].Type), true));
Reid Spencera50d5962006-12-02 04:11:07 +00002836 } else {
2837 // Nothing to upgrade, just create the cast constant expr
Jim Laskey2792cfb2006-12-06 11:03:10 +00002838 (yyval.String) = new std::string(*(yyvsp[-5].String));
2839 *(yyval.String) += "( " + source + " to " + *(yyvsp[-1].Type).newTy + ")";
Reid Spencer280d8012006-12-01 23:40:53 +00002840 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00002841 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
2842 ;}
2843 break;
2844
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002845 case 162:
2846#line 653 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002847 {
2848 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst;
2849 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
2850 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
2851 *(yyvsp[-4].String) += ", " + *VI.val;
Reid Spencerf8483652006-12-02 15:16:01 +00002852 VI.destroy();
2853 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00002854 *(yyvsp[-4].String) += ")";
2855 (yyval.String) = (yyvsp[-4].String);
2856 (yyvsp[-2].Const).destroy();
2857 delete (yyvsp[-1].ValList);
2858 ;}
2859 break;
2860
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002861 case 163:
2862#line 665 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002863 {
2864 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2865 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2866 (yyval.String) = (yyvsp[-7].String);
2867 ;}
2868 break;
2869
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002870 case 164:
2871#line 670 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002872 {
2873 const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
2874 (yyval.String) = new std::string(op);
2875 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2876 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2877 ;}
2878 break;
2879
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002880 case 165:
2881#line 676 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002882 {
2883 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2884 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2885 (yyval.String) = (yyvsp[-5].String);
2886 ;}
2887 break;
2888
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002889 case 166:
2890#line 681 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002891 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002892 *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
Jim Laskey2792cfb2006-12-06 11:03:10 +00002893 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2894 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2895 (yyval.String) = (yyvsp[-5].String);
2896 ;}
2897 break;
2898
Jim Laskey2792cfb2006-12-06 11:03:10 +00002899 case 167:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002900#line 687 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2901 {
2902 *(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2903 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2904 (yyval.String) = (yyvsp[-6].String);
2905 ;}
2906 break;
2907
2908 case 168:
2909#line 692 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2910 {
2911 *(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2912 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2913 (yyval.String) = (yyvsp[-6].String);
2914 ;}
2915 break;
2916
2917 case 169:
2918#line 697 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002919 {
2920 const char* shiftop = (yyvsp[-5].String)->c_str();
2921 if (*(yyvsp[-5].String) == "shr")
2922 shiftop = ((yyvsp[-3].Const).type.isUnsigned()) ? "lshr" : "ashr";
2923 (yyval.String) = new std::string(shiftop);
2924 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2925 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2926 ;}
2927 break;
2928
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002929 case 170:
2930#line 705 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002931 {
2932 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2933 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2934 (yyval.String) = (yyvsp[-5].String);
2935 ;}
2936 break;
2937
Jim Laskey2792cfb2006-12-06 11:03:10 +00002938 case 171:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002939#line 710 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2940 {
2941 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2942 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2943 (yyval.String) = (yyvsp[-7].String);
2944 ;}
2945 break;
2946
2947 case 172:
2948#line 715 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2949 {
2950 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2951 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2952 (yyval.String) = (yyvsp[-7].String);
2953 ;}
2954 break;
2955
2956 case 173:
2957#line 725 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002958 {
2959 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst;
2960 (yyvsp[0].Const).destroy();
2961 (yyval.String) = (yyvsp[-2].String);
2962 ;}
2963 break;
2964
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002965 case 174:
2966#line 730 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002967 { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;}
2968 break;
2969
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002970 case 177:
2971#line 745 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002972 {
2973;}
2974 break;
2975
Jim Laskey2792cfb2006-12-06 11:03:10 +00002976 case 178:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002977#line 750 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002978 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002979 (yyval.String) = 0;
2980 ;}
2981 break;
2982
2983 case 179:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002984#line 753 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2985 {
2986 *O << *(yyvsp[0].String) << '\n';
2987 delete (yyvsp[0].String);
2988 (yyval.String) = 0;
2989 ;}
2990 break;
2991
2992 case 180:
2993#line 758 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
2994 {
2995 *O << "module asm " << ' ' << *(yyvsp[0].String) << '\n';
2996 (yyval.String) = 0;
2997 ;}
2998 break;
2999
3000 case 181:
3001#line 762 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003002 {
Reid Spencerd154b572006-12-01 20:36:40 +00003003 *O << "implementation\n";
Jim Laskey2792cfb2006-12-06 11:03:10 +00003004 (yyval.String) = 0;
3005 ;}
3006 break;
3007
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003008 case 182:
3009#line 766 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003010 { (yyval.String) = 0; ;}
3011 break;
3012
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003013 case 184:
3014#line 768 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003015 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
3016 break;
3017
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003018 case 185:
3019#line 771 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003020 {
3021 EnumeratedTypes.push_back((yyvsp[0].Type));
3022 if (!(yyvsp[-2].String)->empty()) {
3023 NamedTypes[*(yyvsp[-2].String)].newTy = new std::string(*(yyvsp[0].Type).newTy);
3024 NamedTypes[*(yyvsp[-2].String)].oldTy = (yyvsp[0].Type).oldTy;
3025 NamedTypes[*(yyvsp[-2].String)].elemTy = (yyvsp[0].Type).elemTy;
3026 *O << *(yyvsp[-2].String) << " = ";
Reid Spencera50d5962006-12-02 04:11:07 +00003027 }
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003028 *O << "type " << *(yyvsp[0].Type).newTy << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003029 delete (yyvsp[-2].String); delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
3030 (yyval.String) = 0;
3031 ;}
3032 break;
3033
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003034 case 186:
3035#line 783 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003036 { // Function prototypes can be in const pool
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003037 *O << *(yyvsp[0].String) << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003038 delete (yyvsp[0].String);
3039 (yyval.String) = 0;
3040 ;}
3041 break;
3042
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003043 case 187:
3044#line 788 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003045 { // Asm blocks can be in the const pool
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003046 *O << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003047 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3048 (yyval.String) = 0;
3049 ;}
3050 break;
3051
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003052 case 188:
3053#line 793 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003054 {
3055 if (!(yyvsp[-4].String)->empty()) {
3056 *O << *(yyvsp[-4].String) << " = ";
3057 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Const).type.clone();
Reid Spencerf12ee422006-12-05 19:21:25 +00003058 }
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003059 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Const).cnst << ' ' << *(yyvsp[0].String) << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003060 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Const).destroy(); delete (yyvsp[0].String);
3061 (yyval.String) = 0;
3062 ;}
3063 break;
3064
Jim Laskey2792cfb2006-12-06 11:03:10 +00003065 case 189:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003066#line 802 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003067 {
3068 if (!(yyvsp[-4].String)->empty()) {
3069 *O << *(yyvsp[-4].String) << " = ";
3070 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Type).clone();
Reid Spencerf12ee422006-12-05 19:21:25 +00003071 }
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003072 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Type).newTy << ' ' << *(yyvsp[0].String) << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003073 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3074 (yyval.String) = 0;
3075 ;}
3076 break;
3077
3078 case 190:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003079#line 811 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3080 {
3081 if (!(yyvsp[-4].String)->empty()) {
3082 *O << *(yyvsp[-4].String) << " = ";
3083 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Type).clone();
3084 }
3085 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Type).newTy << ' ' << *(yyvsp[0].String) << '\n';
3086 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
Jim Laskey2792cfb2006-12-06 11:03:10 +00003087 (yyval.String) = 0;
3088 ;}
3089 break;
3090
3091 case 191:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003092#line 820 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003093 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003094 if (!(yyvsp[-4].String)->empty()) {
3095 *O << *(yyvsp[-4].String) << " = ";
3096 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Type).clone();
3097 }
3098 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Type).newTy << ' ' << *(yyvsp[0].String) << '\n';
3099 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
Jim Laskey2792cfb2006-12-06 11:03:10 +00003100 (yyval.String) = 0;
3101 ;}
3102 break;
3103
3104 case 192:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003105#line 829 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3106 {
3107 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3108 delete (yyvsp[-1].String); delete (yyvsp[0].String);
3109 (yyval.String) = 0;
3110 ;}
3111 break;
3112
3113 case 193:
3114#line 834 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3115 {
3116 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << '\n';
3117 delete (yyvsp[-2].String); delete (yyvsp[0].String);
3118 (yyval.String) = 0;
3119 ;}
3120 break;
3121
3122 case 194:
3123#line 839 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003124 {
3125 (yyval.String) = 0;
3126 ;}
3127 break;
3128
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003129 case 198:
3130#line 849 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003131 {
3132 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3133 delete (yyvsp[0].String);
3134 (yyval.String) = (yyvsp[-2].String);
3135 ;}
3136 break;
3137
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003138 case 199:
3139#line 854 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003140 {
3141 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3142 if (*(yyvsp[0].String) == "64")
Reid Spencere77e35e2006-12-01 20:26:20 +00003143 SizeOfPointer = 64;
Jim Laskey2792cfb2006-12-06 11:03:10 +00003144 delete (yyvsp[0].String);
3145 (yyval.String) = (yyvsp[-2].String);
3146 ;}
3147 break;
3148
Jim Laskey2792cfb2006-12-06 11:03:10 +00003149 case 200:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003150#line 861 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3151 {
3152 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3153 delete (yyvsp[0].String);
3154 (yyval.String) = (yyvsp[-2].String);
3155 ;}
3156 break;
3157
3158 case 201:
3159#line 866 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3160 {
3161 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3162 delete (yyvsp[0].String);
3163 (yyval.String) = (yyvsp[-2].String);
3164 ;}
3165 break;
3166
3167 case 202:
3168#line 873 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003169 {
3170 (yyvsp[-1].String)->insert(0, "[ ");
3171 *(yyvsp[-1].String) += " ]";
3172 (yyval.String) = (yyvsp[-1].String);
3173 ;}
3174 break;
3175
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003176 case 203:
3177#line 880 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003178 {
3179 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3180 delete (yyvsp[0].String);
3181 (yyval.String) = (yyvsp[-2].String);
3182 ;}
3183 break;
3184
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003185 case 205:
3186#line 886 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003187 {
3188 (yyval.String) = new std::string();
3189 ;}
3190 break;
3191
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003192 case 209:
3193#line 895 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003194 { (yyval.String) = new std::string(); ;}
3195 break;
3196
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003197 case 210:
3198#line 897 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003199 {
3200 (yyval.String) = (yyvsp[-1].Type).newTy;
3201 if (!(yyvsp[0].String)->empty())
3202 *(yyval.String) += " " + *(yyvsp[0].String);
3203 delete (yyvsp[0].String);
3204;}
3205 break;
3206
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003207 case 211:
3208#line 904 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003209 {
3210 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3211 delete (yyvsp[0].String);
3212 ;}
3213 break;
3214
Jim Laskey2792cfb2006-12-06 11:03:10 +00003215 case 212:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003216#line 908 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3217 {
3218 (yyval.String) = (yyvsp[0].String);
3219 ;}
3220 break;
3221
3222 case 213:
3223#line 912 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3224 {
3225 (yyval.String) = (yyvsp[0].String);
3226 ;}
3227 break;
3228
3229 case 214:
3230#line 915 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003231 {
3232 *(yyvsp[-2].String) += ", ...";
3233 (yyval.String) = (yyvsp[-2].String);
3234 delete (yyvsp[0].String);
3235 ;}
3236 break;
3237
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003238 case 215:
3239#line 920 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003240 {
3241 (yyval.String) = (yyvsp[0].String);
3242 ;}
3243 break;
3244
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003245 case 216:
3246#line 923 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003247 { (yyval.String) = new std::string(); ;}
3248 break;
3249
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003250 case 217:
3251#line 926 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003252 {
3253 if (!(yyvsp[-7].String)->empty()) {
3254 *(yyvsp[-7].String) += " ";
Reid Spencere77e35e2006-12-01 20:26:20 +00003255 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003256 *(yyvsp[-7].String) += *(yyvsp[-6].Type).newTy + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
3257 if (!(yyvsp[-1].String)->empty()) {
3258 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003259 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003260 if (!(yyvsp[0].String)->empty()) {
3261 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003262 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003263 (yyvsp[-6].Type).destroy();
3264 delete (yyvsp[-5].String);
3265 delete (yyvsp[-3].String);
3266 delete (yyvsp[-1].String);
3267 delete (yyvsp[0].String);
3268 (yyval.String) = (yyvsp[-7].String);
3269 ;}
3270 break;
3271
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003272 case 218:
3273#line 945 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003274 { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
3275 break;
3276
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003277 case 219:
3278#line 946 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003279 { (yyval.String) = new std::string ("{"); ;}
3280 break;
3281
Jim Laskey2792cfb2006-12-06 11:03:10 +00003282 case 220:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003283#line 949 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3284 {
3285 *O << "define ";
3286 if (!(yyvsp[-2].String)->empty()) {
3287 *O << *(yyvsp[-2].String) << ' ';
3288 }
3289 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3290 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3291 (yyval.String) = 0;
3292 ;}
Jim Laskey2792cfb2006-12-06 11:03:10 +00003293 break;
3294
3295 case 221:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003296#line 958 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3297 {
3298 *O << *(yyvsp[-3].String) << ' ';
3299 if (!(yyvsp[-2].String)->empty()) {
3300 *O << *(yyvsp[-2].String) << ' ';
3301 }
3302 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3303 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3304 (yyval.String) = 0;
3305 ;}
3306 break;
3307
3308 case 222:
3309#line 969 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3310 { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
3311 break;
3312
3313 case 223:
3314#line 970 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3315 { (yyval.String) = new std::string("}"); ;}
3316 break;
3317
3318 case 224:
3319#line 972 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003320 {
3321 if ((yyvsp[-1].String))
3322 *O << *(yyvsp[-1].String);
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003323 *O << '\n' << *(yyvsp[0].String) << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003324 (yyval.String) = 0;
3325;}
3326 break;
3327
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003328 case 225:
3329#line 980 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003330 { (yyval.String) = new std::string(); ;}
3331 break;
3332
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003333 case 228:
3334#line 986 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003335 {
3336 if (!(yyvsp[-1].String)->empty())
3337 *(yyvsp[-2].String) += " " + *(yyvsp[-1].String);
3338 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3339 delete (yyvsp[-1].String);
3340 delete (yyvsp[0].String);
3341 (yyval.String) = (yyvsp[-2].String);
3342 ;}
3343 break;
3344
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003345 case 229:
3346#line 999 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003347 { (yyval.String) = new std::string(); ;}
3348 break;
3349
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003350 case 239:
3351#line 1005 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003352 {
3353 (yyvsp[-1].String)->insert(0, "<");
3354 *(yyvsp[-1].String) += ">";
3355 (yyval.String) = (yyvsp[-1].String);
3356 ;}
3357 break;
3358
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003359 case 241:
3360#line 1011 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003361 {
3362 if (!(yyvsp[-3].String)->empty()) {
3363 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003364 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003365 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
3366 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3367 (yyval.String) = (yyvsp[-4].String);
3368 ;}
3369 break;
3370
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003371 case 244:
3372#line 1024 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003373 {
3374 (yyval.Value).val = (yyvsp[0].String);
3375 (yyval.Value).constant = false;
3376 (yyval.Value).type.newTy = 0;
3377 (yyval.Value).type.oldTy = UnresolvedTy;
3378 ;}
3379 break;
3380
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003381 case 245:
3382#line 1030 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003383 {
3384 (yyval.Value).val = (yyvsp[0].String);
3385 (yyval.Value).constant = true;
3386 (yyval.Value).type.newTy = 0;
3387 (yyval.Value).type.oldTy = UnresolvedTy;
3388 ;}
3389 break;
3390
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003391 case 246:
3392#line 1041 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003393 {
3394 (yyval.Value) = (yyvsp[0].Value);
3395 (yyval.Value).type = (yyvsp[-1].Type);
3396 (yyval.Value).val->insert(0, *(yyvsp[-1].Type).newTy + " ");
3397 ;}
3398 break;
3399
Jim Laskey2792cfb2006-12-06 11:03:10 +00003400 case 247:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003401#line 1047 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003402 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003403 (yyval.String) = 0;
3404 ;}
3405 break;
3406
3407 case 248:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003408#line 1050 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3409 { // Do not allow functions with 0 basic blocks
Jim Laskey2792cfb2006-12-06 11:03:10 +00003410 (yyval.String) = 0;
3411 ;}
3412 break;
3413
3414 case 249:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003415#line 1058 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003416 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003417 (yyval.String) = 0;
3418 ;}
3419 break;
3420
3421 case 250:
3422#line 1062 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3423 {
3424 *O << " " << *(yyvsp[0].String) << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003425 delete (yyvsp[0].String);
3426 (yyval.String) = 0;
3427 ;}
3428 break;
3429
3430 case 251:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003431#line 1067 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3432 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003433 (yyval.String) = 0;
3434 ;}
3435 break;
3436
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003437 case 252:
3438#line 1070 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3439 {
3440 *O << *(yyvsp[0].String) << '\n';
3441 delete (yyvsp[0].String);
Jim Laskey2792cfb2006-12-06 11:03:10 +00003442 (yyval.String) = 0;
3443 ;}
3444 break;
3445
3446 case 254:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003447#line 1076 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3448 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
3449 break;
3450
3451 case 255:
3452#line 1078 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3453 { // Return with a result...
3454 *O << " " << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].Value).val << '\n';
3455 delete (yyvsp[-1].String); (yyvsp[0].Value).destroy();
3456 (yyval.String) = 0;
3457 ;}
3458 break;
3459
3460 case 256:
3461#line 1083 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3462 { // Return with no result...
3463 *O << " " << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].Type).newTy << '\n';
3464 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
3465 (yyval.String) = 0;
3466 ;}
3467 break;
3468
3469 case 257:
3470#line 1088 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003471 { // Unconditional Branch...
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003472 *O << " " << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Type).newTy << ' ' << *(yyvsp[0].Value).val << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003473 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3474 (yyval.String) = 0;
3475 ;}
3476 break;
3477
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003478 case 258:
3479#line 1093 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003480 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003481 *O << " " << *(yyvsp[-8].String) << ' ' << *(yyvsp[-7].Type).newTy << ' ' << *(yyvsp[-6].Value).val << ", "
3482 << *(yyvsp[-4].Type).newTy << ' ' << *(yyvsp[-3].Value).val << ", " << *(yyvsp[-1].Type).newTy << ' '
3483 << *(yyvsp[0].Value).val << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003484 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3485 (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3486 (yyval.String) = 0;
3487 ;}
3488 break;
3489
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003490 case 259:
3491#line 1101 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003492 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003493 *O << " " << *(yyvsp[-8].String) << ' ' << *(yyvsp[-7].Type).newTy << ' ' << *(yyvsp[-6].Value).val << ", "
3494 << *(yyvsp[-4].Type).newTy << ' ' << *(yyvsp[-3].Value).val << " [" << *(yyvsp[-1].String) << " ]\n";
Jim Laskey2792cfb2006-12-06 11:03:10 +00003495 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3496 delete (yyvsp[-1].String);
3497 (yyval.String) = 0;
3498 ;}
3499 break;
3500
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003501 case 260:
3502#line 1108 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003503 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003504 *O << " " << *(yyvsp[-7].String) << ' ' << *(yyvsp[-6].Type).newTy << ' ' << *(yyvsp[-5].Value).val << ", "
3505 << *(yyvsp[-3].Type).newTy << ' ' << *(yyvsp[-2].Value).val << "[]\n";
Jim Laskey2792cfb2006-12-06 11:03:10 +00003506 delete (yyvsp[-7].String); (yyvsp[-6].Type).destroy(); (yyvsp[-5].Value).destroy(); (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy();
3507 (yyval.String) = 0;
3508 ;}
3509 break;
3510
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003511 case 261:
3512#line 1115 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003513 {
Reid Spencer16244f42006-12-01 21:10:07 +00003514 *O << " ";
Jim Laskey2792cfb2006-12-06 11:03:10 +00003515 if (!(yyvsp[-13].String)->empty())
3516 *O << *(yyvsp[-13].String) << " = ";
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003517 *O << *(yyvsp[-12].String) << ' ' << *(yyvsp[-11].String) << ' ' << *(yyvsp[-10].Type).newTy << ' ' << *(yyvsp[-9].Value).val << " (";
Jim Laskey2792cfb2006-12-06 11:03:10 +00003518 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
3519 ValueInfo& VI = (*(yyvsp[-7].ValList))[i];
Reid Spencerf8483652006-12-02 15:16:01 +00003520 *O << *VI.val;
Jim Laskey2792cfb2006-12-06 11:03:10 +00003521 if (i+1 < (yyvsp[-7].ValList)->size())
Reid Spencerf8483652006-12-02 15:16:01 +00003522 *O << ", ";
3523 VI.destroy();
3524 }
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003525 *O << ") " << *(yyvsp[-5].String) << ' ' << *(yyvsp[-4].Type).newTy << ' ' << *(yyvsp[-3].Value).val << ' '
3526 << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Type).newTy << ' ' << *(yyvsp[0].Value).val << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003527 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); (yyvsp[-10].Type).destroy(); (yyvsp[-9].Value).destroy(); delete (yyvsp[-7].ValList);
3528 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
3529 (yyvsp[0].Value).destroy();
3530 (yyval.String) = 0;
3531 ;}
3532 break;
3533
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003534 case 262:
3535#line 1134 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003536 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003537 *O << " " << *(yyvsp[0].String) << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003538 delete (yyvsp[0].String);
3539 (yyval.String) = 0;
3540 ;}
3541 break;
3542
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003543 case 263:
3544#line 1139 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003545 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003546 *O << " " << *(yyvsp[0].String) << '\n';
Jim Laskey2792cfb2006-12-06 11:03:10 +00003547 delete (yyvsp[0].String);
3548 (yyval.String) = 0;
3549 ;}
3550 break;
3551
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003552 case 264:
3553#line 1145 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003554 {
3555 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].String) + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3556 (yyvsp[-4].Type).destroy(); delete (yyvsp[-3].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3557 (yyval.String) = (yyvsp[-5].String);
3558 ;}
3559 break;
3560
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003561 case 265:
3562#line 1150 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003563 {
3564 (yyvsp[-3].String)->insert(0, *(yyvsp[-4].Type).newTy + " " );
3565 *(yyvsp[-3].String) += ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3566 (yyvsp[-4].Type).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3567 (yyval.String) = (yyvsp[-3].String);
3568 ;}
3569 break;
3570
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003571 case 266:
3572#line 1158 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003573 {
3574 if (!(yyvsp[-1].String)->empty())
3575 *(yyvsp[-1].String) += " = ";
3576 *(yyvsp[-1].String) += *(yyvsp[0].String);
3577 delete (yyvsp[0].String);
3578 (yyval.String) = (yyvsp[-1].String);
3579 ;}
3580 break;
3581
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003582 case 267:
3583#line 1167 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003584 { // Used for PHI nodes
3585 (yyvsp[-3].Value).val->insert(0, *(yyvsp[-5].Type).newTy + "[");
3586 *(yyvsp[-3].Value).val += "," + *(yyvsp[-1].Value).val + "]";
3587 (yyvsp[-5].Type).destroy(); (yyvsp[-1].Value).destroy();
3588 (yyval.String) = new std::string(*(yyvsp[-3].Value).val);
3589 (yyvsp[-3].Value).destroy();
3590 ;}
3591 break;
3592
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003593 case 268:
3594#line 1174 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003595 {
3596 *(yyvsp[-6].String) += ", [" + *(yyvsp[-3].Value).val + "," + *(yyvsp[-1].Value).val + "]";
3597 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
3598 (yyval.String) = (yyvsp[-6].String);
3599 ;}
3600 break;
3601
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003602 case 269:
3603#line 1182 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003604 {
3605 (yyval.ValList) = new ValueList();
3606 (yyval.ValList)->push_back((yyvsp[0].Value));
3607 ;}
3608 break;
3609
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003610 case 270:
3611#line 1186 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003612 {
3613 (yyvsp[-2].ValList)->push_back((yyvsp[0].Value));
3614 (yyval.ValList) = (yyvsp[-2].ValList);
3615 ;}
3616 break;
3617
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003618 case 271:
3619#line 1193 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003620 { (yyval.ValList) = (yyvsp[0].ValList); ;}
3621 break;
3622
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003623 case 272:
3624#line 1194 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003625 { (yyval.ValList) = new ValueList(); ;}
3626 break;
3627
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003628 case 273:
3629#line 1198 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003630 {
3631 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3632 delete (yyvsp[0].String);
3633 (yyval.String) = (yyvsp[-1].String);
3634 ;}
3635 break;
3636
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003637 case 275:
3638#line 1206 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003639 {
3640 const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Type));
3641 (yyval.String) = new std::string(op);
3642 *(yyval.String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3643 delete (yyvsp[-4].String); (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3644 ;}
3645 break;
3646
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003647 case 276:
3648#line 1212 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003649 {
3650 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3651 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3652 (yyval.String) = (yyvsp[-4].String);
3653 ;}
3654 break;
3655
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003656 case 277:
3657#line 1217 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003658 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003659 *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Type));
Jim Laskey2792cfb2006-12-06 11:03:10 +00003660 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3661 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3662 (yyval.String) = (yyvsp[-4].String);
3663 ;}
3664 break;
3665
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003666 case 278:
3667#line 1223 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003668 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003669 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + "," + *(yyvsp[0].Value).val;
3670 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3671 (yyval.String) = (yyvsp[-5].String);
Jim Laskey2792cfb2006-12-06 11:03:10 +00003672 ;}
3673 break;
3674
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003675 case 279:
3676#line 1228 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003677 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003678 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + "," + *(yyvsp[0].Value).val;
3679 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3680 (yyval.String) = (yyvsp[-5].String);
Jim Laskey2792cfb2006-12-06 11:03:10 +00003681 ;}
3682 break;
3683
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003684 case 280:
3685#line 1233 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003686 {
3687 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3688 (yyvsp[0].Value).destroy();
3689 (yyval.String) = (yyvsp[-1].String);
3690 ;}
3691 break;
3692
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003693 case 281:
3694#line 1238 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003695 {
3696 const char* shiftop = (yyvsp[-3].String)->c_str();
3697 if (*(yyvsp[-3].String) == "shr")
3698 shiftop = ((yyvsp[-2].Value).type.isUnsigned()) ? "lshr" : "ashr";
3699 (yyval.String) = new std::string(shiftop);
3700 *(yyval.String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3701 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3702 ;}
3703 break;
3704
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003705 case 282:
3706#line 1246 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003707 {
3708 std::string source = *(yyvsp[-2].Value).val;
3709 TypeInfo SrcTy = (yyvsp[-2].Value).type;
3710 TypeInfo DstTy = (yyvsp[0].Type);
Reid Spencera50d5962006-12-02 04:11:07 +00003711 ResolveType(DstTy);
Jim Laskey2792cfb2006-12-06 11:03:10 +00003712 (yyval.String) = new std::string();
3713 if (*(yyvsp[-3].String) == "cast") {
3714 *(yyval.String) += getCastUpgrade(source, SrcTy, DstTy, false);
Reid Spencera50d5962006-12-02 04:11:07 +00003715 } else {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003716 *(yyval.String) += *(yyvsp[-3].String) + " " + source + " to " + *DstTy.newTy;
Reid Spencer280d8012006-12-01 23:40:53 +00003717 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003718 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy();
3719 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
3720 ;}
3721 break;
3722
Jim Laskey2792cfb2006-12-06 11:03:10 +00003723 case 283:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003724#line 1260 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003725 {
3726 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3727 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3728 (yyval.String) = (yyvsp[-5].String);
3729 ;}
3730 break;
3731
3732 case 284:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003733#line 1265 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3734 {
3735 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Type).newTy;
3736 (yyvsp[-2].Value).destroy(); (yyvsp[0].Type).destroy();
3737 (yyval.String) = (yyvsp[-3].String);
3738 ;}
3739 break;
3740
3741 case 285:
3742#line 1270 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3743 {
3744 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3745 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3746 (yyval.String) = (yyvsp[-3].String);
3747 ;}
3748 break;
3749
3750 case 286:
3751#line 1275 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003752 {
3753 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3754 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3755 (yyval.String) = (yyvsp[-5].String);
3756 ;}
3757 break;
3758
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003759 case 287:
3760#line 1280 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3761 {
3762 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3763 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3764 (yyval.String) = (yyvsp[-5].String);
3765 ;}
3766 break;
3767
3768 case 288:
3769#line 1285 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003770 {
3771 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3772 delete (yyvsp[0].String);
3773 (yyval.String) = (yyvsp[-1].String);
3774 ;}
3775 break;
3776
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003777 case 289:
3778#line 1290 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003779 {
3780 if (!(yyvsp[-5].String)->empty())
3781 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
3782 if (!(yyvsp[-6].String)->empty())
3783 *(yyvsp[-6].String) += " ";
3784 *(yyvsp[-6].String) += *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].Value).val + "(";
3785 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3786 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
3787 *(yyvsp[-6].String) += *VI.val;
3788 if (i+1 < (yyvsp[-1].ValList)->size())
3789 *(yyvsp[-6].String) += ", ";
Reid Spencerf8483652006-12-02 15:16:01 +00003790 VI.destroy();
3791 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003792 *(yyvsp[-6].String) += ")";
3793 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].ValList);
3794 (yyval.String) = (yyvsp[-6].String);
3795 ;}
3796 break;
3797
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003798 case 291:
3799#line 1312 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003800 { (yyval.ValList) = (yyvsp[0].ValList); ;}
3801 break;
3802
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003803 case 292:
3804#line 1313 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003805 { (yyval.ValList) = new ValueList(); ;}
3806 break;
3807
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003808 case 294:
3809#line 1318 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003810 { (yyval.String) = new std::string(); ;}
3811 break;
3812
Jim Laskey2792cfb2006-12-06 11:03:10 +00003813 case 295:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003814#line 1321 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003815 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003816 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
Jim Laskey2792cfb2006-12-06 11:03:10 +00003817 if (!(yyvsp[0].String)->empty())
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003818 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3819 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3820 (yyval.String) = (yyvsp[-2].String);
Jim Laskey2792cfb2006-12-06 11:03:10 +00003821 ;}
3822 break;
3823
3824 case 296:
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003825#line 1328 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3826 {
3827 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
3828 if (!(yyvsp[0].String)->empty())
3829 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
3830 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
3831 (yyval.String) = (yyvsp[-5].String);
3832 ;}
3833 break;
3834
3835 case 297:
3836#line 1335 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3837 {
3838 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
3839 if (!(yyvsp[0].String)->empty())
3840 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3841 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3842 (yyval.String) = (yyvsp[-2].String);
3843 ;}
3844 break;
3845
3846 case 298:
3847#line 1342 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
3848 {
3849 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
3850 if (!(yyvsp[0].String)->empty())
3851 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
3852 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
3853 (yyval.String) = (yyvsp[-5].String);
3854 ;}
3855 break;
3856
3857 case 299:
3858#line 1349 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003859 {
3860 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3861 (yyvsp[0].Value).destroy();
3862 (yyval.String) = (yyvsp[-1].String);
3863 ;}
3864 break;
3865
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003866 case 300:
3867#line 1354 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003868 {
3869 if (!(yyvsp[-3].String)->empty())
3870 *(yyvsp[-3].String) += " ";
3871 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3872 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3873 (yyval.String) = (yyvsp[-3].String);
3874 ;}
3875 break;
3876
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003877 case 301:
3878#line 1361 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003879 {
3880 if (!(yyvsp[-5].String)->empty())
3881 *(yyvsp[-5].String) += " ";
3882 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3883 delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3884 (yyval.String) = (yyvsp[-5].String);
3885 ;}
3886 break;
3887
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003888 case 302:
3889#line 1368 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003890 {
Reid Spencerf459d392006-12-02 16:19:52 +00003891 // Upgrade the indices
Jim Laskey2792cfb2006-12-06 11:03:10 +00003892 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3893 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
Reid Spencerf459d392006-12-02 16:19:52 +00003894 if (VI.type.isUnsigned() && !VI.isConstant() &&
3895 VI.type.getBitWidth() < 64) {
3896 std::string* old = VI.val;
3897 *O << " %gep_upgrade" << unique << " = zext " << *old
3898 << " to ulong\n";
3899 VI.val = new std::string("ulong %gep_upgrade" + llvm::utostr(unique++));
3900 VI.type.oldTy = ULongTy;
3901 delete old;
3902 }
3903 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003904 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
3905 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3906 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
3907 *(yyvsp[-3].String) += ", " + *VI.val;
Reid Spencerf8483652006-12-02 15:16:01 +00003908 VI.destroy();
3909 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003910 (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].ValList);
3911 (yyval.String) = (yyvsp[-3].String);
3912 ;}
3913 break;
3914
3915
3916 default: break;
3917 }
3918
3919/* Line 1126 of yacc.c. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003920#line 3921 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +00003921
3922 yyvsp -= yylen;
3923 yyssp -= yylen;
3924
Jim Laskey2792cfb2006-12-06 11:03:10 +00003925
3926 YY_STACK_PRINT (yyss, yyssp);
Reid Spencere7c3c602006-11-30 06:36:44 +00003927
3928 *++yyvsp = yyval;
3929
3930
Jim Laskey2792cfb2006-12-06 11:03:10 +00003931 /* Now `shift' the result of the reduction. Determine what state
3932 that goes to, based on the state we popped back to and the rule
3933 number reduced by. */
Reid Spencere7c3c602006-11-30 06:36:44 +00003934
3935 yyn = yyr1[yyn];
3936
Jim Laskey2792cfb2006-12-06 11:03:10 +00003937 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3938 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Reid Spencere7c3c602006-11-30 06:36:44 +00003939 yystate = yytable[yystate];
3940 else
Jim Laskey2792cfb2006-12-06 11:03:10 +00003941 yystate = yydefgoto[yyn - YYNTOKENS];
Reid Spencere7c3c602006-11-30 06:36:44 +00003942
3943 goto yynewstate;
3944
3945
Jim Laskey2792cfb2006-12-06 11:03:10 +00003946/*------------------------------------.
3947| yyerrlab -- here on detecting error |
3948`------------------------------------*/
3949yyerrlab:
3950 /* If not already recovering from an error, report this error. */
3951 if (!yyerrstatus)
Reid Spencere7c3c602006-11-30 06:36:44 +00003952 {
3953 ++yynerrs;
Jim Laskey2792cfb2006-12-06 11:03:10 +00003954#if YYERROR_VERBOSE
Reid Spencere7c3c602006-11-30 06:36:44 +00003955 yyn = yypact[yystate];
3956
Jim Laskey2792cfb2006-12-06 11:03:10 +00003957 if (YYPACT_NINF < yyn && yyn < YYLAST)
Reid Spencere7c3c602006-11-30 06:36:44 +00003958 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003959 int yytype = YYTRANSLATE (yychar);
3960 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3961 YYSIZE_T yysize = yysize0;
3962 YYSIZE_T yysize1;
3963 int yysize_overflow = 0;
3964 char *yymsg = 0;
3965# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
3966 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3967 int yyx;
Reid Spencere7c3c602006-11-30 06:36:44 +00003968
Jim Laskey2792cfb2006-12-06 11:03:10 +00003969#if 0
3970 /* This is so xgettext sees the translatable formats that are
3971 constructed on the fly. */
3972 YY_("syntax error, unexpected %s");
3973 YY_("syntax error, unexpected %s, expecting %s");
3974 YY_("syntax error, unexpected %s, expecting %s or %s");
3975 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3976 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3977#endif
3978 char *yyfmt;
3979 char const *yyf;
3980 static char const yyunexpected[] = "syntax error, unexpected %s";
3981 static char const yyexpecting[] = ", expecting %s";
3982 static char const yyor[] = " or %s";
3983 char yyformat[sizeof yyunexpected
3984 + sizeof yyexpecting - 1
3985 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3986 * (sizeof yyor - 1))];
3987 char const *yyprefix = yyexpecting;
3988
3989 /* Start YYX at -YYN if negative to avoid negative indexes in
3990 YYCHECK. */
3991 int yyxbegin = yyn < 0 ? -yyn : 0;
3992
3993 /* Stay within bounds of both yycheck and yytname. */
3994 int yychecklim = YYLAST - yyn;
3995 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3996 int yycount = 1;
3997
3998 yyarg[0] = yytname[yytype];
3999 yyfmt = yystpcpy (yyformat, yyunexpected);
4000
4001 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4002 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4003 {
4004 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4005 {
4006 yycount = 1;
4007 yysize = yysize0;
4008 yyformat[sizeof yyunexpected - 1] = '\0';
4009 break;
4010 }
4011 yyarg[yycount++] = yytname[yyx];
4012 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4013 yysize_overflow |= yysize1 < yysize;
4014 yysize = yysize1;
4015 yyfmt = yystpcpy (yyfmt, yyprefix);
4016 yyprefix = yyor;
4017 }
4018
4019 yyf = YY_(yyformat);
4020 yysize1 = yysize + yystrlen (yyf);
4021 yysize_overflow |= yysize1 < yysize;
4022 yysize = yysize1;
4023
4024 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
4025 yymsg = (char *) YYSTACK_ALLOC (yysize);
4026 if (yymsg)
Reid Spencere7c3c602006-11-30 06:36:44 +00004027 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00004028 /* Avoid sprintf, as that infringes on the user's name space.
4029 Don't have undefined behavior even if the translation
4030 produced a string with the wrong number of "%s"s. */
4031 char *yyp = yymsg;
4032 int yyi = 0;
4033 while ((*yyp = *yyf))
Reid Spencere7c3c602006-11-30 06:36:44 +00004034 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00004035 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4036 {
4037 yyp += yytnamerr (yyp, yyarg[yyi++]);
4038 yyf += 2;
4039 }
4040 else
4041 {
4042 yyp++;
4043 yyf++;
4044 }
Reid Spencere7c3c602006-11-30 06:36:44 +00004045 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00004046 yyerror (yymsg);
4047 YYSTACK_FREE (yymsg);
Reid Spencere7c3c602006-11-30 06:36:44 +00004048 }
4049 else
Jim Laskey2792cfb2006-12-06 11:03:10 +00004050 {
4051 yyerror (YY_("syntax error"));
4052 goto yyexhaustedlab;
4053 }
Reid Spencere7c3c602006-11-30 06:36:44 +00004054 }
4055 else
4056#endif /* YYERROR_VERBOSE */
Jim Laskey2792cfb2006-12-06 11:03:10 +00004057 yyerror (YY_("syntax error"));
Reid Spencere7c3c602006-11-30 06:36:44 +00004058 }
4059
Jim Laskey2792cfb2006-12-06 11:03:10 +00004060
Reid Spencere7c3c602006-11-30 06:36:44 +00004061
4062 if (yyerrstatus == 3)
4063 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00004064 /* If just tried and failed to reuse look-ahead token after an
4065 error, discard it. */
Reid Spencere7c3c602006-11-30 06:36:44 +00004066
Jim Laskey2792cfb2006-12-06 11:03:10 +00004067 if (yychar <= YYEOF)
4068 {
4069 /* Return failure if at end of input. */
4070 if (yychar == YYEOF)
4071 YYABORT;
4072 }
4073 else
4074 {
4075 yydestruct ("Error: discarding", yytoken, &yylval);
4076 yychar = YYEMPTY;
4077 }
4078 }
4079
4080 /* Else will try to reuse look-ahead token after shifting the error
4081 token. */
4082 goto yyerrlab1;
4083
4084
4085/*---------------------------------------------------.
4086| yyerrorlab -- error raised explicitly by YYERROR. |
4087`---------------------------------------------------*/
4088yyerrorlab:
4089
4090 /* Pacify compilers like GCC when the user code never invokes
4091 YYERROR and the label yyerrorlab therefore never appears in user
4092 code. */
4093 if (0)
4094 goto yyerrorlab;
4095
4096yyvsp -= yylen;
4097 yyssp -= yylen;
4098 yystate = *yyssp;
4099 goto yyerrlab1;
4100
4101
4102/*-------------------------------------------------------------.
4103| yyerrlab1 -- common code for both syntax error and YYERROR. |
4104`-------------------------------------------------------------*/
4105yyerrlab1:
4106 yyerrstatus = 3; /* Each real token shifted decrements this. */
4107
4108 for (;;)
4109 {
4110 yyn = yypact[yystate];
4111 if (yyn != YYPACT_NINF)
4112 {
4113 yyn += YYTERROR;
4114 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4115 {
4116 yyn = yytable[yyn];
4117 if (0 < yyn)
4118 break;
4119 }
4120 }
4121
4122 /* Pop the current state because it cannot handle the error token. */
4123 if (yyssp == yyss)
Reid Spencere7c3c602006-11-30 06:36:44 +00004124 YYABORT;
4125
4126
Jim Laskey2792cfb2006-12-06 11:03:10 +00004127 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4128 YYPOPSTACK;
4129 yystate = *yyssp;
4130 YY_STACK_PRINT (yyss, yyssp);
Reid Spencere7c3c602006-11-30 06:36:44 +00004131 }
4132
4133 if (yyn == YYFINAL)
4134 YYACCEPT;
4135
4136 *++yyvsp = yylval;
Jim Laskey2792cfb2006-12-06 11:03:10 +00004137
4138
4139 /* Shift the error token. */
4140 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
Reid Spencere7c3c602006-11-30 06:36:44 +00004141
4142 yystate = yyn;
4143 goto yynewstate;
4144
Jim Laskey98ba5882006-12-06 10:57:33 +00004145
Jim Laskey2792cfb2006-12-06 11:03:10 +00004146/*-------------------------------------.
4147| yyacceptlab -- YYACCEPT comes here. |
4148`-------------------------------------*/
4149yyacceptlab:
4150 yyresult = 0;
4151 goto yyreturn;
4152
4153/*-----------------------------------.
4154| yyabortlab -- YYABORT comes here. |
4155`-----------------------------------*/
4156yyabortlab:
4157 yyresult = 1;
4158 goto yyreturn;
4159
4160#ifndef yyoverflow
4161/*-------------------------------------------------.
4162| yyexhaustedlab -- memory exhaustion comes here. |
4163`-------------------------------------------------*/
4164yyexhaustedlab:
4165 yyerror (YY_("memory exhausted"));
4166 yyresult = 2;
4167 /* Fall through. */
Jim Laskey98ba5882006-12-06 10:57:33 +00004168#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00004169
4170yyreturn:
4171 if (yychar != YYEOF && yychar != YYEMPTY)
4172 yydestruct ("Cleanup: discarding lookahead",
4173 yytoken, &yylval);
4174 while (yyssp != yyss)
4175 {
4176 yydestruct ("Cleanup: popping",
4177 yystos[*yyssp], yyvsp);
4178 YYPOPSTACK;
Jim Laskey98ba5882006-12-06 10:57:33 +00004179 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00004180#ifndef yyoverflow
4181 if (yyss != yyssa)
4182 YYSTACK_FREE (yyss);
4183#endif
4184 return yyresult;
Reid Spencere7c3c602006-11-30 06:36:44 +00004185}
Jim Laskey2792cfb2006-12-06 11:03:10 +00004186
4187
Reid Spencer6fd36ab2006-12-29 20:35:03 +00004188#line 1392 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00004189
4190
4191int yyerror(const char *ErrorMsg) {
4192 std::string where
4193 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4194 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4195 std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
4196 if (yychar == YYEMPTY || yychar == 0)
4197 errMsg += "end-of-file.";
4198 else
4199 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4200 std::cerr << errMsg << '\n';
4201 exit(1);
4202}
Jim Laskey2792cfb2006-12-06 11:03:10 +00004203