blob: debb995a7943cef5b003076233c8d24a32fe62f4 [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,
99 GLOBAL = 290,
100 CONSTANT = 291,
101 SECTION = 292,
102 VOLATILE = 293,
103 TO = 294,
104 DOTDOTDOT = 295,
105 CONST = 296,
106 INTERNAL = 297,
107 LINKONCE = 298,
108 WEAK = 299,
109 DLLIMPORT = 300,
110 DLLEXPORT = 301,
111 EXTERN_WEAK = 302,
112 APPENDING = 303,
113 NOT = 304,
114 EXTERNAL = 305,
115 TARGET = 306,
116 TRIPLE = 307,
117 ENDIAN = 308,
118 POINTERSIZE = 309,
119 LITTLE = 310,
120 BIG = 311,
121 ALIGN = 312,
122 UNINITIALIZED = 313,
123 DEPLIBS = 314,
124 CALL = 315,
125 TAIL = 316,
126 ASM_TOK = 317,
127 MODULE = 318,
128 SIDEEFFECT = 319,
129 CC_TOK = 320,
130 CCC_TOK = 321,
131 CSRETCC_TOK = 322,
132 FASTCC_TOK = 323,
133 COLDCC_TOK = 324,
134 X86_STDCALLCC_TOK = 325,
135 X86_FASTCALLCC_TOK = 326,
136 DATALAYOUT = 327,
137 RET = 328,
138 BR = 329,
139 SWITCH = 330,
140 INVOKE = 331,
141 EXCEPT = 332,
142 UNWIND = 333,
143 UNREACHABLE = 334,
144 ADD = 335,
145 SUB = 336,
146 MUL = 337,
147 DIV = 338,
148 UDIV = 339,
149 SDIV = 340,
150 FDIV = 341,
151 REM = 342,
152 UREM = 343,
153 SREM = 344,
154 FREM = 345,
155 AND = 346,
156 OR = 347,
157 XOR = 348,
158 SETLE = 349,
159 SETGE = 350,
160 SETLT = 351,
161 SETGT = 352,
162 SETEQ = 353,
163 SETNE = 354,
164 ICMP = 355,
165 FCMP = 356,
166 EQ = 357,
167 NE = 358,
168 SLT = 359,
169 SGT = 360,
170 SLE = 361,
171 SGE = 362,
172 OEQ = 363,
173 ONE = 364,
174 OLT = 365,
175 OGT = 366,
176 OLE = 367,
177 OGE = 368,
178 ORD = 369,
179 UNO = 370,
180 UEQ = 371,
181 UNE = 372,
182 ULT = 373,
183 UGT = 374,
184 ULE = 375,
185 UGE = 376,
186 MALLOC = 377,
187 ALLOCA = 378,
188 FREE = 379,
189 LOAD = 380,
190 STORE = 381,
191 GETELEMENTPTR = 382,
192 PHI_TOK = 383,
193 SELECT = 384,
194 SHL = 385,
195 SHR = 386,
196 ASHR = 387,
197 LSHR = 388,
198 VAARG = 389,
199 EXTRACTELEMENT = 390,
200 INSERTELEMENT = 391,
201 SHUFFLEVECTOR = 392,
202 CAST = 393,
203 TRUNC = 394,
204 ZEXT = 395,
205 SEXT = 396,
206 FPTRUNC = 397,
207 FPEXT = 398,
208 FPTOUI = 399,
209 FPTOSI = 400,
210 UITOFP = 401,
211 SITOFP = 402,
212 PTRTOINT = 403,
213 INTTOPTR = 404,
214 BITCAST = 405
215 };
216#endif
217/* Tokens. */
218#define VOID 258
219#define BOOL 259
220#define SBYTE 260
221#define UBYTE 261
222#define SHORT 262
223#define USHORT 263
224#define INT 264
225#define UINT 265
226#define LONG 266
227#define ULONG 267
228#define FLOAT 268
229#define DOUBLE 269
230#define LABEL 270
231#define OPAQUE 271
232#define ESINT64VAL 272
233#define EUINT64VAL 273
234#define SINTVAL 274
235#define UINTVAL 275
236#define FPVAL 276
237#define NULL_TOK 277
238#define UNDEF 278
239#define ZEROINITIALIZER 279
240#define TRUETOK 280
241#define FALSETOK 281
242#define TYPE 282
243#define VAR_ID 283
244#define LABELSTR 284
245#define STRINGCONSTANT 285
246#define IMPLEMENTATION 286
247#define BEGINTOK 287
248#define ENDTOK 288
249#define DECLARE 289
250#define GLOBAL 290
251#define CONSTANT 291
252#define SECTION 292
253#define VOLATILE 293
254#define TO 294
255#define DOTDOTDOT 295
256#define CONST 296
257#define INTERNAL 297
258#define LINKONCE 298
259#define WEAK 299
260#define DLLIMPORT 300
261#define DLLEXPORT 301
262#define EXTERN_WEAK 302
263#define APPENDING 303
264#define NOT 304
265#define EXTERNAL 305
266#define TARGET 306
267#define TRIPLE 307
268#define ENDIAN 308
269#define POINTERSIZE 309
270#define LITTLE 310
271#define BIG 311
272#define ALIGN 312
273#define UNINITIALIZED 313
274#define DEPLIBS 314
275#define CALL 315
276#define TAIL 316
277#define ASM_TOK 317
278#define MODULE 318
279#define SIDEEFFECT 319
280#define CC_TOK 320
281#define CCC_TOK 321
282#define CSRETCC_TOK 322
283#define FASTCC_TOK 323
284#define COLDCC_TOK 324
285#define X86_STDCALLCC_TOK 325
286#define X86_FASTCALLCC_TOK 326
287#define DATALAYOUT 327
288#define RET 328
289#define BR 329
290#define SWITCH 330
291#define INVOKE 331
292#define EXCEPT 332
293#define UNWIND 333
294#define UNREACHABLE 334
295#define ADD 335
296#define SUB 336
297#define MUL 337
298#define DIV 338
299#define UDIV 339
300#define SDIV 340
301#define FDIV 341
302#define REM 342
303#define UREM 343
304#define SREM 344
305#define FREM 345
306#define AND 346
307#define OR 347
308#define XOR 348
309#define SETLE 349
310#define SETGE 350
311#define SETLT 351
312#define SETGT 352
313#define SETEQ 353
314#define SETNE 354
315#define ICMP 355
316#define FCMP 356
317#define EQ 357
318#define NE 358
319#define SLT 359
320#define SGT 360
321#define SLE 361
322#define SGE 362
323#define OEQ 363
324#define ONE 364
325#define OLT 365
326#define OGT 366
327#define OLE 367
328#define OGE 368
329#define ORD 369
330#define UNO 370
331#define UEQ 371
332#define UNE 372
333#define ULT 373
334#define UGT 374
335#define ULE 375
336#define UGE 376
337#define MALLOC 377
338#define ALLOCA 378
339#define FREE 379
340#define LOAD 380
341#define STORE 381
342#define GETELEMENTPTR 382
343#define PHI_TOK 383
344#define SELECT 384
345#define SHL 385
346#define SHR 386
347#define ASHR 387
348#define LSHR 388
349#define VAARG 389
350#define EXTRACTELEMENT 390
351#define INSERTELEMENT 391
352#define SHUFFLEVECTOR 392
353#define CAST 393
354#define TRUNC 394
355#define ZEXT 395
356#define SEXT 396
357#define FPTRUNC 397
358#define FPEXT 398
359#define FPTOUI 399
360#define FPTOSI 400
361#define UITOFP 401
362#define SITOFP 402
363#define PTRTOINT 403
364#define INTTOPTR 404
365#define BITCAST 405
366
367
368
369
370/* Copy the first part of user declarations. */
Reid Spencere4d87aa2006-12-23 06:05:41 +0000371#line 14 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +0000372
Reid Spencere7c3c602006-11-30 06:36:44 +0000373#include "ParserInternals.h"
374#include <llvm/ADT/StringExtras.h>
Reid Spencere7c3c602006-11-30 06:36:44 +0000375#include <algorithm>
Reid Spencera50d5962006-12-02 04:11:07 +0000376#include <map>
Reid Spencere7c3c602006-11-30 06:36:44 +0000377#include <utility>
378#include <iostream>
Reid Spencerbec0b592006-12-03 03:16:48 +0000379#include <cassert>
Reid Spencere7c3c602006-11-30 06:36:44 +0000380
Reid Spencere77e35e2006-12-01 20:26:20 +0000381#define YYERROR_VERBOSE 1
Reid Spencer96839be2006-11-30 16:50:26 +0000382#define YYINCLUDED_STDLIB_H
Reid Spencere77e35e2006-12-01 20:26:20 +0000383#define YYDEBUG 1
Reid Spencere7c3c602006-11-30 06:36:44 +0000384
385int yylex(); // declaration" of xxx warnings.
386int yyparse();
Reid Spencere77e35e2006-12-01 20:26:20 +0000387extern int yydebug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000388
389static std::string CurFilename;
Reid Spencere7c3c602006-11-30 06:36:44 +0000390static std::ostream *O = 0;
Reid Spencer96839be2006-11-30 16:50:26 +0000391std::istream* LexInput = 0;
Reid Spencere77e35e2006-12-01 20:26:20 +0000392unsigned SizeOfPointer = 32;
Reid Spencerf459d392006-12-02 16:19:52 +0000393static uint64_t unique = 1;
Reid Spencer96839be2006-11-30 16:50:26 +0000394
Reid Spencera50d5962006-12-02 04:11:07 +0000395typedef std::vector<TypeInfo> TypeVector;
396static TypeVector EnumeratedTypes;
397typedef std::map<std::string,TypeInfo> TypeMap;
398static TypeMap NamedTypes;
Reid Spencerf12ee422006-12-05 19:21:25 +0000399static TypeMap Globals;
Reid Spencera50d5962006-12-02 04:11:07 +0000400
Reid Spencerf8483652006-12-02 15:16:01 +0000401void destroy(ValueList* VL) {
402 while (!VL->empty()) {
403 ValueInfo& VI = VL->back();
404 VI.destroy();
405 VL->pop_back();
406 }
407 delete VL;
408}
409
Reid Spencer96839be2006-11-30 16:50:26 +0000410void UpgradeAssembly(const std::string &infile, std::istream& in,
Reid Spencere77e35e2006-12-01 20:26:20 +0000411 std::ostream &out, bool debug)
Reid Spencere7c3c602006-11-30 06:36:44 +0000412{
413 Upgradelineno = 1;
414 CurFilename = infile;
Reid Spencer96839be2006-11-30 16:50:26 +0000415 LexInput = &in;
Reid Spencere77e35e2006-12-01 20:26:20 +0000416 yydebug = debug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000417 O = &out;
418
419 if (yyparse()) {
420 std::cerr << "Parse failed.\n";
421 exit(1);
422 }
423}
424
Reid Spencera50d5962006-12-02 04:11:07 +0000425static void ResolveType(TypeInfo& Ty) {
426 if (Ty.oldTy == UnresolvedTy) {
427 TypeMap::iterator I = NamedTypes.find(*Ty.newTy);
Reid Spencer78720742006-12-02 20:21:22 +0000428 if (I != NamedTypes.end()) {
Reid Spencera50d5962006-12-02 04:11:07 +0000429 Ty.oldTy = I->second.oldTy;
Reid Spencer78720742006-12-02 20:21:22 +0000430 Ty.elemTy = I->second.elemTy;
431 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000432 std::string msg("Can't resolve type: ");
433 msg += *Ty.newTy;
434 yyerror(msg.c_str());
Reid Spencer280d8012006-12-01 23:40:53 +0000435 }
Reid Spencera50d5962006-12-02 04:11:07 +0000436 } else if (Ty.oldTy == NumericTy) {
437 unsigned ref = atoi(&((Ty.newTy->c_str())[1])); // Skip the '\\'
438 if (ref < EnumeratedTypes.size()) {
439 Ty.oldTy = EnumeratedTypes[ref].oldTy;
Reid Spencer78720742006-12-02 20:21:22 +0000440 Ty.elemTy = EnumeratedTypes[ref].elemTy;
Reid Spencera50d5962006-12-02 04:11:07 +0000441 } else {
442 std::string msg("Can't resolve type: ");
443 msg += *Ty.newTy;
444 yyerror(msg.c_str());
445 }
Reid Spencer280d8012006-12-01 23:40:53 +0000446 }
Reid Spencera50d5962006-12-02 04:11:07 +0000447 // otherwise its already resolved.
Reid Spencer280d8012006-12-01 23:40:53 +0000448}
449
Reid Spencera50d5962006-12-02 04:11:07 +0000450static const char* getCastOpcode(
451 std::string& Source, const TypeInfo& SrcTy, const TypeInfo& DstTy)
452{
Reid Spencere77e35e2006-12-01 20:26:20 +0000453 unsigned SrcBits = SrcTy.getBitWidth();
454 unsigned DstBits = DstTy.getBitWidth();
455 const char* opcode = "bitcast";
456 // Run through the possibilities ...
457 if (DstTy.isIntegral()) { // Casting to integral
458 if (SrcTy.isIntegral()) { // Casting from integral
459 if (DstBits < SrcBits)
460 opcode = "trunc";
461 else if (DstBits > SrcBits) { // its an extension
462 if (SrcTy.isSigned())
463 opcode ="sext"; // signed -> SEXT
464 else
465 opcode = "zext"; // unsigned -> ZEXT
466 } else {
467 opcode = "bitcast"; // Same size, No-op cast
468 }
469 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
470 if (DstTy.isSigned())
471 opcode = "fptosi"; // FP -> sint
472 else
473 opcode = "fptoui"; // FP -> uint
474 } else if (SrcTy.isPacked()) {
475 assert(DstBits == SrcTy.getBitWidth() &&
476 "Casting packed to integer of different width");
477 opcode = "bitcast"; // same size, no-op cast
478 } else {
479 assert(SrcTy.isPointer() &&
480 "Casting from a value that is not first-class type");
481 opcode = "ptrtoint"; // ptr -> int
482 }
483 } else if (DstTy.isFloatingPoint()) { // Casting to floating pt
484 if (SrcTy.isIntegral()) { // Casting from integral
485 if (SrcTy.isSigned())
486 opcode = "sitofp"; // sint -> FP
487 else
488 opcode = "uitofp"; // uint -> FP
489 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
490 if (DstBits < SrcBits) {
491 opcode = "fptrunc"; // FP -> smaller FP
492 } else if (DstBits > SrcBits) {
493 opcode = "fpext"; // FP -> larger FP
494 } else {
495 opcode ="bitcast"; // same size, no-op cast
496 }
497 } else if (SrcTy.isPacked()) {
498 assert(DstBits == SrcTy.getBitWidth() &&
499 "Casting packed to floating point of different width");
500 opcode = "bitcast"; // same size, no-op cast
501 } else {
502 assert(0 && "Casting pointer or non-first class to float");
503 }
504 } else if (DstTy.isPacked()) {
505 if (SrcTy.isPacked()) {
506 assert(DstTy.getBitWidth() == SrcTy.getBitWidth() &&
507 "Casting packed to packed of different widths");
508 opcode = "bitcast"; // packed -> packed
509 } else if (DstTy.getBitWidth() == SrcBits) {
510 opcode = "bitcast"; // float/int -> packed
511 } else {
512 assert(!"Illegal cast to packed (wrong type or size)");
513 }
514 } else if (DstTy.isPointer()) {
515 if (SrcTy.isPointer()) {
516 opcode = "bitcast"; // ptr -> ptr
517 } else if (SrcTy.isIntegral()) {
518 opcode = "inttoptr"; // int -> ptr
519 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000520 assert(!"Casting invalid type to pointer");
Reid Spencere77e35e2006-12-01 20:26:20 +0000521 }
522 } else {
523 assert(!"Casting to type that is not first-class");
524 }
525 return opcode;
526}
527
Reid Spencera50d5962006-12-02 04:11:07 +0000528static std::string getCastUpgrade(
529 const std::string& Src, TypeInfo& SrcTy, TypeInfo& DstTy, bool isConst)
530{
531 std::string Result;
532 std::string Source = Src;
533 if (SrcTy.isFloatingPoint() && DstTy.isPointer()) {
534 // fp -> ptr cast is no longer supported but we must upgrade this
535 // by doing a double cast: fp -> int -> ptr
536 if (isConst)
537 Source = "ulong fptoui(" + Source + " to ulong)";
538 else {
Reid Spencerf459d392006-12-02 16:19:52 +0000539 *O << " %cast_upgrade" << unique << " = fptoui " << Source
540 << " to ulong\n";
541 Source = "ulong %cast_upgrade" + llvm::utostr(unique);
Reid Spencera50d5962006-12-02 04:11:07 +0000542 }
543 // Update the SrcTy for the getCastOpcode call below
544 SrcTy.destroy();
545 SrcTy.newTy = new std::string("ulong");
546 SrcTy.oldTy = ULongTy;
Reid Spencer5fe27e72006-12-09 19:41:25 +0000547 } else if (DstTy.oldTy == BoolTy && SrcTy.oldTy != BoolTy) {
Reid Spencera50d5962006-12-02 04:11:07 +0000548 // cast ptr %x to bool was previously defined as setne ptr %x, null
549 // The ptrtoint semantic is to truncate, not compare so we must retain
550 // the original intent by replace the cast with a setne
551 const char* comparator = SrcTy.isPointer() ? ", null" :
552 (SrcTy.isFloatingPoint() ? ", 0.0" : ", 0");
Reid Spencere4d87aa2006-12-23 06:05:41 +0000553 const char* compareOp = SrcTy.isFloatingPoint() ? "fcmp one " : "icmp ne ";
Reid Spencer187ccf82006-12-09 16:57:22 +0000554 if (isConst) {
555 Result = "(" + Source + comparator + ")";
556 Result = compareOp + Result;
557 } else
558 Result = compareOp + Source + comparator;
Reid Spencera50d5962006-12-02 04:11:07 +0000559 return Result; // skip cast processing below
560 }
561 ResolveType(SrcTy);
562 ResolveType(DstTy);
563 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
564 if (isConst)
565 Result += Opcode + "( " + Source + " to " + *DstTy.newTy + ")";
566 else
567 Result += Opcode + " " + Source + " to " + *DstTy.newTy;
568 return Result;
569}
570
Reid Spencer78720742006-12-02 20:21:22 +0000571const char* getDivRemOpcode(const std::string& opcode, const TypeInfo& TI) {
572 const char* op = opcode.c_str();
573 TypeInfo Ty = TI;
574 ResolveType(Ty);
575 if (Ty.isPacked())
576 Ty.oldTy = Ty.getElementType();
577 if (opcode == "div")
578 if (Ty.isFloatingPoint())
579 op = "fdiv";
580 else if (Ty.isUnsigned())
581 op = "udiv";
582 else if (Ty.isSigned())
583 op = "sdiv";
584 else
585 yyerror("Invalid type for div instruction");
586 else if (opcode == "rem")
587 if (Ty.isFloatingPoint())
588 op = "frem";
589 else if (Ty.isUnsigned())
590 op = "urem";
591 else if (Ty.isSigned())
592 op = "srem";
593 else
594 yyerror("Invalid type for rem instruction");
595 return op;
596}
Reid Spencere7c3c602006-11-30 06:36:44 +0000597
Reid Spencer229e9362006-12-02 22:14:11 +0000598std::string
599getCompareOp(const std::string& setcc, const TypeInfo& TI) {
600 assert(setcc.length() == 5);
601 char cc1 = setcc[3];
602 char cc2 = setcc[4];
603 assert(cc1 == 'e' || cc1 == 'n' || cc1 == 'l' || cc1 == 'g');
604 assert(cc2 == 'q' || cc2 == 'e' || cc2 == 'e' || cc2 == 't');
605 std::string result("xcmp xxx");
606 result[6] = cc1;
607 result[7] = cc2;
608 if (TI.isFloatingPoint()) {
609 result[0] = 'f';
Reid Spencere4d87aa2006-12-23 06:05:41 +0000610 result[5] = 'o';
Reid Spencerf0cf1322006-12-07 04:23:03 +0000611 if (cc1 == 'n')
612 result[5] = 'u'; // NE maps to unordered
613 else
614 result[5] = 'o'; // everything else maps to ordered
Reid Spencer229e9362006-12-02 22:14:11 +0000615 } else if (TI.isIntegral() || TI.isPointer()) {
616 result[0] = 'i';
617 if ((cc1 == 'e' && cc2 == 'q') || (cc1 == 'n' && cc2 == 'e'))
618 result.erase(5,1);
619 else if (TI.isSigned())
620 result[5] = 's';
Reid Spencer3e5ab8c2006-12-06 06:25:46 +0000621 else if (TI.isUnsigned() || TI.isPointer() || TI.isBool())
Reid Spencer229e9362006-12-02 22:14:11 +0000622 result[5] = 'u';
623 else
624 yyerror("Invalid integral type for setcc");
625 }
626 return result;
627}
628
629
Jim Laskey2792cfb2006-12-06 11:03:10 +0000630
631/* Enabling traces. */
632#ifndef YYDEBUG
633# define YYDEBUG 0
634#endif
635
636/* Enabling verbose error messages. */
637#ifdef YYERROR_VERBOSE
638# undef YYERROR_VERBOSE
639# define YYERROR_VERBOSE 1
640#else
641# define YYERROR_VERBOSE 0
642#endif
643
644/* Enabling the token table. */
645#ifndef YYTOKEN_TABLE
646# define YYTOKEN_TABLE 0
647#endif
648
649#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
Reid Spencere4d87aa2006-12-23 06:05:41 +0000650#line 275 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +0000651typedef union YYSTYPE {
Reid Spencere77e35e2006-12-01 20:26:20 +0000652 std::string* String;
653 TypeInfo Type;
654 ValueInfo Value;
655 ConstInfo Const;
Reid Spencerf8483652006-12-02 15:16:01 +0000656 ValueList* ValList;
Reid Spencere77e35e2006-12-01 20:26:20 +0000657} YYSTYPE;
Jim Laskey2792cfb2006-12-06 11:03:10 +0000658/* Line 196 of yacc.c. */
Reid Spencere4d87aa2006-12-23 06:05:41 +0000659#line 660 "UpgradeParser.tab.c"
Jim Laskey2792cfb2006-12-06 11:03:10 +0000660# define yystype YYSTYPE /* obsolescent; will be withdrawn */
661# define YYSTYPE_IS_DECLARED 1
662# define YYSTYPE_IS_TRIVIAL 1
Reid Spencere7c3c602006-11-30 06:36:44 +0000663#endif
664
665
666
Jim Laskey2792cfb2006-12-06 11:03:10 +0000667/* Copy the second part of user declarations. */
Reid Spencere7c3c602006-11-30 06:36:44 +0000668
669
Jim Laskey2792cfb2006-12-06 11:03:10 +0000670/* Line 219 of yacc.c. */
Reid Spencere4d87aa2006-12-23 06:05:41 +0000671#line 672 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +0000672
Jim Laskey2792cfb2006-12-06 11:03:10 +0000673#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
674# define YYSIZE_T __SIZE_TYPE__
675#endif
676#if ! defined (YYSIZE_T) && defined (size_t)
677# define YYSIZE_T size_t
678#endif
679#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
680# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
681# define YYSIZE_T size_t
682#endif
683#if ! defined (YYSIZE_T)
684# define YYSIZE_T unsigned int
685#endif
Reid Spencere7c3c602006-11-30 06:36:44 +0000686
Jim Laskey2792cfb2006-12-06 11:03:10 +0000687#ifndef YY_
688# if YYENABLE_NLS
689# if ENABLE_NLS
690# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
691# define YY_(msgid) dgettext ("bison-runtime", msgid)
692# endif
693# endif
694# ifndef YY_
695# define YY_(msgid) msgid
696# endif
697#endif
698
699#if ! defined (yyoverflow) || YYERROR_VERBOSE
700
701/* The parser invokes alloca or malloc; define the necessary symbols. */
702
703# ifdef YYSTACK_USE_ALLOCA
704# if YYSTACK_USE_ALLOCA
705# ifdef __GNUC__
706# define YYSTACK_ALLOC __builtin_alloca
707# else
708# define YYSTACK_ALLOC alloca
709# if defined (__STDC__) || defined (__cplusplus)
710# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
711# define YYINCLUDED_STDLIB_H
712# endif
713# endif
714# endif
715# endif
716
717# ifdef YYSTACK_ALLOC
718 /* Pacify GCC's `empty if-body' warning. */
719# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
720# ifndef YYSTACK_ALLOC_MAXIMUM
721 /* The OS might guarantee only one guard page at the bottom of the stack,
722 and a page size can be as small as 4096 bytes. So we cannot safely
723 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
724 to allow for a few compiler-allocated temporary stack slots. */
725# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
726# endif
727# else
728# define YYSTACK_ALLOC YYMALLOC
729# define YYSTACK_FREE YYFREE
730# ifndef YYSTACK_ALLOC_MAXIMUM
731# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
732# endif
733# ifdef __cplusplus
734extern "C" {
735# endif
736# ifndef YYMALLOC
737# define YYMALLOC malloc
738# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
739 && (defined (__STDC__) || defined (__cplusplus)))
740void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
741# endif
742# endif
743# ifndef YYFREE
744# define YYFREE free
745# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
746 && (defined (__STDC__) || defined (__cplusplus)))
747void free (void *); /* INFRINGES ON USER NAME SPACE */
748# endif
749# endif
750# ifdef __cplusplus
751}
752# endif
753# endif
754#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
755
756
757#if (! defined (yyoverflow) \
758 && (! defined (__cplusplus) \
759 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
760
761/* A type that is properly aligned for any stack member. */
762union yyalloc
763{
764 short int yyss;
765 YYSTYPE yyvs;
766 };
767
768/* The size of the maximum gap between one aligned stack and the next. */
769# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
770
771/* The size of an array large to enough to hold all stacks, each with
772 N elements. */
773# define YYSTACK_BYTES(N) \
774 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
775 + YYSTACK_GAP_MAXIMUM)
776
777/* Copy COUNT objects from FROM to TO. The source and destination do
778 not overlap. */
779# ifndef YYCOPY
780# if defined (__GNUC__) && 1 < __GNUC__
781# define YYCOPY(To, From, Count) \
782 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
783# else
784# define YYCOPY(To, From, Count) \
785 do \
786 { \
787 YYSIZE_T yyi; \
788 for (yyi = 0; yyi < (Count); yyi++) \
789 (To)[yyi] = (From)[yyi]; \
790 } \
791 while (0)
792# endif
793# endif
794
795/* Relocate STACK from its old location to the new one. The
796 local variables YYSIZE and YYSTACKSIZE give the old and new number of
797 elements in the stack, and YYPTR gives the new location of the
798 stack. Advance YYPTR to a properly aligned location for the next
799 stack. */
800# define YYSTACK_RELOCATE(Stack) \
801 do \
802 { \
803 YYSIZE_T yynewbytes; \
804 YYCOPY (&yyptr->Stack, Stack, yysize); \
805 Stack = &yyptr->Stack; \
806 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
807 yyptr += yynewbytes / sizeof (*yyptr); \
808 } \
809 while (0)
Reid Spencere7c3c602006-11-30 06:36:44 +0000810
811#endif
812
Jim Laskey2792cfb2006-12-06 11:03:10 +0000813#if defined (__STDC__) || defined (__cplusplus)
814 typedef signed char yysigned_char;
Reid Spencere7c3c602006-11-30 06:36:44 +0000815#else
Jim Laskey2792cfb2006-12-06 11:03:10 +0000816 typedef short int yysigned_char;
Reid Spencere7c3c602006-11-30 06:36:44 +0000817#endif
818
Jim Laskey2792cfb2006-12-06 11:03:10 +0000819/* YYFINAL -- State number of the termination state. */
820#define YYFINAL 4
821/* YYLAST -- Last index in YYTABLE. */
822#define YYLAST 1483
823
824/* YYNTOKENS -- Number of terminals. */
825#define YYNTOKENS 165
826/* YYNNTS -- Number of nonterminals. */
827#define YYNNTS 75
828/* YYNRULES -- Number of rules. */
829#define YYNRULES 299
830/* YYNRULES -- Number of states. */
831#define YYNSTATES 582
832
833/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
834#define YYUNDEFTOK 2
835#define YYMAXUTOK 405
836
837#define YYTRANSLATE(YYX) \
838 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
839
840/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
841static const unsigned char yytranslate[] =
842{
843 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
844 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
845 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
846 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
847 154, 155, 163, 2, 152, 2, 2, 2, 2, 2,
848 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
849 159, 151, 160, 2, 2, 2, 2, 2, 2, 2,
850 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
851 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
852 2, 156, 153, 158, 2, 2, 2, 2, 2, 164,
853 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
854 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
855 157, 2, 2, 161, 2, 162, 2, 2, 2, 2,
856 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
857 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
858 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, 1, 2, 3, 4,
869 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
870 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
871 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
872 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
873 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
874 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
875 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
876 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
877 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
878 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
879 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
880 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
881 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
882 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
883 145, 146, 147, 148, 149, 150
884};
885
886#if YYDEBUG
887/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
888 YYRHS. */
889static const unsigned short int yyprhs[] =
890{
891 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
892 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
893 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
894 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
895 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
896 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
897 119, 121, 123, 125, 127, 129, 131, 133, 135, 137,
898 139, 141, 143, 145, 147, 149, 151, 153, 155, 157,
899 159, 161, 164, 165, 167, 169, 171, 173, 175, 177,
900 179, 180, 182, 184, 186, 188, 190, 192, 195, 196,
901 197, 200, 201, 205, 208, 209, 211, 212, 216, 218,
902 221, 223, 225, 227, 229, 231, 233, 235, 237, 239,
903 241, 243, 245, 247, 249, 251, 253, 255, 257, 259,
904 261, 264, 269, 275, 281, 285, 288, 291, 293, 297,
905 299, 303, 305, 306, 311, 315, 319, 324, 329, 333,
906 336, 339, 342, 345, 348, 351, 354, 357, 360, 363,
907 370, 376, 385, 392, 399, 406, 414, 422, 429, 436,
908 445, 454, 458, 460, 462, 464, 466, 469, 472, 477,
909 480, 482, 484, 486, 491, 494, 499, 506, 513, 520,
910 527, 531, 536, 537, 539, 541, 543, 547, 551, 555,
911 559, 563, 567, 569, 570, 572, 574, 576, 577, 580,
912 584, 586, 588, 592, 594, 595, 604, 606, 608, 612,
913 614, 616, 620, 621, 623, 625, 629, 630, 632, 634,
914 636, 638, 640, 642, 644, 646, 648, 652, 654, 660,
915 662, 664, 666, 668, 671, 674, 676, 679, 682, 683,
916 685, 687, 689, 692, 695, 699, 709, 719, 728, 743,
917 745, 747, 754, 760, 763, 770, 778, 780, 784, 786,
918 787, 790, 792, 798, 804, 810, 818, 826, 829, 834,
919 839, 846, 851, 856, 863, 870, 873, 881, 883, 886,
920 887, 889, 890, 894, 901, 905, 912, 915, 920, 927
921};
922
923/* YYRHS -- A `-1'-separated list of the rules' RHS. */
924static const short int yyrhs[] =
925{
926 199, 0, -1, 19, -1, 20, -1, 17, -1, 18,
927 -1, 80, -1, 81, -1, 82, -1, 83, -1, 84,
928 -1, 85, -1, 86, -1, 87, -1, 88, -1, 89,
929 -1, 90, -1, 91, -1, 92, -1, 93, -1, 94,
930 -1, 95, -1, 96, -1, 97, -1, 98, -1, 99,
931 -1, 102, -1, 103, -1, 104, -1, 105, -1, 106,
932 -1, 107, -1, 118, -1, 119, -1, 120, -1, 121,
933 -1, 108, -1, 109, -1, 110, -1, 111, -1, 112,
934 -1, 113, -1, 114, -1, 115, -1, 116, -1, 117,
935 -1, 118, -1, 119, -1, 120, -1, 121, -1, 25,
936 -1, 26, -1, 130, -1, 131, -1, 132, -1, 133,
937 -1, 139, -1, 140, -1, 141, -1, 142, -1, 143,
938 -1, 144, -1, 145, -1, 146, -1, 147, -1, 148,
939 -1, 149, -1, 150, -1, 138, -1, 11, -1, 9,
940 -1, 7, -1, 5, -1, 12, -1, 10, -1, 8,
941 -1, 6, -1, 175, -1, 176, -1, 13, -1, 14,
942 -1, 208, 151, -1, -1, 42, -1, 43, -1, 44,
943 -1, 48, -1, 45, -1, 46, -1, 47, -1, -1,
944 66, -1, 67, -1, 68, -1, 69, -1, 70, -1,
945 71, -1, 65, 18, -1, -1, -1, 57, 18, -1,
946 -1, 152, 57, 18, -1, 37, 30, -1, -1, 184,
947 -1, -1, 152, 187, 186, -1, 184, -1, 57, 18,
948 -1, 190, -1, 3, -1, 192, -1, 3, -1, 192,
949 -1, 4, -1, 5, -1, 6, -1, 7, -1, 8,
950 -1, 9, -1, 10, -1, 11, -1, 12, -1, 13,
951 -1, 14, -1, 15, -1, 16, -1, 222, -1, 191,
952 -1, 153, 18, -1, 189, 154, 194, 155, -1, 156,
953 18, 157, 192, 158, -1, 159, 18, 157, 192, 160,
954 -1, 161, 193, 162, -1, 161, 162, -1, 192, 163,
955 -1, 192, -1, 193, 152, 192, -1, 193, -1, 193,
956 152, 40, -1, 40, -1, -1, 190, 156, 197, 158,
957 -1, 190, 156, 158, -1, 190, 164, 30, -1, 190,
958 159, 197, 160, -1, 190, 161, 197, 162, -1, 190,
959 161, 162, -1, 190, 22, -1, 190, 23, -1, 190,
960 222, -1, 190, 196, -1, 190, 24, -1, 175, 167,
961 -1, 176, 18, -1, 4, 25, -1, 4, 26, -1,
962 178, 21, -1, 174, 154, 195, 39, 190, 155, -1,
963 127, 154, 195, 237, 155, -1, 129, 154, 195, 152,
964 195, 152, 195, 155, -1, 168, 154, 195, 152, 195,
965 155, -1, 169, 154, 195, 152, 195, 155, -1, 170,
966 154, 195, 152, 195, 155, -1, 100, 171, 154, 195,
967 152, 195, 155, -1, 101, 172, 154, 195, 152, 195,
968 155, -1, 173, 154, 195, 152, 195, 155, -1, 135,
969 154, 195, 152, 195, 155, -1, 136, 154, 195, 152,
970 195, 152, 195, 155, -1, 137, 154, 195, 152, 195,
971 152, 195, 155, -1, 197, 152, 195, -1, 195, -1,
972 35, -1, 36, -1, 200, -1, 200, 217, -1, 200,
973 219, -1, 200, 63, 62, 203, -1, 200, 31, -1,
974 202, -1, 50, -1, 58, -1, 202, 179, 27, 188,
975 -1, 202, 219, -1, 202, 63, 62, 203, -1, 202,
976 179, 180, 198, 195, 186, -1, 202, 179, 201, 198,
977 190, 186, -1, 202, 179, 45, 198, 190, 186, -1,
978 202, 179, 47, 198, 190, 186, -1, 202, 51, 205,
979 -1, 202, 59, 151, 206, -1, -1, 30, -1, 56,
980 -1, 55, -1, 53, 151, 204, -1, 54, 151, 18,
981 -1, 52, 151, 30, -1, 72, 151, 30, -1, 156,
982 207, 158, -1, 207, 152, 30, -1, 30, -1, -1,
983 28, -1, 30, -1, 208, -1, -1, 190, 209, -1,
984 211, 152, 210, -1, 210, -1, 211, -1, 211, 152,
985 40, -1, 40, -1, -1, 181, 188, 208, 154, 212,
986 155, 185, 182, -1, 32, -1, 161, -1, 180, 213,
987 214, -1, 33, -1, 162, -1, 215, 225, 216, -1,
988 -1, 45, -1, 47, -1, 34, 218, 213, -1, -1,
989 64, -1, 17, -1, 18, -1, 21, -1, 25, -1,
990 26, -1, 22, -1, 23, -1, 24, -1, 159, 197,
991 160, -1, 196, -1, 62, 220, 30, 152, 30, -1,
992 166, -1, 208, -1, 222, -1, 221, -1, 190, 223,
993 -1, 225, 226, -1, 226, -1, 227, 229, -1, 227,
994 231, -1, -1, 29, -1, 78, -1, 77, -1, 73,
995 224, -1, 73, 3, -1, 74, 15, 223, -1, 74,
996 4, 223, 152, 15, 223, 152, 15, 223, -1, 75,
997 177, 223, 152, 15, 223, 156, 230, 158, -1, 75,
998 177, 223, 152, 15, 223, 156, 158, -1, 179, 76,
999 181, 188, 223, 154, 234, 155, 39, 15, 223, 228,
1000 15, 223, -1, 228, -1, 79, -1, 230, 177, 221,
1001 152, 15, 223, -1, 177, 221, 152, 15, 223, -1,
1002 179, 236, -1, 190, 156, 223, 152, 223, 158, -1,
1003 232, 152, 156, 223, 152, 223, 158, -1, 224, -1,
1004 233, 152, 224, -1, 233, -1, -1, 61, 60, -1,
1005 60, -1, 168, 190, 223, 152, 223, -1, 169, 190,
1006 223, 152, 223, -1, 170, 190, 223, 152, 223, -1,
1007 100, 171, 190, 223, 152, 223, 155, -1, 101, 172,
1008 190, 223, 152, 223, 155, -1, 49, 224, -1, 173,
1009 224, 152, 224, -1, 174, 224, 39, 190, -1, 129,
1010 224, 152, 224, 152, 224, -1, 134, 224, 152, 190,
1011 -1, 135, 224, 152, 224, -1, 136, 224, 152, 224,
1012 152, 224, -1, 137, 224, 152, 224, 152, 224, -1,
1013 128, 232, -1, 235, 181, 188, 223, 154, 234, 155,
1014 -1, 239, -1, 152, 233, -1, -1, 38, -1, -1,
1015 122, 190, 183, -1, 122, 190, 152, 10, 223, 183,
1016 -1, 123, 190, 183, -1, 123, 190, 152, 10, 223,
1017 183, -1, 124, 224, -1, 238, 125, 190, 223, -1,
1018 238, 126, 224, 152, 190, 223, -1, 127, 190, 223,
1019 237, -1
1020};
1021
1022/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1023static const unsigned short int yyrline[] =
1024{
Reid Spencere4d87aa2006-12-23 06:05:41 +00001025 0, 338, 338, 338, 339, 339, 343, 343, 343, 343,
1026 343, 343, 343, 344, 344, 344, 344, 345, 345, 345,
1027 346, 346, 346, 346, 346, 346, 347, 347, 347, 347,
1028 347, 347, 347, 347, 347, 347, 348, 348, 348, 348,
1029 348, 348, 348, 348, 348, 348, 349, 349, 349, 349,
1030 349, 349, 350, 350, 350, 350, 351, 351, 351, 351,
1031 351, 351, 351, 352, 352, 352, 352, 352, 352, 357,
1032 357, 357, 357, 358, 358, 358, 358, 359, 359, 360,
1033 360, 363, 366, 371, 371, 371, 371, 371, 371, 372,
1034 373, 376, 376, 376, 376, 376, 377, 378, 383, 388,
1035 389, 392, 393, 401, 407, 408, 411, 412, 421, 422,
1036 435, 435, 436, 436, 437, 441, 441, 441, 441, 441,
1037 441, 441, 442, 442, 442, 442, 442, 444, 448, 452,
1038 455, 460, 466, 474, 482, 488, 492, 503, 506, 514,
1039 515, 520, 523, 533, 539, 544, 550, 556, 562, 567,
1040 573, 579, 585, 591, 597, 603, 609, 615, 621, 629,
1041 643, 655, 660, 666, 671, 677, 682, 687, 695, 700,
1042 705, 715, 720, 725, 725, 735, 740, 743, 748, 752,
1043 756, 758, 758, 761, 773, 778, 783, 792, 801, 810,
1044 819, 824, 829, 834, 836, 836, 839, 844, 851, 856,
1045 863, 870, 875, 876, 884, 884, 885, 885, 887, 894,
1046 898, 902, 905, 910, 913, 915, 935, 936, 938, 947,
1047 948, 950, 958, 959, 960, 964, 977, 978, 981, 981,
1048 981, 981, 981, 981, 981, 982, 983, 988, 989, 998,
1049 998, 1002, 1008, 1019, 1025, 1028, 1036, 1040, 1045, 1048,
1050 1054, 1054, 1056, 1061, 1066, 1071, 1079, 1086, 1092, 1112,
1051 1117, 1123, 1128, 1136, 1145, 1152, 1160, 1164, 1171, 1172,
1052 1176, 1181, 1184, 1190, 1195, 1201, 1206, 1211, 1216, 1224,
1053 1238, 1243, 1248, 1253, 1258, 1263, 1268, 1285, 1290, 1291,
1054 1295, 1296, 1299, 1306, 1313, 1320, 1327, 1332, 1339, 1346
Jim Laskey2792cfb2006-12-06 11:03:10 +00001055};
1056#endif
1057
1058#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1059/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1060 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1061static const char *const yytname[] =
1062{
1063 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
1064 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
1065 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
1066 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
1067 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
1068 "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
1069 "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
1070 "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL",
1071 "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
1072 "UNINITIALIZED", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
1073 "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
1074 "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1075 "RET", "BR", "SWITCH", "INVOKE", "EXCEPT", "UNWIND", "UNREACHABLE",
1076 "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
1077 "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
1078 "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1079 "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
1080 "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1081 "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
1082 "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
1083 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
1084 "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
1085 "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1086 "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
1087 "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
1088 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
1089 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
1090 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
1091 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
1092 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1093 "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
1094 "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
1095 "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
1096 "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
1097 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1098 "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock",
1099 "InstructionList", "Unwind", "BBTerminatorInst", "JumpTable", "Inst",
1100 "PHIList", "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal",
1101 "IndexList", "OptVolatile", "MemoryInst", 0
1102};
1103#endif
1104
1105# ifdef YYPRINT
1106/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1107 token YYLEX-NUM. */
1108static const unsigned short int yytoknum[] =
1109{
1110 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1111 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1112 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1113 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1114 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1115 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1116 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1117 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1118 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1119 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1120 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1121 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1122 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1123 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1124 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1125 405, 61, 44, 92, 40, 41, 91, 120, 93, 60,
1126 62, 123, 125, 42, 99
1127};
1128# endif
1129
1130/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1131static const unsigned char yyr1[] =
1132{
1133 0, 165, 166, 166, 167, 167, 168, 168, 168, 168,
1134 168, 168, 168, 168, 168, 168, 168, 169, 169, 169,
1135 170, 170, 170, 170, 170, 170, 171, 171, 171, 171,
1136 171, 171, 171, 171, 171, 171, 172, 172, 172, 172,
1137 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
1138 172, 172, 173, 173, 173, 173, 174, 174, 174, 174,
1139 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1140 175, 175, 175, 176, 176, 176, 176, 177, 177, 178,
1141 178, 179, 179, 180, 180, 180, 180, 180, 180, 180,
1142 180, 181, 181, 181, 181, 181, 181, 181, 181, 182,
1143 182, 183, 183, 184, 185, 185, 186, 186, 187, 187,
1144 188, 188, 189, 189, 190, 191, 191, 191, 191, 191,
1145 191, 191, 191, 191, 191, 191, 191, 192, 192, 192,
1146 192, 192, 192, 192, 192, 192, 192, 193, 193, 194,
1147 194, 194, 194, 195, 195, 195, 195, 195, 195, 195,
1148 195, 195, 195, 195, 195, 195, 195, 195, 195, 196,
1149 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
1150 196, 197, 197, 198, 198, 199, 200, 200, 200, 200,
1151 200, 201, 201, 202, 202, 202, 202, 202, 202, 202,
1152 202, 202, 202, 203, 204, 204, 205, 205, 205, 205,
1153 206, 207, 207, 207, 208, 208, 209, 209, 210, 211,
1154 211, 212, 212, 212, 212, 213, 214, 214, 215, 216,
1155 216, 217, 218, 218, 218, 219, 220, 220, 221, 221,
1156 221, 221, 221, 221, 221, 221, 221, 221, 221, 222,
1157 222, 223, 223, 224, 225, 225, 226, 227, 227, 227,
1158 228, 228, 229, 229, 229, 229, 229, 229, 229, 229,
1159 229, 230, 230, 231, 232, 232, 233, 233, 234, 234,
1160 235, 235, 236, 236, 236, 236, 236, 236, 236, 236,
1161 236, 236, 236, 236, 236, 236, 236, 236, 237, 237,
1162 238, 238, 239, 239, 239, 239, 239, 239, 239, 239
1163};
1164
1165/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1166static const unsigned char yyr2[] =
1167{
1168 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1169 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1170 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1171 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1172 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1173 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1174 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1175 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1176 1, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1177 0, 1, 1, 1, 1, 1, 1, 2, 0, 0,
1178 2, 0, 3, 2, 0, 1, 0, 3, 1, 2,
1179 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1180 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1181 2, 4, 5, 5, 3, 2, 2, 1, 3, 1,
1182 3, 1, 0, 4, 3, 3, 4, 4, 3, 2,
1183 2, 2, 2, 2, 2, 2, 2, 2, 2, 6,
1184 5, 8, 6, 6, 6, 7, 7, 6, 6, 8,
1185 8, 3, 1, 1, 1, 1, 2, 2, 4, 2,
1186 1, 1, 1, 4, 2, 4, 6, 6, 6, 6,
1187 3, 4, 0, 1, 1, 1, 3, 3, 3, 3,
1188 3, 3, 1, 0, 1, 1, 1, 0, 2, 3,
1189 1, 1, 3, 1, 0, 8, 1, 1, 3, 1,
1190 1, 3, 0, 1, 1, 3, 0, 1, 1, 1,
1191 1, 1, 1, 1, 1, 1, 3, 1, 5, 1,
1192 1, 1, 1, 2, 2, 1, 2, 2, 0, 1,
1193 1, 1, 2, 2, 3, 9, 9, 8, 14, 1,
1194 1, 6, 5, 2, 6, 7, 1, 3, 1, 0,
1195 2, 1, 5, 5, 5, 7, 7, 2, 4, 4,
1196 6, 4, 4, 6, 6, 2, 7, 1, 2, 0,
1197 1, 0, 3, 6, 3, 6, 2, 4, 6, 4
1198};
1199
1200/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1201 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1202 means the default is an error. */
1203static const unsigned short int yydefact[] =
1204{
1205 192, 0, 90, 180, 1, 179, 222, 83, 84, 85,
1206 87, 88, 89, 86, 0, 98, 248, 176, 177, 204,
1207 205, 0, 0, 0, 90, 0, 184, 223, 224, 98,
1208 0, 0, 91, 92, 93, 94, 95, 96, 0, 0,
1209 249, 248, 245, 82, 0, 0, 0, 0, 190, 0,
1210 0, 0, 0, 0, 181, 182, 0, 0, 81, 225,
1211 193, 178, 97, 111, 115, 116, 117, 118, 119, 120,
1212 121, 122, 123, 124, 125, 126, 127, 2, 3, 0,
1213 0, 0, 0, 239, 0, 0, 110, 129, 114, 240,
1214 128, 216, 217, 218, 219, 220, 221, 244, 0, 0,
1215 0, 251, 250, 260, 291, 259, 246, 247, 0, 0,
1216 0, 0, 203, 191, 185, 183, 173, 174, 0, 0,
1217 0, 0, 130, 0, 0, 113, 135, 137, 0, 0,
1218 142, 136, 253, 0, 252, 0, 0, 72, 76, 71,
1219 75, 70, 74, 69, 73, 77, 78, 0, 290, 0,
1220 271, 0, 98, 6, 7, 8, 9, 10, 11, 12,
1221 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1222 23, 24, 25, 0, 0, 0, 0, 0, 0, 0,
1223 0, 52, 53, 54, 55, 0, 0, 0, 0, 68,
1224 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
1225 66, 67, 0, 0, 0, 0, 0, 98, 263, 0,
1226 287, 198, 195, 194, 196, 197, 199, 202, 0, 106,
1227 106, 115, 116, 117, 118, 119, 120, 121, 122, 123,
1228 124, 125, 0, 0, 0, 0, 106, 106, 0, 0,
1229 0, 134, 214, 141, 139, 0, 228, 229, 230, 233,
1230 234, 235, 231, 232, 226, 0, 0, 0, 0, 0,
1231 0, 0, 0, 0, 0, 0, 0, 0, 237, 242,
1232 241, 243, 0, 254, 0, 277, 270, 0, 26, 27,
1233 28, 29, 30, 31, 32, 33, 34, 35, 0, 50,
1234 51, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1235 45, 46, 47, 48, 49, 0, 101, 101, 296, 0,
1236 0, 285, 0, 0, 0, 0, 0, 0, 0, 0,
1237 0, 0, 0, 0, 0, 0, 200, 0, 188, 189,
1238 156, 157, 4, 5, 154, 155, 158, 149, 150, 153,
1239 0, 0, 0, 0, 152, 151, 186, 187, 112, 112,
1240 138, 213, 207, 210, 211, 0, 0, 131, 227, 0,
1241 0, 0, 0, 0, 0, 0, 0, 172, 0, 0,
1242 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1243 292, 0, 294, 289, 0, 0, 0, 0, 0, 0,
1244 0, 0, 0, 0, 0, 0, 0, 0, 0, 201,
1245 0, 0, 108, 106, 144, 0, 0, 148, 0, 145,
1246 132, 133, 206, 208, 0, 104, 140, 0, 0, 0,
1247 289, 0, 0, 0, 0, 0, 236, 0, 0, 0,
1248 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1249 0, 299, 0, 0, 0, 281, 282, 0, 0, 0,
1250 0, 0, 278, 279, 0, 297, 0, 103, 109, 107,
1251 143, 146, 147, 212, 209, 105, 99, 0, 0, 0,
1252 0, 0, 0, 0, 0, 171, 0, 0, 0, 0,
1253 0, 0, 0, 269, 0, 0, 101, 102, 101, 266,
1254 288, 0, 0, 0, 0, 0, 272, 273, 274, 269,
1255 0, 0, 215, 238, 0, 0, 160, 0, 0, 0,
1256 0, 0, 0, 0, 0, 0, 0, 0, 268, 0,
1257 0, 0, 0, 293, 295, 0, 0, 0, 280, 283,
1258 284, 0, 298, 100, 0, 0, 0, 168, 0, 0,
1259 162, 163, 164, 167, 159, 0, 257, 0, 0, 0,
1260 275, 276, 267, 264, 0, 286, 165, 166, 0, 0,
1261 0, 255, 0, 256, 0, 0, 265, 161, 169, 170,
1262 0, 0, 0, 0, 0, 0, 262, 0, 0, 261,
1263 0, 258
1264};
1265
1266/* YYDEFGOTO[NTERM-NUM]. */
1267static const short int yydefgoto[] =
1268{
1269 -1, 83, 334, 263, 264, 265, 288, 305, 266, 267,
1270 232, 233, 147, 234, 24, 15, 38, 502, 380, 402,
1271 466, 328, 403, 84, 85, 235, 87, 88, 128, 245,
1272 367, 268, 368, 118, 1, 2, 57, 3, 61, 214,
1273 48, 113, 218, 89, 413, 353, 354, 355, 39, 93,
1274 16, 96, 17, 29, 18, 359, 269, 90, 271, 489,
1275 41, 42, 43, 105, 106, 548, 107, 311, 518, 519,
1276 207, 208, 441, 209, 210
1277};
1278
1279/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1280 STATE-NUM. */
1281#define YYPACT_NINF -501
1282static const short int yypact[] =
1283{
1284 -501, 82, 9, 975, -501, -501, 72, -501, -501, -501,
1285 -501, -501, -501, -501, 29, 34, 94, -501, -501, -501,
1286 -501, -28, -42, 66, 127, 25, -501, -501, -501, 34,
1287 122, 199, -501, -501, -501, -501, -501, -501, 839, -17,
1288 -501, -19, -501, 47, 67, 68, 69, 75, -501, 71,
1289 122, 839, 11, 11, -501, -501, 11, 11, -501, -501,
1290 -501, -501, -501, 76, -501, -501, -501, -501, -501, -501,
1291 -501, -501, -501, -501, -501, -501, -501, -501, -501, 207,
1292 210, 211, 518, -501, 123, 77, -501, -501, -84, -501,
1293 -501, -501, -501, -501, -501, -501, -501, -501, 876, 8,
1294 253, -501, -501, -501, 1333, -501, -501, -501, 203, 80,
1295 217, 206, 208, -501, -501, -501, -501, -501, 922, 922,
1296 960, 922, -501, 83, 84, -501, -501, -84, -134, 88,
1297 604, -501, 76, 1131, -501, 1131, 1131, -501, -501, -501,
1298 -501, -501, -501, -501, -501, -501, -501, 1131, -501, 922,
1299 -501, 177, 34, -501, -501, -501, -501, -501, -501, -501,
1300 -501, -501, -501, -501, -501, -501, -501, -501, -501, -501,
1301 -501, -501, -501, 103, 81, 922, 922, 922, 922, 922,
1302 922, -501, -501, -501, -501, 922, 922, 922, 922, -501,
1303 -501, -501, -501, -501, -501, -501, -501, -501, -501, -501,
1304 -501, -501, 922, 922, 922, 922, 922, 34, -501, 20,
1305 -501, -501, -501, -501, -501, -501, -501, -501, -44, 91,
1306 91, 130, 143, 226, 145, 227, 161, 230, 163, 231,
1307 232, 233, 165, 234, 245, 1042, 91, 91, 922, 922,
1308 922, -501, 679, -501, 99, 113, -501, -501, -501, -501,
1309 -501, -501, -501, -501, 205, 103, 81, 119, 120, 125,
1310 128, 129, 960, 133, 134, 135, 139, 140, -501, -501,
1311 -501, -501, 124, -501, 149, -501, -501, 839, -501, -501,
1312 -501, -501, -501, -501, -501, -501, -501, -501, 922, -501,
1313 -501, -501, -501, -501, -501, -501, -501, -501, -501, -501,
1314 -501, -501, -501, -501, -501, 922, 150, 151, -501, 1131,
1315 136, 153, 154, 155, 156, 157, 158, 1131, 1131, 1131,
1316 159, 241, 839, 922, 922, 251, -501, -18, -501, -501,
1317 -501, -501, -501, -501, -501, -501, -501, -501, -501, -501,
1318 717, 960, 549, 265, -501, -501, -501, -501, -69, -50,
1319 -84, -501, 123, -501, 160, 142, 763, -501, -501, 283,
1320 164, 166, 960, 960, 960, 960, 960, -501, -110, 960,
1321 960, 960, 960, 960, 302, 304, 1131, 1131, 1131, 1,
1322 -501, 12, -501, 169, 1131, 167, 922, 922, 922, 922,
1323 922, 172, 173, 176, 922, 922, 1131, 1131, 178, -501,
1324 299, 314, -501, 91, -501, -40, -68, -501, -74, -501,
1325 -501, -501, -501, -501, 801, 301, -501, 184, 960, 960,
1326 169, 187, 188, 189, 190, 960, -501, 194, 195, 201,
1327 209, 316, 1131, 1131, 204, 212, 213, 1131, 341, 1131,
1328 922, -501, 214, 1131, 215, -501, -501, 216, 220, 1131,
1329 1131, 1131, -501, -501, 219, -501, 922, -501, -501, -501,
1330 -501, -501, -501, -501, -501, -501, 303, 332, 222, 228,
1331 229, 960, 960, 960, 960, -501, 960, 960, 960, 960,
1332 922, 238, 235, 922, 1131, 1131, 240, -501, 240, -501,
1333 243, 1131, 244, 922, 922, 922, -501, -501, -501, 922,
1334 1131, 345, -501, -501, 960, 960, -501, 246, 242, 247,
1335 248, 252, 254, 255, 256, 257, 354, 26, 243, 258,
1336 259, 260, 325, -501, -501, 922, 225, 1131, -501, -501,
1337 -501, 261, -501, -501, 262, 269, 960, -501, 960, 960,
1338 -501, -501, -501, -501, -501, 1131, -501, 1220, 56, 347,
1339 -501, -501, -501, -501, 250, -501, -501, -501, 270, 271,
1340 272, -501, 249, -501, 1220, 378, -501, -501, -501, -501,
1341 391, 276, 1131, 1131, 415, 138, -501, 1131, 416, -501,
1342 1131, -501
1343};
1344
1345/* YYPGOTO[NTERM-NUM]. */
1346static const short int yypgoto[] =
1347{
1348 -501, -501, -501, 328, 329, 330, 181, 185, 333, 336,
1349 -98, -97, -500, -501, 400, 420, -136, -501, -300, 31,
1350 -501, -216, -501, -45, -501, -38, -501, -81, 317, -501,
1351 126, 218, -208, 74, -501, -501, -501, -501, 398, -501,
1352 -501, -501, -501, 2, -501, 35, -501, -501, 423, -501,
1353 -501, -501, -501, -501, 451, -501, -471, -106, -62, -90,
1354 -501, 417, -501, -116, -501, -501, -501, -501, 22, -39,
1355 -501, -501, 43, -501, -501
1356};
1357
1358/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1359 positive, shift that token. If negative, reduce the rule which
1360 number is the opposite. If zero, do what YYDEFACT says.
1361 If YYTABLE_NINF, syntax error. */
1362#define YYTABLE_NINF -176
1363static const short int yytable[] =
1364{
1365 86, 127, 145, 146, 329, 25, 115, 382, 134, -175,
1366 40, 437, 135, 86, 94, 91, 277, 547, 240, 400,
1367 346, 347, 439, 136, 44, 45, 46, 270, 241, 270,
1368 270, 137, 138, 139, 140, 141, 142, 143, 144, 401,
1369 5, 270, 425, 6, 47, 25, 116, 117, 564, 127,
1370 426, 7, 8, 9, 10, 11, 12, 13, 438, 275,
1371 133, 137, 138, 139, 140, 141, 142, 143, 144, 438,
1372 -112, 322, 14, 272, 273, 19, 562, 20, 425, 131,
1373 219, 220, 4, 237, 425, 274, 129, 308, 462, 410,
1374 312, 30, 461, 571, 131, 313, 314, 315, 316, 31,
1375 32, 33, 34, 35, 36, 37, 289, 290, 325, 49,
1376 411, 133, 425, 131, 326, 320, 321, 27, 460, 28,
1377 98, 99, 100, 40, 101, 102, 103, 119, 50, 345,
1378 120, 121, 405, 406, 408, 212, 213, 306, 307, 133,
1379 309, 310, 133, 95, 92, 323, 324, 133, 133, 133,
1380 133, 19, 60, 20, 51, 330, 331, 348, 349, 350,
1381 -72, -72, -71, -71, 317, 318, 319, 133, 133, 7,
1382 8, 9, 52, 11, 53, 13, 58, 54, -70, -70,
1383 -69, -69, 332, 333, 546, 55, 523, 459, 524, 291,
1384 292, 293, 294, 295, 296, 297, 298, 299, 300, 301,
1385 302, 303, 304, 270, 352, 278, 279, 280, 281, 282,
1386 283, 270, 270, 270, 563, 101, 102, 62, 108, 109,
1387 110, 284, 285, 286, 287, 122, 111, 112, 123, 124,
1388 -113, 130, 376, 211, 398, 215, 216, 276, 217, 86,
1389 238, 239, 242, 327, -76, -75, 236, 383, -74, -73,
1390 377, 356, 335, -79, -80, 391, 392, 393, 137, 138,
1391 139, 140, 141, 142, 143, 144, 336, 378, 357, 358,
1392 270, 270, 270, 362, 363, 350, 374, 396, 270, 364,
1393 395, 399, 365, 366, 86, 397, 133, 369, 370, 371,
1394 270, 270, 384, 372, 373, 409, 444, 415, 446, 447,
1395 448, 375, 379, 381, 452, 385, 386, 387, 388, 389,
1396 390, 394, 414, 417, 434, 435, 436, 432, 418, 433,
1397 419, 440, 442, 443, 449, 450, 270, 270, 451, 457,
1398 456, 270, 458, 270, 454, 455, 467, 270, 400, 471,
1399 472, 473, 474, 270, 270, 270, 476, 477, 133, 445,
1400 133, 133, 133, 478, 412, 480, 133, 453, 483, 487,
1401 501, 479, 503, 533, 484, 485, 491, 493, 494, 545,
1402 481, 482, 495, 499, 504, 486, 352, 488, 270, 270,
1403 505, 492, 438, 553, 506, 270, 565, 496, 497, 498,
1404 516, 517, 522, 572, 270, 525, 527, 537, 536, 538,
1405 539, 570, 133, 528, 529, 530, 573, 540, 566, 541,
1406 542, 543, 544, 549, 550, 551, 555, 556, 500, 145,
1407 146, 270, 520, 521, 557, 567, 568, 569, 574, 526,
1408 577, 580, 202, 203, 204, 552, 360, 205, 532, 270,
1409 206, 361, 515, 104, 56, 133, 465, 244, 114, 464,
1410 145, 146, 59, 344, 26, 133, 133, 133, 97, 578,
1411 531, 133, 490, 470, 0, 554, 270, 270, 0, 0,
1412 0, 270, 0, 0, 270, 0, 0, 0, 0, 0,
1413 0, 0, 0, 561, 0, 0, 0, 133, 420, 421,
1414 422, 423, 424, 0, 0, 427, 428, 429, 430, 431,
1415 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1416 575, 576, 0, 0, 0, 579, 0, 0, 581, 0,
1417 0, 125, 64, 65, 66, 67, 68, 69, 70, 71,
1418 72, 73, 74, 75, 76, 0, 0, 77, 78, 0,
1419 0, 0, 0, 0, 468, 469, 19, 0, 20, 0,
1420 0, 475, 125, 221, 222, 223, 224, 225, 226, 227,
1421 228, 229, 230, 231, 75, 76, 0, 0, 77, 78,
1422 0, 0, 0, 0, 0, 0, 0, 19, 0, 20,
1423 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1424 0, 0, 0, 0, 0, 0, 0, 507, 508, 509,
1425 510, 0, 511, 512, 513, 514, 0, 125, 64, 65,
1426 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1427 76, 0, 0, 77, 78, 0, 0, 0, 0, 0,
1428 534, 535, 19, 0, 20, 0, 0, 0, 0, 0,
1429 0, 0, 0, 0, 243, 0, 0, 0, 0, 0,
1430 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1431 0, 0, 558, 0, 559, 560, 0, 0, 0, 0,
1432 0, 79, 0, 0, 80, 0, 0, 81, 0, 82,
1433 126, 0, 125, 64, 65, 66, 67, 68, 69, 70,
1434 71, 72, 73, 74, 75, 76, 0, 0, 77, 78,
1435 0, 0, 79, 0, 0, 80, 0, 19, 81, 20,
1436 82, 407, 0, 0, 0, 0, 0, 0, 0, 351,
1437 125, 221, 222, 223, 224, 225, 226, 227, 228, 229,
1438 230, 231, 75, 76, 0, 0, 77, 78, 0, 0,
1439 0, 0, 0, 0, 0, 19, 0, 20, 0, 0,
1440 0, 0, 0, 0, 0, 0, 0, 79, 0, 0,
1441 80, 0, 0, 81, 0, 82, 125, 64, 65, 66,
1442 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1443 0, 0, 77, 78, 0, 0, 0, 0, 0, 0,
1444 0, 19, 0, 20, 0, 0, 0, 0, 0, 0,
1445 0, 0, 0, 416, 125, 64, 65, 66, 67, 68,
1446 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1447 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
1448 0, 20, 79, 0, 0, 80, 0, 0, 81, 0,
1449 82, 463, 63, 64, 65, 66, 67, 68, 69, 70,
1450 71, 72, 73, 74, 75, 76, 0, 0, 77, 78,
1451 0, 0, 0, 0, 0, 0, 0, 19, 0, 20,
1452 79, 0, 0, 80, 0, 404, 81, 0, 82, 132,
1453 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1454 74, 75, 76, 0, 0, 77, 78, 0, 0, 0,
1455 0, 0, 0, 0, 19, 0, 20, 0, 0, 0,
1456 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1457 0, 0, 81, 0, 82, 125, 64, 65, 66, 67,
1458 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
1459 0, 77, 78, 0, 0, 0, 0, 0, 0, 0,
1460 19, 0, 20, 0, 79, 0, 0, 80, 0, 0,
1461 81, 0, 82, 125, 221, 222, 223, 224, 225, 226,
1462 227, 228, 229, 230, 231, 75, 76, 0, 0, 77,
1463 78, 0, 0, 0, 0, 0, 0, 0, 19, 0,
1464 20, 0, 79, 0, 0, 80, 0, 0, 81, 0,
1465 82, 0, -82, 19, 0, 20, 0, 0, 0, 6,
1466 -82, -82, 0, 0, 0, 0, 0, -82, -82, -82,
1467 -82, -82, -82, -82, 0, -82, 21, 0, 0, 79,
1468 0, 0, 80, -82, 22, 81, 0, 82, 23, 0,
1469 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1470 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1471 0, 77, 78, 0, 337, 338, 339, 0, 0, 0,
1472 19, 0, 20, 0, 0, 79, 0, 0, 80, 0,
1473 0, 81, 0, 82, 0, 0, 0, 0, 0, 0,
1474 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1475 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1476 0, 0, 0, 79, 0, 0, 80, 0, 0, 81,
1477 0, 82, 153, 154, 155, 156, 157, 158, 159, 160,
1478 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
1479 171, 172, 255, 256, 0, 0, 0, 0, 246, 247,
1480 77, 78, 248, 249, 250, 251, 252, 253, 0, 19,
1481 0, 20, 0, 0, 0, 0, 0, 0, 0, 257,
1482 0, 258, 181, 182, 183, 184, 0, 259, 260, 261,
1483 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,
1484 199, 200, 201, 254, 0, 0, 0, 0, 340, 0,
1485 0, 341, 0, 342, 0, 0, 343, 0, 0, 0,
1486 0, 153, 154, 155, 156, 157, 158, 159, 160, 161,
1487 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
1488 172, 255, 256, 0, 0, 0, 0, 246, 247, 0,
1489 0, 248, 249, 250, 251, 252, 253, 0, 0, 0,
1490 0, 0, 0, 0, 0, 0, 0, 0, 257, 0,
1491 258, 181, 182, 183, 184, 0, 259, 260, 261, 189,
1492 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
1493 200, 201, 254, 0, 0, 0, 0, 0, 0, 0,
1494 262, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1495 153, 154, 155, 156, 157, 158, 159, 160, 161, 162,
1496 163, 164, 165, 166, 167, 168, 169, 170, 171, 172,
1497 255, 256, 0, 0, 0, 0, 0, 0, 0, 0,
1498 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1499 0, 0, 0, 0, 0, 0, 0, 257, 0, 258,
1500 181, 182, 183, 184, 0, 259, 260, 261, 189, 190,
1501 191, 192, 193, 194, 195, 196, 197, 198, 199, 200,
1502 201, 148, 0, 0, 0, 0, 0, 0, 0, 262,
1503 0, 0, 149, 0, 0, 0, 0, 0, 0, 0,
1504 0, 0, 0, 150, 151, 0, 0, 0, 0, 0,
1505 0, 0, 0, 0, 0, 0, 0, 0, 0, 152,
1506 0, 0, 0, 153, 154, 155, 156, 157, 158, 159,
1507 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
1508 170, 171, 172, 173, 174, 0, 0, 0, 0, 0,
1509 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1510 0, 0, 0, 0, 0, 175, 176, 177, 0, 0,
1511 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
1512 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
1513 198, 199, 200, 201
1514};
1515
1516static const short int yycheck[] =
1517{
1518 38, 82, 100, 100, 220, 3, 51, 307, 98, 0,
1519 29, 10, 4, 51, 33, 32, 152, 517, 152, 37,
1520 236, 237, 10, 15, 52, 53, 54, 133, 162, 135,
1521 136, 5, 6, 7, 8, 9, 10, 11, 12, 57,
1522 31, 147, 152, 34, 72, 43, 35, 36, 548, 130,
1523 160, 42, 43, 44, 45, 46, 47, 48, 57, 149,
1524 98, 5, 6, 7, 8, 9, 10, 11, 12, 57,
1525 154, 207, 63, 135, 136, 28, 547, 30, 152, 163,
1526 118, 119, 0, 121, 152, 147, 84, 177, 162, 158,
1527 180, 62, 160, 564, 163, 185, 186, 187, 188, 65,
1528 66, 67, 68, 69, 70, 71, 25, 26, 152, 151,
1529 160, 149, 152, 163, 158, 205, 206, 45, 158, 47,
1530 73, 74, 75, 29, 77, 78, 79, 53, 62, 235,
1531 56, 57, 340, 341, 342, 55, 56, 175, 176, 177,
1532 178, 179, 180, 162, 161, 125, 126, 185, 186, 187,
1533 188, 28, 30, 30, 27, 25, 26, 238, 239, 240,
1534 17, 18, 17, 18, 202, 203, 204, 205, 206, 42,
1535 43, 44, 45, 46, 47, 48, 151, 50, 17, 18,
1536 17, 18, 17, 18, 158, 58, 486, 403, 488, 108,
1537 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
1538 119, 120, 121, 309, 242, 102, 103, 104, 105, 106,
1539 107, 317, 318, 319, 158, 77, 78, 18, 151, 151,
1540 151, 118, 119, 120, 121, 18, 151, 156, 18, 18,
1541 154, 154, 277, 30, 324, 18, 30, 60, 30, 277,
1542 157, 157, 154, 152, 18, 18, 120, 309, 18, 18,
1543 288, 152, 18, 21, 21, 317, 318, 319, 5, 6,
1544 7, 8, 9, 10, 11, 12, 21, 305, 155, 64,
1545 376, 377, 378, 154, 154, 356, 152, 322, 384, 154,
1546 39, 30, 154, 154, 322, 323, 324, 154, 154, 154,
1547 396, 397, 156, 154, 154, 30, 386, 155, 388, 389,
1548 390, 152, 152, 152, 394, 152, 152, 152, 152, 152,
1549 152, 152, 152, 30, 376, 377, 378, 15, 154, 15,
1550 154, 152, 384, 156, 152, 152, 432, 433, 152, 30,
1551 152, 437, 18, 439, 396, 397, 152, 443, 37, 152,
1552 152, 152, 152, 449, 450, 451, 152, 152, 386, 387,
1553 388, 389, 390, 152, 352, 39, 394, 395, 154, 18,
1554 57, 152, 30, 18, 152, 152, 152, 152, 152, 15,
1555 432, 433, 152, 154, 152, 437, 414, 439, 484, 485,
1556 152, 443, 57, 158, 155, 491, 39, 449, 450, 451,
1557 152, 156, 152, 15, 500, 152, 152, 155, 152, 152,
1558 152, 152, 440, 493, 494, 495, 15, 155, 158, 155,
1559 155, 155, 155, 155, 155, 155, 155, 155, 456, 517,
1560 517, 527, 484, 485, 155, 155, 155, 155, 152, 491,
1561 15, 15, 104, 104, 104, 525, 255, 104, 500, 545,
1562 104, 256, 480, 43, 24, 483, 415, 130, 50, 414,
1563 548, 548, 29, 235, 3, 493, 494, 495, 41, 575,
1564 499, 499, 440, 420, -1, 527, 572, 573, -1, -1,
1565 -1, 577, -1, -1, 580, -1, -1, -1, -1, -1,
1566 -1, -1, -1, 545, -1, -1, -1, 525, 362, 363,
1567 364, 365, 366, -1, -1, 369, 370, 371, 372, 373,
1568 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1569 572, 573, -1, -1, -1, 577, -1, -1, 580, -1,
1570 -1, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1571 12, 13, 14, 15, 16, -1, -1, 19, 20, -1,
1572 -1, -1, -1, -1, 418, 419, 28, -1, 30, -1,
1573 -1, 425, 3, 4, 5, 6, 7, 8, 9, 10,
1574 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
1575 -1, -1, -1, -1, -1, -1, -1, 28, -1, 30,
1576 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1577 -1, -1, -1, -1, -1, -1, -1, 471, 472, 473,
1578 474, -1, 476, 477, 478, 479, -1, 3, 4, 5,
1579 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1580 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
1581 504, 505, 28, -1, 30, -1, -1, -1, -1, -1,
1582 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
1583 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1584 -1, -1, 536, -1, 538, 539, -1, -1, -1, -1,
1585 -1, 153, -1, -1, 156, -1, -1, 159, -1, 161,
1586 162, -1, 3, 4, 5, 6, 7, 8, 9, 10,
1587 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
1588 -1, -1, 153, -1, -1, 156, -1, 28, 159, 30,
1589 161, 162, -1, -1, -1, -1, -1, -1, -1, 40,
1590 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1591 13, 14, 15, 16, -1, -1, 19, 20, -1, -1,
1592 -1, -1, -1, -1, -1, 28, -1, 30, -1, -1,
1593 -1, -1, -1, -1, -1, -1, -1, 153, -1, -1,
1594 156, -1, -1, 159, -1, 161, 3, 4, 5, 6,
1595 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1596 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
1597 -1, 28, -1, 30, -1, -1, -1, -1, -1, -1,
1598 -1, -1, -1, 40, 3, 4, 5, 6, 7, 8,
1599 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
1600 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
1601 -1, 30, 153, -1, -1, 156, -1, -1, 159, -1,
1602 161, 40, 3, 4, 5, 6, 7, 8, 9, 10,
1603 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
1604 -1, -1, -1, -1, -1, -1, -1, 28, -1, 30,
1605 153, -1, -1, 156, -1, 158, 159, -1, 161, 3,
1606 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1607 14, 15, 16, -1, -1, 19, 20, -1, -1, -1,
1608 -1, -1, -1, -1, 28, -1, 30, -1, -1, -1,
1609 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
1610 -1, -1, 159, -1, 161, 3, 4, 5, 6, 7,
1611 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1612 -1, 19, 20, -1, -1, -1, -1, -1, -1, -1,
1613 28, -1, 30, -1, 153, -1, -1, 156, -1, -1,
1614 159, -1, 161, 3, 4, 5, 6, 7, 8, 9,
1615 10, 11, 12, 13, 14, 15, 16, -1, -1, 19,
1616 20, -1, -1, -1, -1, -1, -1, -1, 28, -1,
1617 30, -1, 153, -1, -1, 156, -1, -1, 159, -1,
1618 161, -1, 27, 28, -1, 30, -1, -1, -1, 34,
1619 35, 36, -1, -1, -1, -1, -1, 42, 43, 44,
1620 45, 46, 47, 48, -1, 50, 51, -1, -1, 153,
1621 -1, -1, 156, 58, 59, 159, -1, 161, 63, -1,
1622 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1623 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1624 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
1625 28, -1, 30, -1, -1, 153, -1, -1, 156, -1,
1626 -1, 159, -1, 161, -1, -1, -1, -1, -1, -1,
1627 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1628 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1629 -1, -1, -1, 153, -1, -1, 156, -1, -1, 159,
1630 -1, 161, 80, 81, 82, 83, 84, 85, 86, 87,
1631 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
1632 98, 99, 100, 101, -1, -1, -1, -1, 17, 18,
1633 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
1634 -1, 30, -1, -1, -1, -1, -1, -1, -1, 127,
1635 -1, 129, 130, 131, 132, 133, -1, 135, 136, 137,
1636 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
1637 148, 149, 150, 62, -1, -1, -1, -1, 156, -1,
1638 -1, 159, -1, 161, -1, -1, 164, -1, -1, -1,
1639 -1, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1640 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
1641 99, 100, 101, -1, -1, -1, -1, 17, 18, -1,
1642 -1, 21, 22, 23, 24, 25, 26, -1, -1, -1,
1643 -1, -1, -1, -1, -1, -1, -1, -1, 127, -1,
1644 129, 130, 131, 132, 133, -1, 135, 136, 137, 138,
1645 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
1646 149, 150, 62, -1, -1, -1, -1, -1, -1, -1,
1647 159, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1648 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
1649 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
1650 100, 101, -1, -1, -1, -1, -1, -1, -1, -1,
1651 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1652 -1, -1, -1, -1, -1, -1, -1, 127, -1, 129,
1653 130, 131, 132, 133, -1, 135, 136, 137, 138, 139,
1654 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
1655 150, 38, -1, -1, -1, -1, -1, -1, -1, 159,
1656 -1, -1, 49, -1, -1, -1, -1, -1, -1, -1,
1657 -1, -1, -1, 60, 61, -1, -1, -1, -1, -1,
1658 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
1659 -1, -1, -1, 80, 81, 82, 83, 84, 85, 86,
1660 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
1661 97, 98, 99, 100, 101, -1, -1, -1, -1, -1,
1662 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1663 -1, -1, -1, -1, -1, 122, 123, 124, -1, -1,
1664 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
1665 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
1666 147, 148, 149, 150
1667};
1668
1669/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1670 symbol of state STATE-NUM. */
1671static const unsigned char yystos[] =
1672{
1673 0, 199, 200, 202, 0, 31, 34, 42, 43, 44,
1674 45, 46, 47, 48, 63, 180, 215, 217, 219, 28,
1675 30, 51, 59, 63, 179, 208, 219, 45, 47, 218,
1676 62, 65, 66, 67, 68, 69, 70, 71, 181, 213,
1677 29, 225, 226, 227, 52, 53, 54, 72, 205, 151,
1678 62, 27, 45, 47, 50, 58, 180, 201, 151, 213,
1679 30, 203, 18, 3, 4, 5, 6, 7, 8, 9,
1680 10, 11, 12, 13, 14, 15, 16, 19, 20, 153,
1681 156, 159, 161, 166, 188, 189, 190, 191, 192, 208,
1682 222, 32, 161, 214, 33, 162, 216, 226, 73, 74,
1683 75, 77, 78, 79, 179, 228, 229, 231, 151, 151,
1684 151, 151, 156, 206, 203, 188, 35, 36, 198, 198,
1685 198, 198, 18, 18, 18, 3, 162, 192, 193, 208,
1686 154, 163, 3, 190, 224, 4, 15, 5, 6, 7,
1687 8, 9, 10, 11, 12, 175, 176, 177, 38, 49,
1688 60, 61, 76, 80, 81, 82, 83, 84, 85, 86,
1689 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
1690 97, 98, 99, 100, 101, 122, 123, 124, 127, 128,
1691 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
1692 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
1693 149, 150, 168, 169, 170, 173, 174, 235, 236, 238,
1694 239, 30, 55, 56, 204, 18, 30, 30, 207, 190,
1695 190, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1696 13, 14, 175, 176, 178, 190, 195, 190, 157, 157,
1697 152, 162, 154, 40, 193, 194, 17, 18, 21, 22,
1698 23, 24, 25, 26, 62, 100, 101, 127, 129, 135,
1699 136, 137, 159, 168, 169, 170, 173, 174, 196, 221,
1700 222, 223, 223, 223, 223, 224, 60, 181, 102, 103,
1701 104, 105, 106, 107, 118, 119, 120, 121, 171, 25,
1702 26, 108, 109, 110, 111, 112, 113, 114, 115, 116,
1703 117, 118, 119, 120, 121, 172, 190, 190, 224, 190,
1704 190, 232, 224, 224, 224, 224, 224, 190, 190, 190,
1705 224, 224, 181, 125, 126, 152, 158, 152, 186, 186,
1706 25, 26, 17, 18, 167, 18, 21, 22, 23, 24,
1707 156, 159, 161, 164, 196, 222, 186, 186, 192, 192,
1708 192, 40, 190, 210, 211, 212, 152, 155, 64, 220,
1709 171, 172, 154, 154, 154, 154, 154, 195, 197, 154,
1710 154, 154, 154, 154, 152, 152, 188, 190, 190, 152,
1711 183, 152, 183, 223, 156, 152, 152, 152, 152, 152,
1712 152, 223, 223, 223, 152, 39, 188, 190, 224, 30,
1713 37, 57, 184, 187, 158, 197, 197, 162, 197, 30,
1714 158, 160, 208, 209, 152, 155, 40, 30, 154, 154,
1715 195, 195, 195, 195, 195, 152, 160, 195, 195, 195,
1716 195, 195, 15, 15, 223, 223, 223, 10, 57, 10,
1717 152, 237, 223, 156, 224, 190, 224, 224, 224, 152,
1718 152, 152, 224, 190, 223, 223, 152, 30, 18, 186,
1719 158, 160, 162, 40, 210, 184, 185, 152, 195, 195,
1720 237, 152, 152, 152, 152, 195, 152, 152, 152, 152,
1721 39, 223, 223, 154, 152, 152, 223, 18, 223, 224,
1722 233, 152, 223, 152, 152, 152, 223, 223, 223, 154,
1723 190, 57, 182, 30, 152, 152, 155, 195, 195, 195,
1724 195, 195, 195, 195, 195, 190, 152, 156, 233, 234,
1725 223, 223, 152, 183, 183, 152, 223, 152, 224, 224,
1726 224, 234, 223, 18, 195, 195, 152, 155, 152, 152,
1727 155, 155, 155, 155, 155, 15, 158, 177, 230, 155,
1728 155, 155, 224, 158, 223, 155, 155, 155, 195, 195,
1729 195, 223, 221, 158, 177, 39, 158, 155, 155, 155,
1730 152, 221, 15, 15, 152, 223, 223, 15, 228, 223,
1731 15, 223
1732};
Reid Spencere7c3c602006-11-30 06:36:44 +00001733
1734#define yyerrok (yyerrstatus = 0)
1735#define yyclearin (yychar = YYEMPTY)
Jim Laskey2792cfb2006-12-06 11:03:10 +00001736#define YYEMPTY (-2)
Reid Spencere7c3c602006-11-30 06:36:44 +00001737#define YYEOF 0
Jim Laskey2792cfb2006-12-06 11:03:10 +00001738
Reid Spencere7c3c602006-11-30 06:36:44 +00001739#define YYACCEPT goto yyacceptlab
Jim Laskey2792cfb2006-12-06 11:03:10 +00001740#define YYABORT goto yyabortlab
1741#define YYERROR goto yyerrorlab
1742
1743
1744/* Like YYERROR except do call yyerror. This remains here temporarily
1745 to ease the transition to the new meaning of YYERROR, for GCC.
Reid Spencere7c3c602006-11-30 06:36:44 +00001746 Once GCC version 2 has supplanted version 1, this can go. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00001747
Reid Spencere7c3c602006-11-30 06:36:44 +00001748#define YYFAIL goto yyerrlab
Jim Laskey2792cfb2006-12-06 11:03:10 +00001749
Reid Spencere7c3c602006-11-30 06:36:44 +00001750#define YYRECOVERING() (!!yyerrstatus)
Jim Laskey2792cfb2006-12-06 11:03:10 +00001751
1752#define YYBACKUP(Token, Value) \
Reid Spencere7c3c602006-11-30 06:36:44 +00001753do \
1754 if (yychar == YYEMPTY && yylen == 1) \
Jim Laskey2792cfb2006-12-06 11:03:10 +00001755 { \
1756 yychar = (Token); \
1757 yylval = (Value); \
1758 yytoken = YYTRANSLATE (yychar); \
Reid Spencere7c3c602006-11-30 06:36:44 +00001759 YYPOPSTACK; \
1760 goto yybackup; \
1761 } \
1762 else \
Jim Laskey2792cfb2006-12-06 11:03:10 +00001763 { \
1764 yyerror (YY_("syntax error: cannot back up")); \
1765 YYERROR; \
1766 } \
Reid Spencere7c3c602006-11-30 06:36:44 +00001767while (0)
1768
Jim Laskey2792cfb2006-12-06 11:03:10 +00001769
Reid Spencere7c3c602006-11-30 06:36:44 +00001770#define YYTERROR 1
1771#define YYERRCODE 256
1772
Jim Laskey2792cfb2006-12-06 11:03:10 +00001773
1774/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1775 If N is 0, then set CURRENT to the empty location which ends
1776 the previous symbol: RHS[0] (always defined). */
1777
1778#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1779#ifndef YYLLOC_DEFAULT
1780# define YYLLOC_DEFAULT(Current, Rhs, N) \
1781 do \
1782 if (N) \
1783 { \
1784 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1785 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1786 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1787 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1788 } \
1789 else \
1790 { \
1791 (Current).first_line = (Current).last_line = \
1792 YYRHSLOC (Rhs, 0).last_line; \
1793 (Current).first_column = (Current).last_column = \
1794 YYRHSLOC (Rhs, 0).last_column; \
1795 } \
1796 while (0)
Reid Spencere7c3c602006-11-30 06:36:44 +00001797#endif
1798
Jim Laskey2792cfb2006-12-06 11:03:10 +00001799
1800/* YY_LOCATION_PRINT -- Print the location on the stream.
1801 This macro was not mandated originally: define only if we know
1802 we won't break user code: when these are the locations we know. */
1803
1804#ifndef YY_LOCATION_PRINT
1805# if YYLTYPE_IS_TRIVIAL
1806# define YY_LOCATION_PRINT(File, Loc) \
1807 fprintf (File, "%d.%d-%d.%d", \
1808 (Loc).first_line, (Loc).first_column, \
1809 (Loc).last_line, (Loc).last_column)
1810# else
1811# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1812# endif
1813#endif
1814
1815
1816/* YYLEX -- calling `yylex' with the right arguments. */
1817
Reid Spencere7c3c602006-11-30 06:36:44 +00001818#ifdef YYLEX_PARAM
Jim Laskey2792cfb2006-12-06 11:03:10 +00001819# define YYLEX yylex (YYLEX_PARAM)
Reid Spencere7c3c602006-11-30 06:36:44 +00001820#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00001821# define YYLEX yylex ()
Jim Laskey98ba5882006-12-06 10:57:33 +00001822#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001823
1824/* Enable debugging if requested. */
1825#if YYDEBUG
1826
1827# ifndef YYFPRINTF
1828# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1829# define YYFPRINTF fprintf
1830# endif
1831
1832# define YYDPRINTF(Args) \
1833do { \
1834 if (yydebug) \
1835 YYFPRINTF Args; \
1836} while (0)
1837
1838# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1839do { \
1840 if (yydebug) \
1841 { \
1842 YYFPRINTF (stderr, "%s ", Title); \
1843 yysymprint (stderr, \
1844 Type, Value); \
1845 YYFPRINTF (stderr, "\n"); \
1846 } \
1847} while (0)
1848
1849/*------------------------------------------------------------------.
1850| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1851| TOP (included). |
1852`------------------------------------------------------------------*/
1853
1854#if defined (__STDC__) || defined (__cplusplus)
1855static void
1856yy_stack_print (short int *bottom, short int *top)
Jim Laskey98ba5882006-12-06 10:57:33 +00001857#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00001858static void
1859yy_stack_print (bottom, top)
1860 short int *bottom;
1861 short int *top;
Jim Laskey98ba5882006-12-06 10:57:33 +00001862#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001863{
1864 YYFPRINTF (stderr, "Stack now");
1865 for (/* Nothing. */; bottom <= top; ++bottom)
1866 YYFPRINTF (stderr, " %d", *bottom);
1867 YYFPRINTF (stderr, "\n");
1868}
1869
1870# define YY_STACK_PRINT(Bottom, Top) \
1871do { \
1872 if (yydebug) \
1873 yy_stack_print ((Bottom), (Top)); \
1874} while (0)
1875
1876
1877/*------------------------------------------------.
1878| Report that the YYRULE is going to be reduced. |
1879`------------------------------------------------*/
1880
1881#if defined (__STDC__) || defined (__cplusplus)
1882static void
1883yy_reduce_print (int yyrule)
1884#else
1885static void
1886yy_reduce_print (yyrule)
1887 int yyrule;
Reid Spencere7c3c602006-11-30 06:36:44 +00001888#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001889{
1890 int yyi;
1891 unsigned long int yylno = yyrline[yyrule];
1892 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
1893 yyrule - 1, yylno);
1894 /* Print the symbols being reduced, and their result. */
1895 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1896 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1897 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
1898}
Reid Spencere7c3c602006-11-30 06:36:44 +00001899
Jim Laskey2792cfb2006-12-06 11:03:10 +00001900# define YY_REDUCE_PRINT(Rule) \
1901do { \
1902 if (yydebug) \
1903 yy_reduce_print (Rule); \
1904} while (0)
Reid Spencere7c3c602006-11-30 06:36:44 +00001905
Jim Laskey2792cfb2006-12-06 11:03:10 +00001906/* Nonzero means print parse trace. It is left uninitialized so that
1907 multiple parsers can coexist. */
1908int yydebug;
1909#else /* !YYDEBUG */
1910# define YYDPRINTF(Args)
1911# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1912# define YY_STACK_PRINT(Bottom, Top)
1913# define YY_REDUCE_PRINT(Rule)
1914#endif /* !YYDEBUG */
Reid Spencere7c3c602006-11-30 06:36:44 +00001915
Reid Spencere7c3c602006-11-30 06:36:44 +00001916
Jim Laskey2792cfb2006-12-06 11:03:10 +00001917/* YYINITDEPTH -- initial size of the parser's stacks. */
Reid Spencere7c3c602006-11-30 06:36:44 +00001918#ifndef YYINITDEPTH
Jim Laskey2792cfb2006-12-06 11:03:10 +00001919# define YYINITDEPTH 200
Reid Spencere7c3c602006-11-30 06:36:44 +00001920#endif
1921
Jim Laskey2792cfb2006-12-06 11:03:10 +00001922/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1923 if the built-in stack extension method is used).
Reid Spencere7c3c602006-11-30 06:36:44 +00001924
Jim Laskey2792cfb2006-12-06 11:03:10 +00001925 Do not make this value too large; the results are undefined if
1926 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1927 evaluated with infinite-precision integer arithmetic. */
Reid Spencere7c3c602006-11-30 06:36:44 +00001928
1929#ifndef YYMAXDEPTH
Jim Laskey2792cfb2006-12-06 11:03:10 +00001930# define YYMAXDEPTH 10000
Reid Spencere7c3c602006-11-30 06:36:44 +00001931#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001932
Reid Spencere7c3c602006-11-30 06:36:44 +00001933
1934
Jim Laskey2792cfb2006-12-06 11:03:10 +00001935#if YYERROR_VERBOSE
Reid Spencere7c3c602006-11-30 06:36:44 +00001936
Jim Laskey2792cfb2006-12-06 11:03:10 +00001937# ifndef yystrlen
1938# if defined (__GLIBC__) && defined (_STRING_H)
1939# define yystrlen strlen
1940# else
1941/* Return the length of YYSTR. */
1942static YYSIZE_T
1943# if defined (__STDC__) || defined (__cplusplus)
1944yystrlen (const char *yystr)
1945# else
1946yystrlen (yystr)
1947 const char *yystr;
1948# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00001949{
Jim Laskey2792cfb2006-12-06 11:03:10 +00001950 const char *yys = yystr;
Jim Laskey98ba5882006-12-06 10:57:33 +00001951
Jim Laskey2792cfb2006-12-06 11:03:10 +00001952 while (*yys++ != '\0')
1953 continue;
1954
1955 return yys - yystr - 1;
Jim Laskey98ba5882006-12-06 10:57:33 +00001956}
Jim Laskey2792cfb2006-12-06 11:03:10 +00001957# endif
1958# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00001959
Jim Laskey2792cfb2006-12-06 11:03:10 +00001960# ifndef yystpcpy
1961# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1962# define yystpcpy stpcpy
1963# else
1964/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1965 YYDEST. */
1966static char *
1967# if defined (__STDC__) || defined (__cplusplus)
1968yystpcpy (char *yydest, const char *yysrc)
1969# else
1970yystpcpy (yydest, yysrc)
1971 char *yydest;
1972 const char *yysrc;
1973# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00001974{
Jim Laskey2792cfb2006-12-06 11:03:10 +00001975 char *yyd = yydest;
1976 const char *yys = yysrc;
Jim Laskey98ba5882006-12-06 10:57:33 +00001977
Jim Laskey2792cfb2006-12-06 11:03:10 +00001978 while ((*yyd++ = *yys++) != '\0')
1979 continue;
1980
1981 return yyd - 1;
Jim Laskey98ba5882006-12-06 10:57:33 +00001982}
Jim Laskey2792cfb2006-12-06 11:03:10 +00001983# endif
1984# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00001985
Jim Laskey2792cfb2006-12-06 11:03:10 +00001986# ifndef yytnamerr
1987/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1988 quotes and backslashes, so that it's suitable for yyerror. The
1989 heuristic is that double-quoting is unnecessary unless the string
1990 contains an apostrophe, a comma, or backslash (other than
1991 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1992 null, do not copy; instead, return the length of what the result
1993 would have been. */
1994static YYSIZE_T
1995yytnamerr (char *yyres, const char *yystr)
1996{
1997 if (*yystr == '"')
1998 {
1999 size_t yyn = 0;
2000 char const *yyp = yystr;
2001
2002 for (;;)
2003 switch (*++yyp)
2004 {
2005 case '\'':
2006 case ',':
2007 goto do_not_strip_quotes;
2008
2009 case '\\':
2010 if (*++yyp != '\\')
2011 goto do_not_strip_quotes;
2012 /* Fall through. */
2013 default:
2014 if (yyres)
2015 yyres[yyn] = *yyp;
2016 yyn++;
2017 break;
2018
2019 case '"':
2020 if (yyres)
2021 yyres[yyn] = '\0';
2022 return yyn;
2023 }
2024 do_not_strip_quotes: ;
2025 }
2026
2027 if (! yyres)
2028 return yystrlen (yystr);
2029
2030 return yystpcpy (yyres, yystr) - yyres;
2031}
2032# endif
2033
2034#endif /* YYERROR_VERBOSE */
2035
Reid Spencere7c3c602006-11-30 06:36:44 +00002036
2037
Jim Laskey2792cfb2006-12-06 11:03:10 +00002038#if YYDEBUG
2039/*--------------------------------.
2040| Print this symbol on YYOUTPUT. |
2041`--------------------------------*/
Reid Spencere7c3c602006-11-30 06:36:44 +00002042
Jim Laskey2792cfb2006-12-06 11:03:10 +00002043#if defined (__STDC__) || defined (__cplusplus)
2044static void
2045yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
Jim Laskey98ba5882006-12-06 10:57:33 +00002046#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00002047static void
2048yysymprint (yyoutput, yytype, yyvaluep)
2049 FILE *yyoutput;
2050 int yytype;
2051 YYSTYPE *yyvaluep;
2052#endif
2053{
2054 /* Pacify ``unused variable'' warnings. */
2055 (void) yyvaluep;
2056
2057 if (yytype < YYNTOKENS)
2058 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2059 else
2060 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2061
2062
2063# ifdef YYPRINT
2064 if (yytype < YYNTOKENS)
2065 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2066# endif
2067 switch (yytype)
2068 {
2069 default:
2070 break;
2071 }
2072 YYFPRINTF (yyoutput, ")");
2073}
2074
2075#endif /* ! YYDEBUG */
2076/*-----------------------------------------------.
2077| Release the memory associated to this symbol. |
2078`-----------------------------------------------*/
2079
2080#if defined (__STDC__) || defined (__cplusplus)
2081static void
2082yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2083#else
2084static void
2085yydestruct (yymsg, yytype, yyvaluep)
2086 const char *yymsg;
2087 int yytype;
2088 YYSTYPE *yyvaluep;
2089#endif
2090{
2091 /* Pacify ``unused variable'' warnings. */
2092 (void) yyvaluep;
2093
2094 if (!yymsg)
2095 yymsg = "Deleting";
2096 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2097
2098 switch (yytype)
2099 {
2100
2101 default:
2102 break;
2103 }
2104}
2105
2106
2107/* Prevent warnings from -Wmissing-prototypes. */
2108
2109#ifdef YYPARSE_PARAM
2110# if defined (__STDC__) || defined (__cplusplus)
2111int yyparse (void *YYPARSE_PARAM);
2112# else
2113int yyparse ();
2114# endif
2115#else /* ! YYPARSE_PARAM */
2116#if defined (__STDC__) || defined (__cplusplus)
Reid Spencere7c3c602006-11-30 06:36:44 +00002117int yyparse (void);
Jim Laskey98ba5882006-12-06 10:57:33 +00002118#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00002119int yyparse ();
2120#endif
2121#endif /* ! YYPARSE_PARAM */
2122
2123
2124
2125/* The look-ahead symbol. */
2126int yychar;
2127
2128/* The semantic value of the look-ahead symbol. */
2129YYSTYPE yylval;
2130
2131/* Number of syntax errors so far. */
2132int yynerrs;
2133
2134
2135
2136/*----------.
2137| yyparse. |
2138`----------*/
2139
2140#ifdef YYPARSE_PARAM
2141# if defined (__STDC__) || defined (__cplusplus)
2142int yyparse (void *YYPARSE_PARAM)
2143# else
2144int yyparse (YYPARSE_PARAM)
2145 void *YYPARSE_PARAM;
2146# endif
2147#else /* ! YYPARSE_PARAM */
2148#if defined (__STDC__) || defined (__cplusplus)
2149int
2150yyparse (void)
2151#else
2152int
2153yyparse ()
2154
2155#endif
2156#endif
2157{
2158
2159 int yystate;
2160 int yyn;
2161 int yyresult;
2162 /* Number of tokens to shift before error messages enabled. */
2163 int yyerrstatus;
2164 /* Look-ahead token as an internal (translated) token number. */
2165 int yytoken = 0;
2166
2167 /* Three stacks and their tools:
2168 `yyss': related to states,
2169 `yyvs': related to semantic values,
2170 `yyls': related to locations.
2171
2172 Refer to the stacks thru separate pointers, to allow yyoverflow
2173 to reallocate them elsewhere. */
2174
2175 /* The state stack. */
2176 short int yyssa[YYINITDEPTH];
2177 short int *yyss = yyssa;
2178 short int *yyssp;
2179
2180 /* The semantic value stack. */
2181 YYSTYPE yyvsa[YYINITDEPTH];
2182 YYSTYPE *yyvs = yyvsa;
2183 YYSTYPE *yyvsp;
2184
2185
2186
Reid Spencere7c3c602006-11-30 06:36:44 +00002187#define YYPOPSTACK (yyvsp--, yyssp--)
2188
Jim Laskey2792cfb2006-12-06 11:03:10 +00002189 YYSIZE_T yystacksize = YYINITDEPTH;
Reid Spencere7c3c602006-11-30 06:36:44 +00002190
Jim Laskey2792cfb2006-12-06 11:03:10 +00002191 /* The variables used to return semantic value and location from the
2192 action routines. */
2193 YYSTYPE yyval;
Reid Spencere7c3c602006-11-30 06:36:44 +00002194
2195
Jim Laskey2792cfb2006-12-06 11:03:10 +00002196 /* When reducing, the number of symbols on the RHS of the reduced
2197 rule. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002198 int yylen;
2199
Jim Laskey2792cfb2006-12-06 11:03:10 +00002200 YYDPRINTF ((stderr, "Starting parse\n"));
Reid Spencere7c3c602006-11-30 06:36:44 +00002201
2202 yystate = 0;
2203 yyerrstatus = 0;
2204 yynerrs = 0;
2205 yychar = YYEMPTY; /* Cause a token to be read. */
2206
2207 /* Initialize stack pointers.
2208 Waste one element of value and location stack
2209 so that they stay on the same level as the state stack.
2210 The wasted elements are never initialized. */
2211
Jim Laskey2792cfb2006-12-06 11:03:10 +00002212 yyssp = yyss;
Reid Spencere7c3c602006-11-30 06:36:44 +00002213 yyvsp = yyvs;
2214
Jim Laskey2792cfb2006-12-06 11:03:10 +00002215 goto yysetstate;
Reid Spencere7c3c602006-11-30 06:36:44 +00002216
Jim Laskey2792cfb2006-12-06 11:03:10 +00002217/*------------------------------------------------------------.
2218| yynewstate -- Push a new state, which is found in yystate. |
2219`------------------------------------------------------------*/
2220 yynewstate:
2221 /* In all cases, when you get here, the value and location stacks
2222 have just been pushed. so pushing a state here evens the stacks.
2223 */
2224 yyssp++;
Reid Spencere7c3c602006-11-30 06:36:44 +00002225
Jim Laskey2792cfb2006-12-06 11:03:10 +00002226 yysetstate:
2227 *yyssp = yystate;
2228
2229 if (yyss + yystacksize - 1 <= yyssp)
Reid Spencere7c3c602006-11-30 06:36:44 +00002230 {
2231 /* Get the current used size of the three stacks, in elements. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002232 YYSIZE_T yysize = yyssp - yyss + 1;
Reid Spencere7c3c602006-11-30 06:36:44 +00002233
2234#ifdef yyoverflow
Jim Laskey2792cfb2006-12-06 11:03:10 +00002235 {
2236 /* Give user a chance to reallocate the stack. Use copies of
2237 these so that the &'s don't force the real ones into
2238 memory. */
2239 YYSTYPE *yyvs1 = yyvs;
2240 short int *yyss1 = yyss;
Reid Spencere7c3c602006-11-30 06:36:44 +00002241
Jim Laskey2792cfb2006-12-06 11:03:10 +00002242
2243 /* Each stack pointer address is followed by the size of the
2244 data in use in that stack, in bytes. This used to be a
2245 conditional around just the two extra args, but that might
2246 be undefined if yyoverflow is a macro. */
2247 yyoverflow (YY_("memory exhausted"),
2248 &yyss1, yysize * sizeof (*yyssp),
2249 &yyvs1, yysize * sizeof (*yyvsp),
2250
2251 &yystacksize);
2252
2253 yyss = yyss1;
2254 yyvs = yyvs1;
2255 }
Reid Spencere7c3c602006-11-30 06:36:44 +00002256#else /* no yyoverflow */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002257# ifndef YYSTACK_RELOCATE
2258 goto yyexhaustedlab;
2259# else
Reid Spencere7c3c602006-11-30 06:36:44 +00002260 /* Extend the stack our own way. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002261 if (YYMAXDEPTH <= yystacksize)
2262 goto yyexhaustedlab;
Reid Spencere7c3c602006-11-30 06:36:44 +00002263 yystacksize *= 2;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002264 if (YYMAXDEPTH < yystacksize)
Reid Spencere7c3c602006-11-30 06:36:44 +00002265 yystacksize = YYMAXDEPTH;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002266
2267 {
2268 short int *yyss1 = yyss;
2269 union yyalloc *yyptr =
2270 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2271 if (! yyptr)
2272 goto yyexhaustedlab;
2273 YYSTACK_RELOCATE (yyss);
2274 YYSTACK_RELOCATE (yyvs);
2275
2276# undef YYSTACK_RELOCATE
2277 if (yyss1 != yyssa)
2278 YYSTACK_FREE (yyss1);
2279 }
2280# endif
Reid Spencere7c3c602006-11-30 06:36:44 +00002281#endif /* no yyoverflow */
2282
Jim Laskey2792cfb2006-12-06 11:03:10 +00002283 yyssp = yyss + yysize - 1;
2284 yyvsp = yyvs + yysize - 1;
Reid Spencere7c3c602006-11-30 06:36:44 +00002285
2286
Jim Laskey2792cfb2006-12-06 11:03:10 +00002287 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2288 (unsigned long int) yystacksize));
2289
2290 if (yyss + yystacksize - 1 <= yyssp)
Reid Spencere7c3c602006-11-30 06:36:44 +00002291 YYABORT;
2292 }
2293
Jim Laskey2792cfb2006-12-06 11:03:10 +00002294 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
Reid Spencere7c3c602006-11-30 06:36:44 +00002295
2296 goto yybackup;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002297
2298/*-----------.
2299| yybackup. |
2300`-----------*/
2301yybackup:
Reid Spencere7c3c602006-11-30 06:36:44 +00002302
2303/* Do appropriate processing given the current state. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002304/* Read a look-ahead token if we need one and don't already have one. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002305/* yyresume: */
2306
Jim Laskey2792cfb2006-12-06 11:03:10 +00002307 /* First try to decide what to do without reference to look-ahead token. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002308
2309 yyn = yypact[yystate];
Jim Laskey2792cfb2006-12-06 11:03:10 +00002310 if (yyn == YYPACT_NINF)
Reid Spencere7c3c602006-11-30 06:36:44 +00002311 goto yydefault;
2312
Jim Laskey2792cfb2006-12-06 11:03:10 +00002313 /* Not known => get a look-ahead token if don't already have one. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002314
Jim Laskey2792cfb2006-12-06 11:03:10 +00002315 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002316 if (yychar == YYEMPTY)
2317 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002318 YYDPRINTF ((stderr, "Reading a token: "));
Reid Spencere7c3c602006-11-30 06:36:44 +00002319 yychar = YYLEX;
2320 }
2321
Jim Laskey2792cfb2006-12-06 11:03:10 +00002322 if (yychar <= YYEOF)
Reid Spencere7c3c602006-11-30 06:36:44 +00002323 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002324 yychar = yytoken = YYEOF;
2325 YYDPRINTF ((stderr, "Now at end of input.\n"));
Reid Spencere7c3c602006-11-30 06:36:44 +00002326 }
2327 else
2328 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002329 yytoken = YYTRANSLATE (yychar);
2330 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
Reid Spencere7c3c602006-11-30 06:36:44 +00002331 }
2332
Jim Laskey2792cfb2006-12-06 11:03:10 +00002333 /* If the proper action on seeing token YYTOKEN is to reduce or to
2334 detect an error, take that action. */
2335 yyn += yytoken;
2336 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
Reid Spencere7c3c602006-11-30 06:36:44 +00002337 goto yydefault;
2338 yyn = yytable[yyn];
Jim Laskey2792cfb2006-12-06 11:03:10 +00002339 if (yyn <= 0)
Reid Spencere7c3c602006-11-30 06:36:44 +00002340 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002341 if (yyn == 0 || yyn == YYTABLE_NINF)
Reid Spencere7c3c602006-11-30 06:36:44 +00002342 goto yyerrlab;
2343 yyn = -yyn;
2344 goto yyreduce;
2345 }
2346
2347 if (yyn == YYFINAL)
2348 YYACCEPT;
2349
Jim Laskey2792cfb2006-12-06 11:03:10 +00002350 /* Shift the look-ahead token. */
2351 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
Reid Spencere7c3c602006-11-30 06:36:44 +00002352
2353 /* Discard the token being shifted unless it is eof. */
2354 if (yychar != YYEOF)
2355 yychar = YYEMPTY;
2356
2357 *++yyvsp = yylval;
2358
Jim Laskey2792cfb2006-12-06 11:03:10 +00002359
2360 /* Count tokens shifted since error; after three, turn off error
2361 status. */
2362 if (yyerrstatus)
2363 yyerrstatus--;
Reid Spencere7c3c602006-11-30 06:36:44 +00002364
2365 yystate = yyn;
2366 goto yynewstate;
2367
Jim Laskey98ba5882006-12-06 10:57:33 +00002368
Jim Laskey2792cfb2006-12-06 11:03:10 +00002369/*-----------------------------------------------------------.
2370| yydefault -- do the default action for the current state. |
2371`-----------------------------------------------------------*/
2372yydefault:
Reid Spencere7c3c602006-11-30 06:36:44 +00002373 yyn = yydefact[yystate];
2374 if (yyn == 0)
2375 goto yyerrlab;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002376 goto yyreduce;
Reid Spencere7c3c602006-11-30 06:36:44 +00002377
Jim Laskey2792cfb2006-12-06 11:03:10 +00002378
2379/*-----------------------------.
2380| yyreduce -- Do a reduction. |
2381`-----------------------------*/
Reid Spencere7c3c602006-11-30 06:36:44 +00002382yyreduce:
Jim Laskey2792cfb2006-12-06 11:03:10 +00002383 /* yyn is the number of a rule to reduce with. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002384 yylen = yyr2[yyn];
2385
Jim Laskey2792cfb2006-12-06 11:03:10 +00002386 /* If YYLEN is nonzero, implement the default value of the action:
2387 `$$ = $1'.
2388
2389 Otherwise, the following line sets YYVAL to garbage.
2390 This behavior is undocumented and Bison
2391 users should not rely upon it. Assigning to YYVAL
2392 unconditionally makes the parser a bit smaller, and it avoids a
2393 GCC warning that YYVAL may be used uninitialized. */
2394 yyval = yyvsp[1-yylen];
2395
2396
2397 YY_REDUCE_PRINT (yyn);
2398 switch (yyn)
Reid Spencere7c3c602006-11-30 06:36:44 +00002399 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002400 case 81:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002401#line 363 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002402 {
2403 (yyval.String) = (yyvsp[-1].String);
2404 ;}
2405 break;
Reid Spencere7c3c602006-11-30 06:36:44 +00002406
Jim Laskey2792cfb2006-12-06 11:03:10 +00002407 case 82:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002408#line 366 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002409 {
2410 (yyval.String) = new std::string("");
2411 ;}
2412 break;
Reid Spencere7c3c602006-11-30 06:36:44 +00002413
Jim Laskey2792cfb2006-12-06 11:03:10 +00002414 case 90:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002415#line 373 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002416 { (yyval.String) = new std::string(""); ;}
2417 break;
Reid Spencere77e35e2006-12-01 20:26:20 +00002418
Jim Laskey2792cfb2006-12-06 11:03:10 +00002419 case 97:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002420#line 378 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002421 {
2422 *(yyvsp[-1].String) += *(yyvsp[0].String);
2423 delete (yyvsp[0].String);
2424 (yyval.String) = (yyvsp[-1].String);
2425 ;}
2426 break;
Reid Spencer16244f42006-12-01 21:10:07 +00002427
Jim Laskey2792cfb2006-12-06 11:03:10 +00002428 case 98:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002429#line 383 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002430 { (yyval.String) = new std::string(""); ;}
2431 break;
Reid Spencere7c3c602006-11-30 06:36:44 +00002432
Jim Laskey2792cfb2006-12-06 11:03:10 +00002433 case 99:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002434#line 388 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002435 { (yyval.String) = new std::string(); ;}
2436 break;
2437
2438 case 100:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002439#line 389 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002440 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
2441 break;
2442
2443 case 101:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002444#line 392 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002445 { (yyval.String) = new std::string(); ;}
2446 break;
2447
2448 case 102:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002449#line 393 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002450 {
2451 (yyvsp[-1].String)->insert(0, ", ");
2452 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2453 delete (yyvsp[0].String);
2454 (yyval.String) = (yyvsp[-1].String);
2455 ;}
2456 break;
2457
2458 case 103:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002459#line 401 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002460 {
2461 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2462 delete (yyvsp[0].String);
2463 (yyval.String) = (yyvsp[-1].String);
2464 ;}
2465 break;
2466
2467 case 104:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002468#line 407 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002469 { (yyval.String) = new std::string(); ;}
2470 break;
2471
2472 case 106:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002473#line 411 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002474 { (yyval.String) = new std::string(); ;}
2475 break;
2476
2477 case 107:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002478#line 412 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002479 {
2480 (yyvsp[-1].String)->insert(0, ", ");
2481 if (!(yyvsp[0].String)->empty())
2482 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2483 delete (yyvsp[0].String);
2484 (yyval.String) = (yyvsp[-1].String);
2485 ;}
2486 break;
2487
2488 case 109:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002489#line 422 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002490 {
2491 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2492 delete (yyvsp[0].String);
2493 (yyval.String) = (yyvsp[-1].String);
2494 ;}
2495 break;
2496
2497 case 127:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002498#line 444 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002499 {
2500 (yyval.Type).newTy = (yyvsp[0].String);
2501 (yyval.Type).oldTy = OpaqueTy;
2502 ;}
2503 break;
2504
2505 case 128:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002506#line 448 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002507 {
2508 (yyval.Type).newTy = (yyvsp[0].String);
2509 (yyval.Type).oldTy = UnresolvedTy;
2510 ;}
2511 break;
2512
2513 case 129:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002514#line 452 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002515 {
2516 (yyval.Type) = (yyvsp[0].Type);
2517 ;}
2518 break;
2519
2520 case 130:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002521#line 455 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002522 { // Type UpReference
2523 (yyvsp[0].String)->insert(0, "\\");
2524 (yyval.Type).newTy = (yyvsp[0].String);
2525 (yyval.Type).oldTy = NumericTy;
2526 ;}
2527 break;
2528
2529 case 131:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002530#line 460 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002531 { // Function derived type?
2532 *(yyvsp[-3].Type).newTy += "( " + *(yyvsp[-1].String) + " )";
2533 delete (yyvsp[-1].String);
2534 (yyval.Type).newTy = (yyvsp[-3].Type).newTy;
2535 (yyval.Type).oldTy = FunctionTy;
2536 ;}
2537 break;
2538
2539 case 132:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002540#line 466 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002541 { // Sized array type?
2542 (yyvsp[-3].String)->insert(0,"[ ");
2543 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " ]";
2544 delete (yyvsp[-1].Type).newTy;
2545 (yyval.Type).newTy = (yyvsp[-3].String);
2546 (yyval.Type).oldTy = ArrayTy;
2547 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
2548 ;}
2549 break;
2550
2551 case 133:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002552#line 474 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002553 { // Packed array type?
2554 (yyvsp[-3].String)->insert(0,"< ");
2555 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " >";
2556 delete (yyvsp[-1].Type).newTy;
2557 (yyval.Type).newTy = (yyvsp[-3].String);
2558 (yyval.Type).oldTy = PackedTy;
2559 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
2560 ;}
2561 break;
2562
2563 case 134:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002564#line 482 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002565 { // Structure type?
2566 (yyvsp[-1].String)->insert(0, "{ ");
2567 *(yyvsp[-1].String) += " }";
2568 (yyval.Type).newTy = (yyvsp[-1].String);
2569 (yyval.Type).oldTy = StructTy;
2570 ;}
2571 break;
2572
2573 case 135:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002574#line 488 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002575 { // Empty structure type?
2576 (yyval.Type).newTy = new std::string("{}");
2577 (yyval.Type).oldTy = StructTy;
2578 ;}
2579 break;
2580
2581 case 136:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002582#line 492 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002583 { // Pointer type?
2584 *(yyvsp[-1].Type).newTy += '*';
2585 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
2586 (yyvsp[-1].Type).oldTy = PointerTy;
2587 (yyval.Type) = (yyvsp[-1].Type);
2588 ;}
2589 break;
2590
2591 case 137:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002592#line 503 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002593 {
2594 (yyval.String) = (yyvsp[0].Type).newTy;
2595 ;}
2596 break;
2597
2598 case 138:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002599#line 506 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002600 {
2601 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Type).newTy;
2602 delete (yyvsp[0].Type).newTy;
2603 (yyval.String) = (yyvsp[-2].String);
2604 ;}
2605 break;
2606
2607 case 140:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002608#line 515 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002609 {
2610 *(yyvsp[-2].String) += ", ...";
2611 delete (yyvsp[0].String);
2612 (yyval.String) = (yyvsp[-2].String);
2613 ;}
2614 break;
2615
2616 case 141:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002617#line 520 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002618 {
2619 (yyval.String) = (yyvsp[0].String);
2620 ;}
2621 break;
2622
2623 case 142:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002624#line 523 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002625 {
2626 (yyval.String) = new std::string();
2627 ;}
2628 break;
2629
2630 case 143:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002631#line 533 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002632 { // Nonempty unsized arr
2633 (yyval.Const).type = (yyvsp[-3].Type);
2634 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2635 *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]";
2636 delete (yyvsp[-1].String);
2637 ;}
2638 break;
2639
2640 case 144:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002641#line 539 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002642 {
2643 (yyval.Const).type = (yyvsp[-2].Type);
2644 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2645 *(yyval.Const).cnst += "[ ]";
2646 ;}
2647 break;
2648
2649 case 145:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002650#line 544 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002651 {
2652 (yyval.Const).type = (yyvsp[-2].Type);
2653 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2654 *(yyval.Const).cnst += " c" + *(yyvsp[0].String);
2655 delete (yyvsp[0].String);
2656 ;}
2657 break;
2658
2659 case 146:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002660#line 550 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002661 { // Nonempty unsized arr
2662 (yyval.Const).type = (yyvsp[-3].Type);
2663 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2664 *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >";
2665 delete (yyvsp[-1].String);
2666 ;}
2667 break;
2668
2669 case 147:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002670#line 556 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002671 {
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
2679 case 148:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002680#line 562 "/proj/llvm/llvm-3/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
2688 case 149:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002689#line 567 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002690 {
2691 (yyval.Const).type = (yyvsp[-1].Type);
2692 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2693 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2694 delete (yyvsp[0].String);
2695 ;}
2696 break;
2697
2698 case 150:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002699#line 573 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002700 {
2701 (yyval.Const).type = (yyvsp[-1].Type);
2702 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2703 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2704 delete (yyvsp[0].String);
2705 ;}
2706 break;
2707
Reid Spencer187ccf82006-12-09 16:57:22 +00002708 case 151:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002709#line 579 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002710 {
2711 (yyval.Const).type = (yyvsp[-1].Type);
2712 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2713 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2714 delete (yyvsp[0].String);
2715 ;}
2716 break;
2717
Reid Spencer187ccf82006-12-09 16:57:22 +00002718 case 152:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002719#line 585 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002720 {
2721 (yyval.Const).type = (yyvsp[-1].Type);
2722 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2723 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2724 delete (yyvsp[0].String);
2725 ;}
2726 break;
2727
Reid Spencer187ccf82006-12-09 16:57:22 +00002728 case 153:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002729#line 591 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer187ccf82006-12-09 16:57:22 +00002730 {
2731 (yyval.Const).type = (yyvsp[-1].Type);
2732 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2733 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2734 delete (yyvsp[0].String);
2735 ;}
2736 break;
2737
2738 case 154:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002739#line 597 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002740 { // integral constants
2741 (yyval.Const).type = (yyvsp[-1].Type);
2742 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2743 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2744 delete (yyvsp[0].String);
2745 ;}
2746 break;
2747
2748 case 155:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002749#line 603 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002750 { // integral constants
2751 (yyval.Const).type = (yyvsp[-1].Type);
2752 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2753 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2754 delete (yyvsp[0].String);
2755 ;}
2756 break;
2757
2758 case 156:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002759#line 609 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002760 { // Boolean constants
2761 (yyval.Const).type = (yyvsp[-1].Type);
2762 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2763 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2764 delete (yyvsp[0].String);
2765 ;}
2766 break;
2767
2768 case 157:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002769#line 615 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002770 { // Boolean constants
2771 (yyval.Const).type = (yyvsp[-1].Type);
2772 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2773 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2774 delete (yyvsp[0].String);
2775 ;}
2776 break;
2777
2778 case 158:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002779#line 621 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002780 { // Float & Double constants
2781 (yyval.Const).type = (yyvsp[-1].Type);
2782 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2783 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2784 delete (yyvsp[0].String);
2785 ;}
2786 break;
2787
2788 case 159:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002789#line 629 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002790 {
2791 std::string source = *(yyvsp[-3].Const).cnst;
2792 TypeInfo DstTy = (yyvsp[-1].Type);
Reid Spencera50d5962006-12-02 04:11:07 +00002793 ResolveType(DstTy);
Jim Laskey2792cfb2006-12-06 11:03:10 +00002794 if (*(yyvsp[-5].String) == "cast") {
Reid Spencera50d5962006-12-02 04:11:07 +00002795 // Call getCastUpgrade to upgrade the old cast
Jim Laskey2792cfb2006-12-06 11:03:10 +00002796 (yyval.String) = new std::string(getCastUpgrade(source, (yyvsp[-3].Const).type, (yyvsp[-1].Type), true));
Reid Spencera50d5962006-12-02 04:11:07 +00002797 } else {
2798 // Nothing to upgrade, just create the cast constant expr
Jim Laskey2792cfb2006-12-06 11:03:10 +00002799 (yyval.String) = new std::string(*(yyvsp[-5].String));
2800 *(yyval.String) += "( " + source + " to " + *(yyvsp[-1].Type).newTy + ")";
Reid Spencer280d8012006-12-01 23:40:53 +00002801 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00002802 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
2803 ;}
2804 break;
2805
2806 case 160:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002807#line 643 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002808 {
2809 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst;
2810 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
2811 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
2812 *(yyvsp[-4].String) += ", " + *VI.val;
Reid Spencerf8483652006-12-02 15:16:01 +00002813 VI.destroy();
2814 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00002815 *(yyvsp[-4].String) += ")";
2816 (yyval.String) = (yyvsp[-4].String);
2817 (yyvsp[-2].Const).destroy();
2818 delete (yyvsp[-1].ValList);
2819 ;}
2820 break;
2821
2822 case 161:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002823#line 655 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002824 {
2825 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2826 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2827 (yyval.String) = (yyvsp[-7].String);
2828 ;}
2829 break;
2830
2831 case 162:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002832#line 660 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002833 {
2834 const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
2835 (yyval.String) = new std::string(op);
2836 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2837 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2838 ;}
2839 break;
2840
2841 case 163:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002842#line 666 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002843 {
2844 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2845 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2846 (yyval.String) = (yyvsp[-5].String);
2847 ;}
2848 break;
2849
2850 case 164:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002851#line 671 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002852 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002853 *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
Jim Laskey2792cfb2006-12-06 11:03:10 +00002854 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2855 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2856 (yyval.String) = (yyvsp[-5].String);
2857 ;}
2858 break;
2859
2860 case 165:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002861#line 677 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002862 {
2863 *(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2864 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2865 (yyval.String) = (yyvsp[-6].String);
2866 ;}
2867 break;
2868
2869 case 166:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002870#line 682 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002871 {
2872 *(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2873 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2874 (yyval.String) = (yyvsp[-6].String);
2875 ;}
2876 break;
2877
2878 case 167:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002879#line 687 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002880 {
2881 const char* shiftop = (yyvsp[-5].String)->c_str();
2882 if (*(yyvsp[-5].String) == "shr")
2883 shiftop = ((yyvsp[-3].Const).type.isUnsigned()) ? "lshr" : "ashr";
2884 (yyval.String) = new std::string(shiftop);
2885 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2886 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2887 ;}
2888 break;
2889
2890 case 168:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002891#line 695 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002892 {
2893 *(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
2899 case 169:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002900#line 700 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002901 {
2902 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2903 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2904 (yyval.String) = (yyvsp[-7].String);
2905 ;}
2906 break;
2907
2908 case 170:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002909#line 705 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002910 {
2911 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2912 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2913 (yyval.String) = (yyvsp[-7].String);
2914 ;}
2915 break;
2916
2917 case 171:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002918#line 715 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002919 {
2920 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst;
2921 (yyvsp[0].Const).destroy();
2922 (yyval.String) = (yyvsp[-2].String);
2923 ;}
2924 break;
2925
2926 case 172:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002927#line 720 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002928 { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;}
2929 break;
2930
2931 case 175:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002932#line 735 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002933 {
2934;}
2935 break;
2936
2937 case 176:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002938#line 740 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002939 {
2940 (yyval.String) = 0;
2941 ;}
2942 break;
2943
2944 case 177:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002945#line 743 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002946 {
2947 *O << *(yyvsp[0].String) << "\n";
2948 delete (yyvsp[0].String);
2949 (yyval.String) = 0;
2950 ;}
2951 break;
2952
2953 case 178:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002954#line 748 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002955 {
2956 *O << "module asm " << " " << *(yyvsp[0].String) << "\n";
2957 (yyval.String) = 0;
2958 ;}
2959 break;
2960
2961 case 179:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002962#line 752 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002963 {
Reid Spencerd154b572006-12-01 20:36:40 +00002964 *O << "implementation\n";
Jim Laskey2792cfb2006-12-06 11:03:10 +00002965 (yyval.String) = 0;
2966 ;}
2967 break;
2968
2969 case 180:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002970#line 756 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002971 { (yyval.String) = 0; ;}
2972 break;
2973
2974 case 182:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002975#line 758 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002976 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
2977 break;
2978
2979 case 183:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002980#line 761 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002981 {
2982 EnumeratedTypes.push_back((yyvsp[0].Type));
2983 if (!(yyvsp[-2].String)->empty()) {
2984 NamedTypes[*(yyvsp[-2].String)].newTy = new std::string(*(yyvsp[0].Type).newTy);
2985 NamedTypes[*(yyvsp[-2].String)].oldTy = (yyvsp[0].Type).oldTy;
2986 NamedTypes[*(yyvsp[-2].String)].elemTy = (yyvsp[0].Type).elemTy;
2987 *O << *(yyvsp[-2].String) << " = ";
Reid Spencera50d5962006-12-02 04:11:07 +00002988 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00002989 *O << "type " << *(yyvsp[0].Type).newTy << "\n";
2990 delete (yyvsp[-2].String); delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
2991 (yyval.String) = 0;
2992 ;}
2993 break;
2994
2995 case 184:
Reid Spencere4d87aa2006-12-23 06:05:41 +00002996#line 773 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002997 { // Function prototypes can be in const pool
2998 *O << *(yyvsp[0].String) << "\n";
2999 delete (yyvsp[0].String);
3000 (yyval.String) = 0;
3001 ;}
3002 break;
3003
3004 case 185:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003005#line 778 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003006 { // Asm blocks can be in the const pool
3007 *O << *(yyvsp[-2].String) << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
3008 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3009 (yyval.String) = 0;
3010 ;}
3011 break;
3012
3013 case 186:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003014#line 783 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003015 {
3016 if (!(yyvsp[-4].String)->empty()) {
3017 *O << *(yyvsp[-4].String) << " = ";
3018 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Const).type.clone();
Reid Spencerf12ee422006-12-05 19:21:25 +00003019 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003020 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Const).cnst << " " << *(yyvsp[0].String) << "\n";
3021 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Const).destroy(); delete (yyvsp[0].String);
3022 (yyval.String) = 0;
3023 ;}
3024 break;
3025
3026 case 187:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003027#line 792 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003028 {
3029 if (!(yyvsp[-4].String)->empty()) {
3030 *O << *(yyvsp[-4].String) << " = ";
3031 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Type).clone();
Reid Spencerf12ee422006-12-05 19:21:25 +00003032 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003033 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
3034 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3035 (yyval.String) = 0;
3036 ;}
3037 break;
3038
3039 case 188:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003040#line 801 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003041 {
3042 if (!(yyvsp[-4].String)->empty()) {
3043 *O << *(yyvsp[-4].String) << " = ";
3044 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Type).clone();
Reid Spencerf12ee422006-12-05 19:21:25 +00003045 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003046 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
3047 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3048 (yyval.String) = 0;
3049 ;}
3050 break;
3051
3052 case 189:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003053#line 810 "/proj/llvm/llvm-3/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].Type).clone();
Reid Spencerf12ee422006-12-05 19:21:25 +00003058 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003059 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
3060 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3061 (yyval.String) = 0;
3062 ;}
3063 break;
3064
3065 case 190:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003066#line 819 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003067 {
3068 *O << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
3069 delete (yyvsp[-1].String); delete (yyvsp[0].String);
3070 (yyval.String) = 0;
3071 ;}
3072 break;
3073
3074 case 191:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003075#line 824 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003076 {
3077 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << "\n";
3078 delete (yyvsp[-2].String); delete (yyvsp[0].String);
3079 (yyval.String) = 0;
3080 ;}
3081 break;
3082
3083 case 192:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003084#line 829 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003085 {
3086 (yyval.String) = 0;
3087 ;}
3088 break;
3089
3090 case 196:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003091#line 839 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003092 {
3093 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3094 delete (yyvsp[0].String);
3095 (yyval.String) = (yyvsp[-2].String);
3096 ;}
3097 break;
3098
3099 case 197:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003100#line 844 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003101 {
3102 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3103 if (*(yyvsp[0].String) == "64")
Reid Spencere77e35e2006-12-01 20:26:20 +00003104 SizeOfPointer = 64;
Jim Laskey2792cfb2006-12-06 11:03:10 +00003105 delete (yyvsp[0].String);
3106 (yyval.String) = (yyvsp[-2].String);
3107 ;}
3108 break;
3109
3110 case 198:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003111#line 851 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003112 {
3113 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3114 delete (yyvsp[0].String);
3115 (yyval.String) = (yyvsp[-2].String);
3116 ;}
3117 break;
3118
3119 case 199:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003120#line 856 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003121 {
3122 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3123 delete (yyvsp[0].String);
3124 (yyval.String) = (yyvsp[-2].String);
3125 ;}
3126 break;
3127
3128 case 200:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003129#line 863 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003130 {
3131 (yyvsp[-1].String)->insert(0, "[ ");
3132 *(yyvsp[-1].String) += " ]";
3133 (yyval.String) = (yyvsp[-1].String);
3134 ;}
3135 break;
3136
3137 case 201:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003138#line 870 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003139 {
3140 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3141 delete (yyvsp[0].String);
3142 (yyval.String) = (yyvsp[-2].String);
3143 ;}
3144 break;
3145
3146 case 203:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003147#line 876 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003148 {
3149 (yyval.String) = new std::string();
3150 ;}
3151 break;
3152
3153 case 207:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003154#line 885 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003155 { (yyval.String) = new std::string(); ;}
3156 break;
3157
3158 case 208:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003159#line 887 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003160 {
3161 (yyval.String) = (yyvsp[-1].Type).newTy;
3162 if (!(yyvsp[0].String)->empty())
3163 *(yyval.String) += " " + *(yyvsp[0].String);
3164 delete (yyvsp[0].String);
3165;}
3166 break;
3167
3168 case 209:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003169#line 894 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003170 {
3171 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3172 delete (yyvsp[0].String);
3173 ;}
3174 break;
3175
3176 case 210:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003177#line 898 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003178 {
3179 (yyval.String) = (yyvsp[0].String);
3180 ;}
3181 break;
3182
3183 case 211:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003184#line 902 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003185 {
3186 (yyval.String) = (yyvsp[0].String);
3187 ;}
3188 break;
3189
3190 case 212:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003191#line 905 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003192 {
3193 *(yyvsp[-2].String) += ", ...";
3194 (yyval.String) = (yyvsp[-2].String);
3195 delete (yyvsp[0].String);
3196 ;}
3197 break;
3198
3199 case 213:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003200#line 910 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003201 {
3202 (yyval.String) = (yyvsp[0].String);
3203 ;}
3204 break;
3205
3206 case 214:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003207#line 913 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003208 { (yyval.String) = new std::string(); ;}
3209 break;
3210
3211 case 215:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003212#line 916 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003213 {
3214 if (!(yyvsp[-7].String)->empty()) {
3215 *(yyvsp[-7].String) += " ";
Reid Spencere77e35e2006-12-01 20:26:20 +00003216 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003217 *(yyvsp[-7].String) += *(yyvsp[-6].Type).newTy + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
3218 if (!(yyvsp[-1].String)->empty()) {
3219 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003220 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003221 if (!(yyvsp[0].String)->empty()) {
3222 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003223 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003224 (yyvsp[-6].Type).destroy();
3225 delete (yyvsp[-5].String);
3226 delete (yyvsp[-3].String);
3227 delete (yyvsp[-1].String);
3228 delete (yyvsp[0].String);
3229 (yyval.String) = (yyvsp[-7].String);
3230 ;}
3231 break;
3232
3233 case 216:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003234#line 935 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003235 { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
3236 break;
3237
3238 case 217:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003239#line 936 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003240 { (yyval.String) = new std::string ("{"); ;}
3241 break;
3242
3243 case 218:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003244#line 938 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003245 {
3246 if (!(yyvsp[-2].String)->empty()) {
3247 *O << *(yyvsp[-2].String) << " ";
Reid Spencere77e35e2006-12-01 20:26:20 +00003248 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003249 *O << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
3250 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3251 (yyval.String) = 0;
3252;}
3253 break;
3254
3255 case 219:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003256#line 947 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003257 { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
3258 break;
3259
3260 case 220:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003261#line 948 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003262 { (yyval.String) = new std::string("}"); ;}
3263 break;
3264
3265 case 221:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003266#line 950 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003267 {
3268 if ((yyvsp[-1].String))
3269 *O << *(yyvsp[-1].String);
3270 *O << '\n' << *(yyvsp[0].String) << "\n";
3271 (yyval.String) = 0;
3272;}
3273 break;
3274
3275 case 222:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003276#line 958 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003277 { (yyval.String) = new std::string(); ;}
3278 break;
3279
3280 case 225:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003281#line 964 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003282 {
3283 if (!(yyvsp[-1].String)->empty())
3284 *(yyvsp[-2].String) += " " + *(yyvsp[-1].String);
3285 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3286 delete (yyvsp[-1].String);
3287 delete (yyvsp[0].String);
3288 (yyval.String) = (yyvsp[-2].String);
3289 ;}
3290 break;
3291
3292 case 226:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003293#line 977 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003294 { (yyval.String) = new std::string(); ;}
3295 break;
3296
3297 case 236:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003298#line 983 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003299 {
3300 (yyvsp[-1].String)->insert(0, "<");
3301 *(yyvsp[-1].String) += ">";
3302 (yyval.String) = (yyvsp[-1].String);
3303 ;}
3304 break;
3305
3306 case 238:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003307#line 989 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003308 {
3309 if (!(yyvsp[-3].String)->empty()) {
3310 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003311 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003312 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
3313 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3314 (yyval.String) = (yyvsp[-4].String);
3315 ;}
3316 break;
3317
3318 case 241:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003319#line 1002 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003320 {
3321 (yyval.Value).val = (yyvsp[0].String);
3322 (yyval.Value).constant = false;
3323 (yyval.Value).type.newTy = 0;
3324 (yyval.Value).type.oldTy = UnresolvedTy;
3325 ;}
3326 break;
3327
3328 case 242:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003329#line 1008 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003330 {
3331 (yyval.Value).val = (yyvsp[0].String);
3332 (yyval.Value).constant = true;
3333 (yyval.Value).type.newTy = 0;
3334 (yyval.Value).type.oldTy = UnresolvedTy;
3335 ;}
3336 break;
3337
3338 case 243:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003339#line 1019 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003340 {
3341 (yyval.Value) = (yyvsp[0].Value);
3342 (yyval.Value).type = (yyvsp[-1].Type);
3343 (yyval.Value).val->insert(0, *(yyvsp[-1].Type).newTy + " ");
3344 ;}
3345 break;
3346
3347 case 244:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003348#line 1025 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003349 {
3350 (yyval.String) = 0;
3351 ;}
3352 break;
3353
3354 case 245:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003355#line 1028 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003356 { // Do not allow functions with 0 basic blocks
3357 (yyval.String) = 0;
3358 ;}
3359 break;
3360
3361 case 246:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003362#line 1036 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003363 {
3364 (yyval.String) = 0;
3365 ;}
3366 break;
3367
3368 case 247:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003369#line 1040 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003370 {
3371 *O << " " << *(yyvsp[0].String) << "\n";
3372 delete (yyvsp[0].String);
3373 (yyval.String) = 0;
3374 ;}
3375 break;
3376
3377 case 248:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003378#line 1045 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003379 {
3380 (yyval.String) = 0;
3381 ;}
3382 break;
3383
3384 case 249:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003385#line 1048 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003386 {
3387 *O << *(yyvsp[0].String) << "\n";
3388 delete (yyvsp[0].String);
3389 (yyval.String) = 0;
3390 ;}
3391 break;
3392
3393 case 251:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003394#line 1054 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003395 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
3396 break;
3397
3398 case 252:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003399#line 1056 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003400 { // Return with a result...
3401 *O << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].Value).val << "\n";
3402 delete (yyvsp[-1].String); (yyvsp[0].Value).destroy();
3403 (yyval.String) = 0;
3404 ;}
3405 break;
3406
3407 case 253:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003408#line 1061 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003409 { // Return with no result...
3410 *O << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].Type).newTy << "\n";
3411 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
3412 (yyval.String) = 0;
3413 ;}
3414 break;
3415
3416 case 254:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003417#line 1066 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003418 { // Unconditional Branch...
3419 *O << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].Value).val << "\n";
3420 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3421 (yyval.String) = 0;
3422 ;}
3423 break;
3424
3425 case 255:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003426#line 1071 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003427 {
3428 *O << " " << *(yyvsp[-8].String) << " " << *(yyvsp[-7].Type).newTy << " " << *(yyvsp[-6].Value).val << ", "
3429 << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << ", " << *(yyvsp[-1].Type).newTy << " "
3430 << *(yyvsp[0].Value).val << "\n";
3431 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3432 (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3433 (yyval.String) = 0;
3434 ;}
3435 break;
3436
3437 case 256:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003438#line 1079 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003439 {
3440 *O << " " << *(yyvsp[-8].String) << " " << *(yyvsp[-7].Type).newTy << " " << *(yyvsp[-6].Value).val << ", "
3441 << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << " [" << *(yyvsp[-1].String) << " ]\n";
3442 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3443 delete (yyvsp[-1].String);
3444 (yyval.String) = 0;
3445 ;}
3446 break;
3447
3448 case 257:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003449#line 1086 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003450 {
3451 *O << " " << *(yyvsp[-7].String) << " " << *(yyvsp[-6].Type).newTy << " " << *(yyvsp[-5].Value).val << ", "
3452 << *(yyvsp[-3].Type).newTy << " " << *(yyvsp[-2].Value).val << "[]\n";
3453 delete (yyvsp[-7].String); (yyvsp[-6].Type).destroy(); (yyvsp[-5].Value).destroy(); (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy();
3454 (yyval.String) = 0;
3455 ;}
3456 break;
3457
3458 case 258:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003459#line 1093 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003460 {
Reid Spencer16244f42006-12-01 21:10:07 +00003461 *O << " ";
Jim Laskey2792cfb2006-12-06 11:03:10 +00003462 if (!(yyvsp[-13].String)->empty())
3463 *O << *(yyvsp[-13].String) << " = ";
3464 *O << *(yyvsp[-12].String) << " " << *(yyvsp[-11].String) << " " << *(yyvsp[-10].Type).newTy << " " << *(yyvsp[-9].Value).val << " (";
3465 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
3466 ValueInfo& VI = (*(yyvsp[-7].ValList))[i];
Reid Spencerf8483652006-12-02 15:16:01 +00003467 *O << *VI.val;
Jim Laskey2792cfb2006-12-06 11:03:10 +00003468 if (i+1 < (yyvsp[-7].ValList)->size())
Reid Spencerf8483652006-12-02 15:16:01 +00003469 *O << ", ";
3470 VI.destroy();
3471 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003472 *O << ") " << *(yyvsp[-5].String) << " " << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << " "
3473 << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].Value).val << "\n";
3474 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); (yyvsp[-10].Type).destroy(); (yyvsp[-9].Value).destroy(); delete (yyvsp[-7].ValList);
3475 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
3476 (yyvsp[0].Value).destroy();
3477 (yyval.String) = 0;
3478 ;}
3479 break;
3480
3481 case 259:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003482#line 1112 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003483 {
3484 *O << " " << *(yyvsp[0].String) << "\n";
3485 delete (yyvsp[0].String);
3486 (yyval.String) = 0;
3487 ;}
3488 break;
3489
3490 case 260:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003491#line 1117 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003492 {
3493 *O << " " << *(yyvsp[0].String) << "\n";
3494 delete (yyvsp[0].String);
3495 (yyval.String) = 0;
3496 ;}
3497 break;
3498
3499 case 261:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003500#line 1123 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003501 {
3502 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].String) + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3503 (yyvsp[-4].Type).destroy(); delete (yyvsp[-3].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3504 (yyval.String) = (yyvsp[-5].String);
3505 ;}
3506 break;
3507
3508 case 262:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003509#line 1128 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003510 {
3511 (yyvsp[-3].String)->insert(0, *(yyvsp[-4].Type).newTy + " " );
3512 *(yyvsp[-3].String) += ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3513 (yyvsp[-4].Type).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3514 (yyval.String) = (yyvsp[-3].String);
3515 ;}
3516 break;
3517
3518 case 263:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003519#line 1136 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003520 {
3521 if (!(yyvsp[-1].String)->empty())
3522 *(yyvsp[-1].String) += " = ";
3523 *(yyvsp[-1].String) += *(yyvsp[0].String);
3524 delete (yyvsp[0].String);
3525 (yyval.String) = (yyvsp[-1].String);
3526 ;}
3527 break;
3528
3529 case 264:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003530#line 1145 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003531 { // Used for PHI nodes
3532 (yyvsp[-3].Value).val->insert(0, *(yyvsp[-5].Type).newTy + "[");
3533 *(yyvsp[-3].Value).val += "," + *(yyvsp[-1].Value).val + "]";
3534 (yyvsp[-5].Type).destroy(); (yyvsp[-1].Value).destroy();
3535 (yyval.String) = new std::string(*(yyvsp[-3].Value).val);
3536 (yyvsp[-3].Value).destroy();
3537 ;}
3538 break;
3539
3540 case 265:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003541#line 1152 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003542 {
3543 *(yyvsp[-6].String) += ", [" + *(yyvsp[-3].Value).val + "," + *(yyvsp[-1].Value).val + "]";
3544 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
3545 (yyval.String) = (yyvsp[-6].String);
3546 ;}
3547 break;
3548
3549 case 266:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003550#line 1160 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003551 {
3552 (yyval.ValList) = new ValueList();
3553 (yyval.ValList)->push_back((yyvsp[0].Value));
3554 ;}
3555 break;
3556
3557 case 267:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003558#line 1164 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003559 {
3560 (yyvsp[-2].ValList)->push_back((yyvsp[0].Value));
3561 (yyval.ValList) = (yyvsp[-2].ValList);
3562 ;}
3563 break;
3564
3565 case 268:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003566#line 1171 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003567 { (yyval.ValList) = (yyvsp[0].ValList); ;}
3568 break;
3569
3570 case 269:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003571#line 1172 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003572 { (yyval.ValList) = new ValueList(); ;}
3573 break;
3574
3575 case 270:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003576#line 1176 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003577 {
3578 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3579 delete (yyvsp[0].String);
3580 (yyval.String) = (yyvsp[-1].String);
3581 ;}
3582 break;
3583
3584 case 272:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003585#line 1184 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003586 {
3587 const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Type));
3588 (yyval.String) = new std::string(op);
3589 *(yyval.String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3590 delete (yyvsp[-4].String); (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3591 ;}
3592 break;
3593
3594 case 273:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003595#line 1190 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003596 {
3597 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3598 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3599 (yyval.String) = (yyvsp[-4].String);
3600 ;}
3601 break;
3602
3603 case 274:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003604#line 1195 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003605 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003606 *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Type));
Jim Laskey2792cfb2006-12-06 11:03:10 +00003607 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3608 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3609 (yyval.String) = (yyvsp[-4].String);
3610 ;}
3611 break;
3612
3613 case 275:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003614#line 1201 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003615 {
3616 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " " + *(yyvsp[-3].Value).val + "," + *(yyvsp[-1].Value).val + ")";
3617 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
3618 (yyval.String) = (yyvsp[-6].String);
3619 ;}
3620 break;
3621
3622 case 276:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003623#line 1206 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003624 {
3625 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " " + *(yyvsp[-3].Value).val + "," + *(yyvsp[-1].Value).val + ")";
3626 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
3627 (yyval.String) = (yyvsp[-6].String);
3628 ;}
3629 break;
3630
3631 case 277:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003632#line 1211 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003633 {
3634 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3635 (yyvsp[0].Value).destroy();
3636 (yyval.String) = (yyvsp[-1].String);
3637 ;}
3638 break;
3639
3640 case 278:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003641#line 1216 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003642 {
3643 const char* shiftop = (yyvsp[-3].String)->c_str();
3644 if (*(yyvsp[-3].String) == "shr")
3645 shiftop = ((yyvsp[-2].Value).type.isUnsigned()) ? "lshr" : "ashr";
3646 (yyval.String) = new std::string(shiftop);
3647 *(yyval.String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3648 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3649 ;}
3650 break;
3651
3652 case 279:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003653#line 1224 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003654 {
3655 std::string source = *(yyvsp[-2].Value).val;
3656 TypeInfo SrcTy = (yyvsp[-2].Value).type;
3657 TypeInfo DstTy = (yyvsp[0].Type);
Reid Spencera50d5962006-12-02 04:11:07 +00003658 ResolveType(DstTy);
Jim Laskey2792cfb2006-12-06 11:03:10 +00003659 (yyval.String) = new std::string();
3660 if (*(yyvsp[-3].String) == "cast") {
3661 *(yyval.String) += getCastUpgrade(source, SrcTy, DstTy, false);
Reid Spencera50d5962006-12-02 04:11:07 +00003662 } else {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003663 *(yyval.String) += *(yyvsp[-3].String) + " " + source + " to " + *DstTy.newTy;
Reid Spencer280d8012006-12-01 23:40:53 +00003664 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003665 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy();
3666 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
3667 ;}
3668 break;
3669
3670 case 280:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003671#line 1238 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003672 {
3673 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3674 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3675 (yyval.String) = (yyvsp[-5].String);
3676 ;}
3677 break;
3678
3679 case 281:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003680#line 1243 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003681 {
3682 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Type).newTy;
3683 (yyvsp[-2].Value).destroy(); (yyvsp[0].Type).destroy();
3684 (yyval.String) = (yyvsp[-3].String);
3685 ;}
3686 break;
3687
3688 case 282:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003689#line 1248 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003690 {
3691 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3692 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3693 (yyval.String) = (yyvsp[-3].String);
3694 ;}
3695 break;
3696
3697 case 283:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003698#line 1253 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003699 {
3700 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3701 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3702 (yyval.String) = (yyvsp[-5].String);
3703 ;}
3704 break;
3705
3706 case 284:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003707#line 1258 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003708 {
3709 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3710 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3711 (yyval.String) = (yyvsp[-5].String);
3712 ;}
3713 break;
3714
3715 case 285:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003716#line 1263 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003717 {
3718 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3719 delete (yyvsp[0].String);
3720 (yyval.String) = (yyvsp[-1].String);
3721 ;}
3722 break;
3723
3724 case 286:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003725#line 1268 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003726 {
3727 if (!(yyvsp[-5].String)->empty())
3728 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
3729 if (!(yyvsp[-6].String)->empty())
3730 *(yyvsp[-6].String) += " ";
3731 *(yyvsp[-6].String) += *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].Value).val + "(";
3732 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3733 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
3734 *(yyvsp[-6].String) += *VI.val;
3735 if (i+1 < (yyvsp[-1].ValList)->size())
3736 *(yyvsp[-6].String) += ", ";
Reid Spencerf8483652006-12-02 15:16:01 +00003737 VI.destroy();
3738 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003739 *(yyvsp[-6].String) += ")";
3740 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].ValList);
3741 (yyval.String) = (yyvsp[-6].String);
3742 ;}
3743 break;
3744
3745 case 288:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003746#line 1290 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003747 { (yyval.ValList) = (yyvsp[0].ValList); ;}
3748 break;
3749
3750 case 289:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003751#line 1291 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003752 { (yyval.ValList) = new ValueList(); ;}
3753 break;
3754
3755 case 291:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003756#line 1296 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003757 { (yyval.String) = new std::string(); ;}
3758 break;
3759
3760 case 292:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003761#line 1299 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003762 {
3763 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
3764 if (!(yyvsp[0].String)->empty())
3765 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3766 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3767 (yyval.String) = (yyvsp[-2].String);
3768 ;}
3769 break;
3770
3771 case 293:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003772#line 1306 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003773 {
3774 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
3775 if (!(yyvsp[0].String)->empty())
3776 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
3777 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
3778 (yyval.String) = (yyvsp[-5].String);
3779 ;}
3780 break;
3781
3782 case 294:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003783#line 1313 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003784 {
3785 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
3786 if (!(yyvsp[0].String)->empty())
3787 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3788 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3789 (yyval.String) = (yyvsp[-2].String);
3790 ;}
3791 break;
3792
3793 case 295:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003794#line 1320 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003795 {
3796 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
3797 if (!(yyvsp[0].String)->empty())
3798 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
3799 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
3800 (yyval.String) = (yyvsp[-5].String);
3801 ;}
3802 break;
3803
3804 case 296:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003805#line 1327 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003806 {
3807 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3808 (yyvsp[0].Value).destroy();
3809 (yyval.String) = (yyvsp[-1].String);
3810 ;}
3811 break;
3812
3813 case 297:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003814#line 1332 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003815 {
3816 if (!(yyvsp[-3].String)->empty())
3817 *(yyvsp[-3].String) += " ";
3818 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3819 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3820 (yyval.String) = (yyvsp[-3].String);
3821 ;}
3822 break;
3823
3824 case 298:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003825#line 1339 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003826 {
3827 if (!(yyvsp[-5].String)->empty())
3828 *(yyvsp[-5].String) += " ";
3829 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3830 delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3831 (yyval.String) = (yyvsp[-5].String);
3832 ;}
3833 break;
3834
3835 case 299:
Reid Spencere4d87aa2006-12-23 06:05:41 +00003836#line 1346 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003837 {
Reid Spencerf459d392006-12-02 16:19:52 +00003838 // Upgrade the indices
Jim Laskey2792cfb2006-12-06 11:03:10 +00003839 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3840 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
Reid Spencerf459d392006-12-02 16:19:52 +00003841 if (VI.type.isUnsigned() && !VI.isConstant() &&
3842 VI.type.getBitWidth() < 64) {
3843 std::string* old = VI.val;
3844 *O << " %gep_upgrade" << unique << " = zext " << *old
3845 << " to ulong\n";
3846 VI.val = new std::string("ulong %gep_upgrade" + llvm::utostr(unique++));
3847 VI.type.oldTy = ULongTy;
3848 delete old;
3849 }
3850 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003851 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
3852 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3853 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
3854 *(yyvsp[-3].String) += ", " + *VI.val;
Reid Spencerf8483652006-12-02 15:16:01 +00003855 VI.destroy();
3856 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003857 (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].ValList);
3858 (yyval.String) = (yyvsp[-3].String);
3859 ;}
3860 break;
3861
3862
3863 default: break;
3864 }
3865
3866/* Line 1126 of yacc.c. */
Reid Spencere4d87aa2006-12-23 06:05:41 +00003867#line 3868 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +00003868
3869 yyvsp -= yylen;
3870 yyssp -= yylen;
3871
Jim Laskey2792cfb2006-12-06 11:03:10 +00003872
3873 YY_STACK_PRINT (yyss, yyssp);
Reid Spencere7c3c602006-11-30 06:36:44 +00003874
3875 *++yyvsp = yyval;
3876
3877
Jim Laskey2792cfb2006-12-06 11:03:10 +00003878 /* Now `shift' the result of the reduction. Determine what state
3879 that goes to, based on the state we popped back to and the rule
3880 number reduced by. */
Reid Spencere7c3c602006-11-30 06:36:44 +00003881
3882 yyn = yyr1[yyn];
3883
Jim Laskey2792cfb2006-12-06 11:03:10 +00003884 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3885 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Reid Spencere7c3c602006-11-30 06:36:44 +00003886 yystate = yytable[yystate];
3887 else
Jim Laskey2792cfb2006-12-06 11:03:10 +00003888 yystate = yydefgoto[yyn - YYNTOKENS];
Reid Spencere7c3c602006-11-30 06:36:44 +00003889
3890 goto yynewstate;
3891
3892
Jim Laskey2792cfb2006-12-06 11:03:10 +00003893/*------------------------------------.
3894| yyerrlab -- here on detecting error |
3895`------------------------------------*/
3896yyerrlab:
3897 /* If not already recovering from an error, report this error. */
3898 if (!yyerrstatus)
Reid Spencere7c3c602006-11-30 06:36:44 +00003899 {
3900 ++yynerrs;
Jim Laskey2792cfb2006-12-06 11:03:10 +00003901#if YYERROR_VERBOSE
Reid Spencere7c3c602006-11-30 06:36:44 +00003902 yyn = yypact[yystate];
3903
Jim Laskey2792cfb2006-12-06 11:03:10 +00003904 if (YYPACT_NINF < yyn && yyn < YYLAST)
Reid Spencere7c3c602006-11-30 06:36:44 +00003905 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003906 int yytype = YYTRANSLATE (yychar);
3907 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3908 YYSIZE_T yysize = yysize0;
3909 YYSIZE_T yysize1;
3910 int yysize_overflow = 0;
3911 char *yymsg = 0;
3912# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
3913 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3914 int yyx;
Reid Spencere7c3c602006-11-30 06:36:44 +00003915
Jim Laskey2792cfb2006-12-06 11:03:10 +00003916#if 0
3917 /* This is so xgettext sees the translatable formats that are
3918 constructed on the fly. */
3919 YY_("syntax error, unexpected %s");
3920 YY_("syntax error, unexpected %s, expecting %s");
3921 YY_("syntax error, unexpected %s, expecting %s or %s");
3922 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3923 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3924#endif
3925 char *yyfmt;
3926 char const *yyf;
3927 static char const yyunexpected[] = "syntax error, unexpected %s";
3928 static char const yyexpecting[] = ", expecting %s";
3929 static char const yyor[] = " or %s";
3930 char yyformat[sizeof yyunexpected
3931 + sizeof yyexpecting - 1
3932 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3933 * (sizeof yyor - 1))];
3934 char const *yyprefix = yyexpecting;
3935
3936 /* Start YYX at -YYN if negative to avoid negative indexes in
3937 YYCHECK. */
3938 int yyxbegin = yyn < 0 ? -yyn : 0;
3939
3940 /* Stay within bounds of both yycheck and yytname. */
3941 int yychecklim = YYLAST - yyn;
3942 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3943 int yycount = 1;
3944
3945 yyarg[0] = yytname[yytype];
3946 yyfmt = yystpcpy (yyformat, yyunexpected);
3947
3948 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3949 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3950 {
3951 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3952 {
3953 yycount = 1;
3954 yysize = yysize0;
3955 yyformat[sizeof yyunexpected - 1] = '\0';
3956 break;
3957 }
3958 yyarg[yycount++] = yytname[yyx];
3959 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3960 yysize_overflow |= yysize1 < yysize;
3961 yysize = yysize1;
3962 yyfmt = yystpcpy (yyfmt, yyprefix);
3963 yyprefix = yyor;
3964 }
3965
3966 yyf = YY_(yyformat);
3967 yysize1 = yysize + yystrlen (yyf);
3968 yysize_overflow |= yysize1 < yysize;
3969 yysize = yysize1;
3970
3971 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
3972 yymsg = (char *) YYSTACK_ALLOC (yysize);
3973 if (yymsg)
Reid Spencere7c3c602006-11-30 06:36:44 +00003974 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003975 /* Avoid sprintf, as that infringes on the user's name space.
3976 Don't have undefined behavior even if the translation
3977 produced a string with the wrong number of "%s"s. */
3978 char *yyp = yymsg;
3979 int yyi = 0;
3980 while ((*yyp = *yyf))
Reid Spencere7c3c602006-11-30 06:36:44 +00003981 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003982 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3983 {
3984 yyp += yytnamerr (yyp, yyarg[yyi++]);
3985 yyf += 2;
3986 }
3987 else
3988 {
3989 yyp++;
3990 yyf++;
3991 }
Reid Spencere7c3c602006-11-30 06:36:44 +00003992 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003993 yyerror (yymsg);
3994 YYSTACK_FREE (yymsg);
Reid Spencere7c3c602006-11-30 06:36:44 +00003995 }
3996 else
Jim Laskey2792cfb2006-12-06 11:03:10 +00003997 {
3998 yyerror (YY_("syntax error"));
3999 goto yyexhaustedlab;
4000 }
Reid Spencere7c3c602006-11-30 06:36:44 +00004001 }
4002 else
4003#endif /* YYERROR_VERBOSE */
Jim Laskey2792cfb2006-12-06 11:03:10 +00004004 yyerror (YY_("syntax error"));
Reid Spencere7c3c602006-11-30 06:36:44 +00004005 }
4006
Jim Laskey2792cfb2006-12-06 11:03:10 +00004007
Reid Spencere7c3c602006-11-30 06:36:44 +00004008
4009 if (yyerrstatus == 3)
4010 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00004011 /* If just tried and failed to reuse look-ahead token after an
4012 error, discard it. */
Reid Spencere7c3c602006-11-30 06:36:44 +00004013
Jim Laskey2792cfb2006-12-06 11:03:10 +00004014 if (yychar <= YYEOF)
4015 {
4016 /* Return failure if at end of input. */
4017 if (yychar == YYEOF)
4018 YYABORT;
4019 }
4020 else
4021 {
4022 yydestruct ("Error: discarding", yytoken, &yylval);
4023 yychar = YYEMPTY;
4024 }
4025 }
4026
4027 /* Else will try to reuse look-ahead token after shifting the error
4028 token. */
4029 goto yyerrlab1;
4030
4031
4032/*---------------------------------------------------.
4033| yyerrorlab -- error raised explicitly by YYERROR. |
4034`---------------------------------------------------*/
4035yyerrorlab:
4036
4037 /* Pacify compilers like GCC when the user code never invokes
4038 YYERROR and the label yyerrorlab therefore never appears in user
4039 code. */
4040 if (0)
4041 goto yyerrorlab;
4042
4043yyvsp -= yylen;
4044 yyssp -= yylen;
4045 yystate = *yyssp;
4046 goto yyerrlab1;
4047
4048
4049/*-------------------------------------------------------------.
4050| yyerrlab1 -- common code for both syntax error and YYERROR. |
4051`-------------------------------------------------------------*/
4052yyerrlab1:
4053 yyerrstatus = 3; /* Each real token shifted decrements this. */
4054
4055 for (;;)
4056 {
4057 yyn = yypact[yystate];
4058 if (yyn != YYPACT_NINF)
4059 {
4060 yyn += YYTERROR;
4061 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4062 {
4063 yyn = yytable[yyn];
4064 if (0 < yyn)
4065 break;
4066 }
4067 }
4068
4069 /* Pop the current state because it cannot handle the error token. */
4070 if (yyssp == yyss)
Reid Spencere7c3c602006-11-30 06:36:44 +00004071 YYABORT;
4072
4073
Jim Laskey2792cfb2006-12-06 11:03:10 +00004074 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4075 YYPOPSTACK;
4076 yystate = *yyssp;
4077 YY_STACK_PRINT (yyss, yyssp);
Reid Spencere7c3c602006-11-30 06:36:44 +00004078 }
4079
4080 if (yyn == YYFINAL)
4081 YYACCEPT;
4082
4083 *++yyvsp = yylval;
Jim Laskey2792cfb2006-12-06 11:03:10 +00004084
4085
4086 /* Shift the error token. */
4087 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
Reid Spencere7c3c602006-11-30 06:36:44 +00004088
4089 yystate = yyn;
4090 goto yynewstate;
4091
Jim Laskey98ba5882006-12-06 10:57:33 +00004092
Jim Laskey2792cfb2006-12-06 11:03:10 +00004093/*-------------------------------------.
4094| yyacceptlab -- YYACCEPT comes here. |
4095`-------------------------------------*/
4096yyacceptlab:
4097 yyresult = 0;
4098 goto yyreturn;
4099
4100/*-----------------------------------.
4101| yyabortlab -- YYABORT comes here. |
4102`-----------------------------------*/
4103yyabortlab:
4104 yyresult = 1;
4105 goto yyreturn;
4106
4107#ifndef yyoverflow
4108/*-------------------------------------------------.
4109| yyexhaustedlab -- memory exhaustion comes here. |
4110`-------------------------------------------------*/
4111yyexhaustedlab:
4112 yyerror (YY_("memory exhausted"));
4113 yyresult = 2;
4114 /* Fall through. */
Jim Laskey98ba5882006-12-06 10:57:33 +00004115#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00004116
4117yyreturn:
4118 if (yychar != YYEOF && yychar != YYEMPTY)
4119 yydestruct ("Cleanup: discarding lookahead",
4120 yytoken, &yylval);
4121 while (yyssp != yyss)
4122 {
4123 yydestruct ("Cleanup: popping",
4124 yystos[*yyssp], yyvsp);
4125 YYPOPSTACK;
Jim Laskey98ba5882006-12-06 10:57:33 +00004126 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00004127#ifndef yyoverflow
4128 if (yyss != yyssa)
4129 YYSTACK_FREE (yyss);
4130#endif
4131 return yyresult;
Reid Spencere7c3c602006-11-30 06:36:44 +00004132}
Jim Laskey2792cfb2006-12-06 11:03:10 +00004133
4134
Reid Spencere4d87aa2006-12-23 06:05:41 +00004135#line 1370 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00004136
4137
4138int yyerror(const char *ErrorMsg) {
4139 std::string where
4140 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4141 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4142 std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
4143 if (yychar == YYEMPTY || yychar == 0)
4144 errMsg += "end-of-file.";
4145 else
4146 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4147 std::cerr << errMsg << '\n';
4148 exit(1);
4149}
Jim Laskey2792cfb2006-12-06 11:03:10 +00004150