Regenerate.
[oota-llvm.git] / lib / AsmParser / llvmAsmParser.cpp.cvs
1 /* A Bison parser, made by GNU Bison 2.1.  */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5
6    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.
10
11    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.  */
52 #define yyparse llvmAsmparse
53 #define yylex   llvmAsmlex
54 #define yyerror llvmAsmerror
55 #define yylval  llvmAsmlval
56 #define yychar  llvmAsmchar
57 #define yydebug llvmAsmdebug
58 #define yynerrs llvmAsmnerrs
59
60
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      ESINT64VAL = 258,
68      EUINT64VAL = 259,
69      SINTVAL = 260,
70      UINTVAL = 261,
71      FPVAL = 262,
72      VOID = 263,
73      BOOL = 264,
74      SBYTE = 265,
75      UBYTE = 266,
76      SHORT = 267,
77      USHORT = 268,
78      INT = 269,
79      UINT = 270,
80      LONG = 271,
81      ULONG = 272,
82      FLOAT = 273,
83      DOUBLE = 274,
84      TYPE = 275,
85      LABEL = 276,
86      VAR_ID = 277,
87      LABELSTR = 278,
88      STRINGCONSTANT = 279,
89      IMPLEMENTATION = 280,
90      ZEROINITIALIZER = 281,
91      TRUETOK = 282,
92      FALSETOK = 283,
93      BEGINTOK = 284,
94      ENDTOK = 285,
95      DECLARE = 286,
96      GLOBAL = 287,
97      CONSTANT = 288,
98      SECTION = 289,
99      VOLATILE = 290,
100      TO = 291,
101      DOTDOTDOT = 292,
102      NULL_TOK = 293,
103      UNDEF = 294,
104      CONST = 295,
105      INTERNAL = 296,
106      LINKONCE = 297,
107      WEAK = 298,
108      APPENDING = 299,
109      DLLIMPORT = 300,
110      DLLEXPORT = 301,
111      EXTERN_WEAK = 302,
112      OPAQUE = 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      DEPLIBS = 313,
123      CALL = 314,
124      TAIL = 315,
125      ASM_TOK = 316,
126      MODULE = 317,
127      SIDEEFFECT = 318,
128      CC_TOK = 319,
129      CCC_TOK = 320,
130      CSRETCC_TOK = 321,
131      FASTCC_TOK = 322,
132      COLDCC_TOK = 323,
133      X86_STDCALLCC_TOK = 324,
134      X86_FASTCALLCC_TOK = 325,
135      DATALAYOUT = 326,
136      RET = 327,
137      BR = 328,
138      SWITCH = 329,
139      INVOKE = 330,
140      UNWIND = 331,
141      UNREACHABLE = 332,
142      ADD = 333,
143      SUB = 334,
144      MUL = 335,
145      UDIV = 336,
146      SDIV = 337,
147      FDIV = 338,
148      UREM = 339,
149      SREM = 340,
150      FREM = 341,
151      AND = 342,
152      OR = 343,
153      XOR = 344,
154      SETLE = 345,
155      SETGE = 346,
156      SETLT = 347,
157      SETGT = 348,
158      SETEQ = 349,
159      SETNE = 350,
160      ICMP = 351,
161      FCMP = 352,
162      EQ = 353,
163      NE = 354,
164      SLT = 355,
165      SGT = 356,
166      SLE = 357,
167      SGE = 358,
168      ULT = 359,
169      UGT = 360,
170      ULE = 361,
171      UGE = 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      MALLOC = 373,
183      ALLOCA = 374,
184      FREE = 375,
185      LOAD = 376,
186      STORE = 377,
187      GETELEMENTPTR = 378,
188      TRUNC = 379,
189      ZEXT = 380,
190      SEXT = 381,
191      FPTRUNC = 382,
192      FPEXT = 383,
193      BITCAST = 384,
194      UITOFP = 385,
195      SITOFP = 386,
196      FPTOUI = 387,
197      FPTOSI = 388,
198      INTTOPTR = 389,
199      PTRTOINT = 390,
200      PHI_TOK = 391,
201      SELECT = 392,
202      SHL = 393,
203      LSHR = 394,
204      ASHR = 395,
205      VAARG = 396,
206      EXTRACTELEMENT = 397,
207      INSERTELEMENT = 398,
208      SHUFFLEVECTOR = 399
209    };
210 #endif
211 /* Tokens.  */
212 #define ESINT64VAL 258
213 #define EUINT64VAL 259
214 #define SINTVAL 260
215 #define UINTVAL 261
216 #define FPVAL 262
217 #define VOID 263
218 #define BOOL 264
219 #define SBYTE 265
220 #define UBYTE 266
221 #define SHORT 267
222 #define USHORT 268
223 #define INT 269
224 #define UINT 270
225 #define LONG 271
226 #define ULONG 272
227 #define FLOAT 273
228 #define DOUBLE 274
229 #define TYPE 275
230 #define LABEL 276
231 #define VAR_ID 277
232 #define LABELSTR 278
233 #define STRINGCONSTANT 279
234 #define IMPLEMENTATION 280
235 #define ZEROINITIALIZER 281
236 #define TRUETOK 282
237 #define FALSETOK 283
238 #define BEGINTOK 284
239 #define ENDTOK 285
240 #define DECLARE 286
241 #define GLOBAL 287
242 #define CONSTANT 288
243 #define SECTION 289
244 #define VOLATILE 290
245 #define TO 291
246 #define DOTDOTDOT 292
247 #define NULL_TOK 293
248 #define UNDEF 294
249 #define CONST 295
250 #define INTERNAL 296
251 #define LINKONCE 297
252 #define WEAK 298
253 #define APPENDING 299
254 #define DLLIMPORT 300
255 #define DLLEXPORT 301
256 #define EXTERN_WEAK 302
257 #define OPAQUE 303
258 #define NOT 304
259 #define EXTERNAL 305
260 #define TARGET 306
261 #define TRIPLE 307
262 #define ENDIAN 308
263 #define POINTERSIZE 309
264 #define LITTLE 310
265 #define BIG 311
266 #define ALIGN 312
267 #define DEPLIBS 313
268 #define CALL 314
269 #define TAIL 315
270 #define ASM_TOK 316
271 #define MODULE 317
272 #define SIDEEFFECT 318
273 #define CC_TOK 319
274 #define CCC_TOK 320
275 #define CSRETCC_TOK 321
276 #define FASTCC_TOK 322
277 #define COLDCC_TOK 323
278 #define X86_STDCALLCC_TOK 324
279 #define X86_FASTCALLCC_TOK 325
280 #define DATALAYOUT 326
281 #define RET 327
282 #define BR 328
283 #define SWITCH 329
284 #define INVOKE 330
285 #define UNWIND 331
286 #define UNREACHABLE 332
287 #define ADD 333
288 #define SUB 334
289 #define MUL 335
290 #define UDIV 336
291 #define SDIV 337
292 #define FDIV 338
293 #define UREM 339
294 #define SREM 340
295 #define FREM 341
296 #define AND 342
297 #define OR 343
298 #define XOR 344
299 #define SETLE 345
300 #define SETGE 346
301 #define SETLT 347
302 #define SETGT 348
303 #define SETEQ 349
304 #define SETNE 350
305 #define ICMP 351
306 #define FCMP 352
307 #define EQ 353
308 #define NE 354
309 #define SLT 355
310 #define SGT 356
311 #define SLE 357
312 #define SGE 358
313 #define ULT 359
314 #define UGT 360
315 #define ULE 361
316 #define UGE 362
317 #define OEQ 363
318 #define ONE 364
319 #define OLT 365
320 #define OGT 366
321 #define OLE 367
322 #define OGE 368
323 #define ORD 369
324 #define UNO 370
325 #define UEQ 371
326 #define UNE 372
327 #define MALLOC 373
328 #define ALLOCA 374
329 #define FREE 375
330 #define LOAD 376
331 #define STORE 377
332 #define GETELEMENTPTR 378
333 #define TRUNC 379
334 #define ZEXT 380
335 #define SEXT 381
336 #define FPTRUNC 382
337 #define FPEXT 383
338 #define BITCAST 384
339 #define UITOFP 385
340 #define SITOFP 386
341 #define FPTOUI 387
342 #define FPTOSI 388
343 #define INTTOPTR 389
344 #define PTRTOINT 390
345 #define PHI_TOK 391
346 #define SELECT 392
347 #define SHL 393
348 #define LSHR 394
349 #define ASHR 395
350 #define VAARG 396
351 #define EXTRACTELEMENT 397
352 #define INSERTELEMENT 398
353 #define SHUFFLEVECTOR 399
354
355
356
357
358 /* Copy the first part of user declarations.  */
359 #line 14 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
360
361 #include "ParserInternals.h"
362 #include "llvm/CallingConv.h"
363 #include "llvm/InlineAsm.h"
364 #include "llvm/Instructions.h"
365 #include "llvm/Module.h"
366 #include "llvm/SymbolTable.h"
367 #include "llvm/Support/GetElementPtrTypeIterator.h"
368 #include "llvm/ADT/STLExtras.h"
369 #include "llvm/Support/MathExtras.h"
370 #include "llvm/Support/Streams.h"
371 #include <algorithm>
372 #include <list>
373 #include <utility>
374
375 // The following is a gross hack. In order to rid the libAsmParser library of
376 // exceptions, we have to have a way of getting the yyparse function to go into
377 // an error situation. So, whenever we want an error to occur, the GenerateError
378 // function (see bottom of file) sets TriggerError. Then, at the end of each 
379 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR 
380 // (a goto) to put YACC in error state. Furthermore, several calls to 
381 // GenerateError are made from inside productions and they must simulate the
382 // previous exception behavior by exiting the production immediately. We have
383 // replaced these with the GEN_ERROR macro which calls GeneratError and then
384 // immediately invokes YYERROR. This would be so much cleaner if it was a 
385 // recursive descent parser.
386 static bool TriggerError = false;
387 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
388 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
389
390 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
391 int yylex();                       // declaration" of xxx warnings.
392 int yyparse();
393
394 namespace llvm {
395   std::string CurFilename;
396 }
397 using namespace llvm;
398
399 static Module *ParserResult;
400
401 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
402 // relating to upreferences in the input stream.
403 //
404 //#define DEBUG_UPREFS 1
405 #ifdef DEBUG_UPREFS
406 #define UR_OUT(X) llvm_cerr << X
407 #else
408 #define UR_OUT(X)
409 #endif
410
411 #define YYERROR_VERBOSE 1
412
413 static GlobalVariable *CurGV;
414
415
416 // This contains info used when building the body of a function.  It is
417 // destroyed when the function is completed.
418 //
419 typedef std::vector<Value *> ValueList;           // Numbered defs
420 static void 
421 ResolveDefinitions(std::map<const Type *,ValueList> &LateResolvers,
422                    std::map<const Type *,ValueList> *FutureLateResolvers = 0);
423
424 static struct PerModuleInfo {
425   Module *CurrentModule;
426   std::map<const Type *, ValueList> Values; // Module level numbered definitions
427   std::map<const Type *,ValueList> LateResolveValues;
428   std::vector<PATypeHolder>    Types;
429   std::map<ValID, PATypeHolder> LateResolveTypes;
430
431   /// PlaceHolderInfo - When temporary placeholder objects are created, remember
432   /// how they were referenced and on which line of the input they came from so
433   /// that we can resolve them later and print error messages as appropriate.
434   std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
435
436   // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
437   // references to global values.  Global values may be referenced before they
438   // are defined, and if so, the temporary object that they represent is held
439   // here.  This is used for forward references of GlobalValues.
440   //
441   typedef std::map<std::pair<const PointerType *,
442                              ValID>, GlobalValue*> GlobalRefsType;
443   GlobalRefsType GlobalRefs;
444
445   void ModuleDone() {
446     // If we could not resolve some functions at function compilation time
447     // (calls to functions before they are defined), resolve them now...  Types
448     // are resolved when the constant pool has been completely parsed.
449     //
450     ResolveDefinitions(LateResolveValues);
451     if (TriggerError)
452       return;
453
454     // Check to make sure that all global value forward references have been
455     // resolved!
456     //
457     if (!GlobalRefs.empty()) {
458       std::string UndefinedReferences = "Unresolved global references exist:\n";
459
460       for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
461            I != E; ++I) {
462         UndefinedReferences += "  " + I->first.first->getDescription() + " " +
463                                I->first.second.getName() + "\n";
464       }
465       GenerateError(UndefinedReferences);
466       return;
467     }
468
469     Values.clear();         // Clear out function local definitions
470     Types.clear();
471     CurrentModule = 0;
472   }
473
474   // GetForwardRefForGlobal - Check to see if there is a forward reference
475   // for this global.  If so, remove it from the GlobalRefs map and return it.
476   // If not, just return null.
477   GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
478     // Check to see if there is a forward reference to this global variable...
479     // if there is, eliminate it and patch the reference to use the new def'n.
480     GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
481     GlobalValue *Ret = 0;
482     if (I != GlobalRefs.end()) {
483       Ret = I->second;
484       GlobalRefs.erase(I);
485     }
486     return Ret;
487   }
488 } CurModule;
489
490 static struct PerFunctionInfo {
491   Function *CurrentFunction;     // Pointer to current function being created
492
493   std::map<const Type*, ValueList> Values; // Keep track of #'d definitions
494   std::map<const Type*, ValueList> LateResolveValues;
495   bool isDeclare;                    // Is this function a forward declararation?
496   GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
497
498   /// BBForwardRefs - When we see forward references to basic blocks, keep
499   /// track of them here.
500   std::map<BasicBlock*, std::pair<ValID, int> > BBForwardRefs;
501   std::vector<BasicBlock*> NumberedBlocks;
502   unsigned NextBBNum;
503
504   inline PerFunctionInfo() {
505     CurrentFunction = 0;
506     isDeclare = false;
507     Linkage = GlobalValue::ExternalLinkage;    
508   }
509
510   inline void FunctionStart(Function *M) {
511     CurrentFunction = M;
512     NextBBNum = 0;
513   }
514
515   void FunctionDone() {
516     NumberedBlocks.clear();
517
518     // Any forward referenced blocks left?
519     if (!BBForwardRefs.empty()) {
520       GenerateError("Undefined reference to label " +
521                      BBForwardRefs.begin()->first->getName());
522       return;
523     }
524
525     // Resolve all forward references now.
526     ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
527
528     Values.clear();         // Clear out function local definitions
529     CurrentFunction = 0;
530     isDeclare = false;
531     Linkage = GlobalValue::ExternalLinkage;
532   }
533 } CurFun;  // Info for the current function...
534
535 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
536
537
538 //===----------------------------------------------------------------------===//
539 //               Code to handle definitions of all the types
540 //===----------------------------------------------------------------------===//
541
542 static int InsertValue(Value *V,
543                   std::map<const Type*,ValueList> &ValueTab = CurFun.Values) {
544   if (V->hasName()) return -1;           // Is this a numbered definition?
545
546   // Yes, insert the value into the value table...
547   ValueList &List = ValueTab[V->getType()];
548   List.push_back(V);
549   return List.size()-1;
550 }
551
552 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
553   switch (D.Type) {
554   case ValID::NumberVal:               // Is it a numbered definition?
555     // Module constants occupy the lowest numbered slots...
556     if ((unsigned)D.Num < CurModule.Types.size())
557       return CurModule.Types[(unsigned)D.Num];
558     break;
559   case ValID::NameVal:                 // Is it a named definition?
560     if (const Type *N = CurModule.CurrentModule->getTypeByName(D.Name)) {
561       D.destroy();  // Free old strdup'd memory...
562       return N;
563     }
564     break;
565   default:
566     GenerateError("Internal parser error: Invalid symbol type reference!");
567     return 0;
568   }
569
570   // If we reached here, we referenced either a symbol that we don't know about
571   // or an id number that hasn't been read yet.  We may be referencing something
572   // forward, so just create an entry to be resolved later and get to it...
573   //
574   if (DoNotImprovise) return 0;  // Do we just want a null to be returned?
575
576
577   if (inFunctionScope()) {
578     if (D.Type == ValID::NameVal) {
579       GenerateError("Reference to an undefined type: '" + D.getName() + "'");
580       return 0;
581     } else {
582       GenerateError("Reference to an undefined type: #" + itostr(D.Num));
583       return 0;
584     }
585   }
586
587   std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
588   if (I != CurModule.LateResolveTypes.end())
589     return I->second;
590
591   Type *Typ = OpaqueType::get();
592   CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
593   return Typ;
594  }
595
596 static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) {
597   SymbolTable &SymTab =
598     inFunctionScope() ? CurFun.CurrentFunction->getSymbolTable() :
599                         CurModule.CurrentModule->getSymbolTable();
600   return SymTab.lookup(Ty, Name);
601 }
602
603 // getValNonImprovising - Look up the value specified by the provided type and
604 // the provided ValID.  If the value exists and has already been defined, return
605 // it.  Otherwise return null.
606 //
607 static Value *getValNonImprovising(const Type *Ty, const ValID &D) {
608   if (isa<FunctionType>(Ty)) {
609     GenerateError("Functions are not values and "
610                    "must be referenced as pointers");
611     return 0;
612   }
613
614   switch (D.Type) {
615   case ValID::NumberVal: {                 // Is it a numbered definition?
616     unsigned Num = (unsigned)D.Num;
617
618     // Module constants occupy the lowest numbered slots...
619     std::map<const Type*,ValueList>::iterator VI = CurModule.Values.find(Ty);
620     if (VI != CurModule.Values.end()) {
621       if (Num < VI->second.size())
622         return VI->second[Num];
623       Num -= VI->second.size();
624     }
625
626     // Make sure that our type is within bounds
627     VI = CurFun.Values.find(Ty);
628     if (VI == CurFun.Values.end()) return 0;
629
630     // Check that the number is within bounds...
631     if (VI->second.size() <= Num) return 0;
632
633     return VI->second[Num];
634   }
635
636   case ValID::NameVal: {                // Is it a named definition?
637     Value *N = lookupInSymbolTable(Ty, std::string(D.Name));
638     if (N == 0) return 0;
639
640     D.destroy();  // Free old strdup'd memory...
641     return N;
642   }
643
644   // Check to make sure that "Ty" is an integral type, and that our
645   // value will fit into the specified type...
646   case ValID::ConstSIntVal:    // Is it a constant pool reference??
647     if (!ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
648       GenerateError("Signed integral constant '" +
649                      itostr(D.ConstPool64) + "' is invalid for type '" +
650                      Ty->getDescription() + "'!");
651       return 0;
652     }
653     return ConstantInt::get(Ty, D.ConstPool64);
654
655   case ValID::ConstUIntVal:     // Is it an unsigned const pool reference?
656     if (!ConstantInt::isValueValidForType(Ty, D.UConstPool64)) {
657       if (!ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
658         GenerateError("Integral constant '" + utostr(D.UConstPool64) +
659                        "' is invalid or out of range!");
660         return 0;
661       } else {     // This is really a signed reference.  Transmogrify.
662         return ConstantInt::get(Ty, D.ConstPool64);
663       }
664     } else {
665       return ConstantInt::get(Ty, D.UConstPool64);
666     }
667
668   case ValID::ConstFPVal:        // Is it a floating point const pool reference?
669     if (!ConstantFP::isValueValidForType(Ty, D.ConstPoolFP)) {
670       GenerateError("FP constant invalid for type!!");
671       return 0;
672     }
673     return ConstantFP::get(Ty, D.ConstPoolFP);
674
675   case ValID::ConstNullVal:      // Is it a null value?
676     if (!isa<PointerType>(Ty)) {
677       GenerateError("Cannot create a a non pointer null!");
678       return 0;
679     }
680     return ConstantPointerNull::get(cast<PointerType>(Ty));
681
682   case ValID::ConstUndefVal:      // Is it an undef value?
683     return UndefValue::get(Ty);
684
685   case ValID::ConstZeroVal:      // Is it a zero value?
686     return Constant::getNullValue(Ty);
687     
688   case ValID::ConstantVal:       // Fully resolved constant?
689     if (D.ConstantValue->getType() != Ty) {
690       GenerateError("Constant expression type different from required type!");
691       return 0;
692     }
693     return D.ConstantValue;
694
695   case ValID::InlineAsmVal: {    // Inline asm expression
696     const PointerType *PTy = dyn_cast<PointerType>(Ty);
697     const FunctionType *FTy =
698       PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
699     if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
700       GenerateError("Invalid type for asm constraint string!");
701       return 0;
702     }
703     InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
704                                    D.IAD->HasSideEffects);
705     D.destroy();   // Free InlineAsmDescriptor.
706     return IA;
707   }
708   default:
709     assert(0 && "Unhandled case!");
710     return 0;
711   }   // End of switch
712
713   assert(0 && "Unhandled case!");
714   return 0;
715 }
716
717 // getVal - This function is identical to getValNonImprovising, except that if a
718 // value is not already defined, it "improvises" by creating a placeholder var
719 // that looks and acts just like the requested variable.  When the value is
720 // defined later, all uses of the placeholder variable are replaced with the
721 // real thing.
722 //
723 static Value *getVal(const Type *Ty, const ValID &ID) {
724   if (Ty == Type::LabelTy) {
725     GenerateError("Cannot use a basic block here");
726     return 0;
727   }
728
729   // See if the value has already been defined.
730   Value *V = getValNonImprovising(Ty, ID);
731   if (V) return V;
732   if (TriggerError) return 0;
733
734   if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
735     GenerateError("Invalid use of a composite type!");
736     return 0;
737   }
738
739   // If we reached here, we referenced either a symbol that we don't know about
740   // or an id number that hasn't been read yet.  We may be referencing something
741   // forward, so just create an entry to be resolved later and get to it...
742   //
743   V = new Argument(Ty);
744
745   // Remember where this forward reference came from.  FIXME, shouldn't we try
746   // to recycle these things??
747   CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
748                                                                llvmAsmlineno)));
749
750   if (inFunctionScope())
751     InsertValue(V, CurFun.LateResolveValues);
752   else
753     InsertValue(V, CurModule.LateResolveValues);
754   return V;
755 }
756
757 /// getBBVal - This is used for two purposes:
758 ///  * If isDefinition is true, a new basic block with the specified ID is being
759 ///    defined.
760 ///  * If isDefinition is true, this is a reference to a basic block, which may
761 ///    or may not be a forward reference.
762 ///
763 static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) {
764   assert(inFunctionScope() && "Can't get basic block at global scope!");
765
766   std::string Name;
767   BasicBlock *BB = 0;
768   switch (ID.Type) {
769   default: 
770     GenerateError("Illegal label reference " + ID.getName());
771     return 0;
772   case ValID::NumberVal:                // Is it a numbered definition?
773     if (unsigned(ID.Num) >= CurFun.NumberedBlocks.size())
774       CurFun.NumberedBlocks.resize(ID.Num+1);
775     BB = CurFun.NumberedBlocks[ID.Num];
776     break;
777   case ValID::NameVal:                  // Is it a named definition?
778     Name = ID.Name;
779     if (Value *N = CurFun.CurrentFunction->
780                    getSymbolTable().lookup(Type::LabelTy, Name))
781       BB = cast<BasicBlock>(N);
782     break;
783   }
784
785   // See if the block has already been defined.
786   if (BB) {
787     // If this is the definition of the block, make sure the existing value was
788     // just a forward reference.  If it was a forward reference, there will be
789     // an entry for it in the PlaceHolderInfo map.
790     if (isDefinition && !CurFun.BBForwardRefs.erase(BB)) {
791       // The existing value was a definition, not a forward reference.
792       GenerateError("Redefinition of label " + ID.getName());
793       return 0;
794     }
795
796     ID.destroy();                       // Free strdup'd memory.
797     return BB;
798   }
799
800   // Otherwise this block has not been seen before.
801   BB = new BasicBlock("", CurFun.CurrentFunction);
802   if (ID.Type == ValID::NameVal) {
803     BB->setName(ID.Name);
804   } else {
805     CurFun.NumberedBlocks[ID.Num] = BB;
806   }
807
808   // If this is not a definition, keep track of it so we can use it as a forward
809   // reference.
810   if (!isDefinition) {
811     // Remember where this forward reference came from.
812     CurFun.BBForwardRefs[BB] = std::make_pair(ID, llvmAsmlineno);
813   } else {
814     // The forward declaration could have been inserted anywhere in the
815     // function: insert it into the correct place now.
816     CurFun.CurrentFunction->getBasicBlockList().remove(BB);
817     CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
818   }
819   ID.destroy();
820   return BB;
821 }
822
823
824 //===----------------------------------------------------------------------===//
825 //              Code to handle forward references in instructions
826 //===----------------------------------------------------------------------===//
827 //
828 // This code handles the late binding needed with statements that reference
829 // values not defined yet... for example, a forward branch, or the PHI node for
830 // a loop body.
831 //
832 // This keeps a table (CurFun.LateResolveValues) of all such forward references
833 // and back patchs after we are done.
834 //
835
836 // ResolveDefinitions - If we could not resolve some defs at parsing
837 // time (forward branches, phi functions for loops, etc...) resolve the
838 // defs now...
839 //
840 static void 
841 ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers,
842                    std::map<const Type*,ValueList> *FutureLateResolvers) {
843   // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
844   for (std::map<const Type*,ValueList>::iterator LRI = LateResolvers.begin(),
845          E = LateResolvers.end(); LRI != E; ++LRI) {
846     ValueList &List = LRI->second;
847     while (!List.empty()) {
848       Value *V = List.back();
849       List.pop_back();
850
851       std::map<Value*, std::pair<ValID, int> >::iterator PHI =
852         CurModule.PlaceHolderInfo.find(V);
853       assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
854
855       ValID &DID = PHI->second.first;
856
857       Value *TheRealValue = getValNonImprovising(LRI->first, DID);
858       if (TriggerError)
859         return;
860       if (TheRealValue) {
861         V->replaceAllUsesWith(TheRealValue);
862         delete V;
863         CurModule.PlaceHolderInfo.erase(PHI);
864       } else if (FutureLateResolvers) {
865         // Functions have their unresolved items forwarded to the module late
866         // resolver table
867         InsertValue(V, *FutureLateResolvers);
868       } else {
869         if (DID.Type == ValID::NameVal) {
870           GenerateError("Reference to an invalid definition: '" +DID.getName()+
871                          "' of type '" + V->getType()->getDescription() + "'",
872                          PHI->second.second);
873           return;
874         } else {
875           GenerateError("Reference to an invalid definition: #" +
876                          itostr(DID.Num) + " of type '" +
877                          V->getType()->getDescription() + "'",
878                          PHI->second.second);
879           return;
880         }
881       }
882     }
883   }
884
885   LateResolvers.clear();
886 }
887
888 // ResolveTypeTo - A brand new type was just declared.  This means that (if
889 // name is not null) things referencing Name can be resolved.  Otherwise, things
890 // refering to the number can be resolved.  Do this now.
891 //
892 static void ResolveTypeTo(char *Name, const Type *ToTy) {
893   ValID D;
894   if (Name) D = ValID::create(Name);
895   else      D = ValID::create((int)CurModule.Types.size());
896
897   std::map<ValID, PATypeHolder>::iterator I =
898     CurModule.LateResolveTypes.find(D);
899   if (I != CurModule.LateResolveTypes.end()) {
900     ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
901     CurModule.LateResolveTypes.erase(I);
902   }
903 }
904
905 // setValueName - Set the specified value to the name given.  The name may be
906 // null potentially, in which case this is a noop.  The string passed in is
907 // assumed to be a malloc'd string buffer, and is free'd by this function.
908 //
909 static void setValueName(Value *V, char *NameStr) {
910   if (NameStr) {
911     std::string Name(NameStr);      // Copy string
912     free(NameStr);                  // Free old string
913
914     if (V->getType() == Type::VoidTy) {
915       GenerateError("Can't assign name '" + Name+"' to value with void type!");
916       return;
917     }
918
919     assert(inFunctionScope() && "Must be in function scope!");
920     SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable();
921     if (ST.lookup(V->getType(), Name)) {
922       GenerateError("Redefinition of value named '" + Name + "' in the '" +
923                      V->getType()->getDescription() + "' type plane!");
924       return;
925     }
926
927     // Set the name.
928     V->setName(Name);
929   }
930 }
931
932 /// ParseGlobalVariable - Handle parsing of a global.  If Initializer is null,
933 /// this is a declaration, otherwise it is a definition.
934 static GlobalVariable *
935 ParseGlobalVariable(char *NameStr,GlobalValue::LinkageTypes Linkage,
936                     bool isConstantGlobal, const Type *Ty,
937                     Constant *Initializer) {
938   if (isa<FunctionType>(Ty)) {
939     GenerateError("Cannot declare global vars of function type!");
940     return 0;
941   }
942
943   const PointerType *PTy = PointerType::get(Ty);
944
945   std::string Name;
946   if (NameStr) {
947     Name = NameStr;      // Copy string
948     free(NameStr);       // Free old string
949   }
950
951   // See if this global value was forward referenced.  If so, recycle the
952   // object.
953   ValID ID;
954   if (!Name.empty()) {
955     ID = ValID::create((char*)Name.c_str());
956   } else {
957     ID = ValID::create((int)CurModule.Values[PTy].size());
958   }
959
960   if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
961     // Move the global to the end of the list, from whereever it was
962     // previously inserted.
963     GlobalVariable *GV = cast<GlobalVariable>(FWGV);
964     CurModule.CurrentModule->getGlobalList().remove(GV);
965     CurModule.CurrentModule->getGlobalList().push_back(GV);
966     GV->setInitializer(Initializer);
967     GV->setLinkage(Linkage);
968     GV->setConstant(isConstantGlobal);
969     InsertValue(GV, CurModule.Values);
970     return GV;
971   }
972
973   // If this global has a name, check to see if there is already a definition
974   // of this global in the module.  If so, merge as appropriate.  Note that
975   // this is really just a hack around problems in the CFE.  :(
976   if (!Name.empty()) {
977     // We are a simple redefinition of a value, check to see if it is defined
978     // the same as the old one.
979     if (GlobalVariable *EGV =
980                 CurModule.CurrentModule->getGlobalVariable(Name, Ty)) {
981       // We are allowed to redefine a global variable in two circumstances:
982       // 1. If at least one of the globals is uninitialized or
983       // 2. If both initializers have the same value.
984       //
985       if (!EGV->hasInitializer() || !Initializer ||
986           EGV->getInitializer() == Initializer) {
987
988         // Make sure the existing global version gets the initializer!  Make
989         // sure that it also gets marked const if the new version is.
990         if (Initializer && !EGV->hasInitializer())
991           EGV->setInitializer(Initializer);
992         if (isConstantGlobal)
993           EGV->setConstant(true);
994         EGV->setLinkage(Linkage);
995         return EGV;
996       }
997
998       GenerateError("Redefinition of global variable named '" + Name +
999                      "' in the '" + Ty->getDescription() + "' type plane!");
1000       return 0;
1001     }
1002   }
1003
1004   // Otherwise there is no existing GV to use, create one now.
1005   GlobalVariable *GV =
1006     new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1007                        CurModule.CurrentModule);
1008   InsertValue(GV, CurModule.Values);
1009   return GV;
1010 }
1011
1012 // setTypeName - Set the specified type to the name given.  The name may be
1013 // null potentially, in which case this is a noop.  The string passed in is
1014 // assumed to be a malloc'd string buffer, and is freed by this function.
1015 //
1016 // This function returns true if the type has already been defined, but is
1017 // allowed to be redefined in the specified context.  If the name is a new name
1018 // for the type plane, it is inserted and false is returned.
1019 static bool setTypeName(const Type *T, char *NameStr) {
1020   assert(!inFunctionScope() && "Can't give types function-local names!");
1021   if (NameStr == 0) return false;
1022  
1023   std::string Name(NameStr);      // Copy string
1024   free(NameStr);                  // Free old string
1025
1026   // We don't allow assigning names to void type
1027   if (T == Type::VoidTy) {
1028     GenerateError("Can't assign name '" + Name + "' to the void type!");
1029     return false;
1030   }
1031
1032   // Set the type name, checking for conflicts as we do so.
1033   bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1034
1035   if (AlreadyExists) {   // Inserting a name that is already defined???
1036     const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1037     assert(Existing && "Conflict but no matching type?");
1038
1039     // There is only one case where this is allowed: when we are refining an
1040     // opaque type.  In this case, Existing will be an opaque type.
1041     if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1042       // We ARE replacing an opaque type!
1043       const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1044       return true;
1045     }
1046
1047     // Otherwise, this is an attempt to redefine a type. That's okay if
1048     // the redefinition is identical to the original. This will be so if
1049     // Existing and T point to the same Type object. In this one case we
1050     // allow the equivalent redefinition.
1051     if (Existing == T) return true;  // Yes, it's equal.
1052
1053     // Any other kind of (non-equivalent) redefinition is an error.
1054     GenerateError("Redefinition of type named '" + Name + "' in the '" +
1055                    T->getDescription() + "' type plane!");
1056   }
1057
1058   return false;
1059 }
1060
1061 //===----------------------------------------------------------------------===//
1062 // Code for handling upreferences in type names...
1063 //
1064
1065 // TypeContains - Returns true if Ty directly contains E in it.
1066 //
1067 static bool TypeContains(const Type *Ty, const Type *E) {
1068   return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1069                    E) != Ty->subtype_end();
1070 }
1071
1072 namespace {
1073   struct UpRefRecord {
1074     // NestingLevel - The number of nesting levels that need to be popped before
1075     // this type is resolved.
1076     unsigned NestingLevel;
1077
1078     // LastContainedTy - This is the type at the current binding level for the
1079     // type.  Every time we reduce the nesting level, this gets updated.
1080     const Type *LastContainedTy;
1081
1082     // UpRefTy - This is the actual opaque type that the upreference is
1083     // represented with.
1084     OpaqueType *UpRefTy;
1085
1086     UpRefRecord(unsigned NL, OpaqueType *URTy)
1087       : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1088   };
1089 }
1090
1091 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1092 static std::vector<UpRefRecord> UpRefs;
1093
1094 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1095 /// called.  It loops through the UpRefs vector, which is a list of the
1096 /// currently active types.  For each type, if the up reference is contained in
1097 /// the newly completed type, we decrement the level count.  When the level
1098 /// count reaches zero, the upreferenced type is the type that is passed in:
1099 /// thus we can complete the cycle.
1100 ///
1101 static PATypeHolder HandleUpRefs(const Type *ty) {
1102   // If Ty isn't abstract, or if there are no up-references in it, then there is
1103   // nothing to resolve here.
1104   if (!ty->isAbstract() || UpRefs.empty()) return ty;
1105   
1106   PATypeHolder Ty(ty);
1107   UR_OUT("Type '" << Ty->getDescription() <<
1108          "' newly formed.  Resolving upreferences.\n" <<
1109          UpRefs.size() << " upreferences active!\n");
1110
1111   // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1112   // to zero), we resolve them all together before we resolve them to Ty.  At
1113   // the end of the loop, if there is anything to resolve to Ty, it will be in
1114   // this variable.
1115   OpaqueType *TypeToResolve = 0;
1116
1117   for (unsigned i = 0; i != UpRefs.size(); ++i) {
1118     UR_OUT("  UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1119            << UpRefs[i].second->getDescription() << ") = "
1120            << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1121     if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1122       // Decrement level of upreference
1123       unsigned Level = --UpRefs[i].NestingLevel;
1124       UpRefs[i].LastContainedTy = Ty;
1125       UR_OUT("  Uplevel Ref Level = " << Level << "\n");
1126       if (Level == 0) {                     // Upreference should be resolved!
1127         if (!TypeToResolve) {
1128           TypeToResolve = UpRefs[i].UpRefTy;
1129         } else {
1130           UR_OUT("  * Resolving upreference for "
1131                  << UpRefs[i].second->getDescription() << "\n";
1132                  std::string OldName = UpRefs[i].UpRefTy->getDescription());
1133           UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1134           UR_OUT("  * Type '" << OldName << "' refined upreference to: "
1135                  << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1136         }
1137         UpRefs.erase(UpRefs.begin()+i);     // Remove from upreference list...
1138         --i;                                // Do not skip the next element...
1139       }
1140     }
1141   }
1142
1143   if (TypeToResolve) {
1144     UR_OUT("  * Resolving upreference for "
1145            << UpRefs[i].second->getDescription() << "\n";
1146            std::string OldName = TypeToResolve->getDescription());
1147     TypeToResolve->refineAbstractTypeTo(Ty);
1148   }
1149
1150   return Ty;
1151 }
1152
1153 // common code from the two 'RunVMAsmParser' functions
1154 static Module* RunParser(Module * M) {
1155
1156   llvmAsmlineno = 1;      // Reset the current line number...
1157   CurModule.CurrentModule = M;
1158
1159   // Check to make sure the parser succeeded
1160   if (yyparse()) {
1161     if (ParserResult)
1162       delete ParserResult;
1163     return 0;
1164   }
1165
1166   // Check to make sure that parsing produced a result
1167   if (!ParserResult)
1168     return 0;
1169
1170   // Reset ParserResult variable while saving its value for the result.
1171   Module *Result = ParserResult;
1172   ParserResult = 0;
1173
1174   return Result;
1175 }
1176
1177 //===----------------------------------------------------------------------===//
1178 //            RunVMAsmParser - Define an interface to this parser
1179 //===----------------------------------------------------------------------===//
1180 //
1181 Module *llvm::RunVMAsmParser(const std::string &Filename, FILE *F) {
1182   set_scan_file(F);
1183
1184   CurFilename = Filename;
1185   return RunParser(new Module(CurFilename));
1186 }
1187
1188 Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) {
1189   set_scan_string(AsmString);
1190
1191   CurFilename = "from_memory";
1192   if (M == NULL) {
1193     return RunParser(new Module (CurFilename));
1194   } else {
1195     return RunParser(M);
1196   }
1197 }
1198
1199
1200
1201 /* Enabling traces.  */
1202 #ifndef YYDEBUG
1203 # define YYDEBUG 0
1204 #endif
1205
1206 /* Enabling verbose error messages.  */
1207 #ifdef YYERROR_VERBOSE
1208 # undef YYERROR_VERBOSE
1209 # define YYERROR_VERBOSE 1
1210 #else
1211 # define YYERROR_VERBOSE 0
1212 #endif
1213
1214 /* Enabling the token table.  */
1215 #ifndef YYTOKEN_TABLE
1216 # define YYTOKEN_TABLE 0
1217 #endif
1218
1219 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
1220 #line 855 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
1221 typedef union YYSTYPE {
1222   llvm::Module                           *ModuleVal;
1223   llvm::Function                         *FunctionVal;
1224   std::pair<llvm::PATypeHolder*, char*>  *ArgVal;
1225   llvm::BasicBlock                       *BasicBlockVal;
1226   llvm::TerminatorInst                   *TermInstVal;
1227   llvm::Instruction                      *InstVal;
1228   llvm::Constant                         *ConstVal;
1229
1230   const llvm::Type                       *PrimType;
1231   llvm::PATypeHolder                     *TypeVal;
1232   llvm::Value                            *ValueVal;
1233
1234   std::vector<std::pair<llvm::PATypeHolder*,char*> > *ArgList;
1235   std::vector<llvm::Value*>              *ValueList;
1236   std::list<llvm::PATypeHolder>          *TypeList;
1237   // Represent the RHS of PHI node
1238   std::list<std::pair<llvm::Value*,
1239                       llvm::BasicBlock*> > *PHIList;
1240   std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1241   std::vector<llvm::Constant*>           *ConstVector;
1242
1243   llvm::GlobalValue::LinkageTypes         Linkage;
1244   int64_t                           SInt64Val;
1245   uint64_t                          UInt64Val;
1246   int                               SIntVal;
1247   unsigned                          UIntVal;
1248   double                            FPVal;
1249   bool                              BoolVal;
1250
1251   char                             *StrVal;   // This memory is strdup'd!
1252   llvm::ValID                       ValIDVal; // strdup'd memory maybe!
1253
1254   llvm::Instruction::BinaryOps      BinaryOpVal;
1255   llvm::Instruction::TermOps        TermOpVal;
1256   llvm::Instruction::MemoryOps      MemOpVal;
1257   llvm::Instruction::CastOps        CastOpVal;
1258   llvm::Instruction::OtherOps       OtherOpVal;
1259   llvm::Module::Endianness          Endianness;
1260   llvm::ICmpInst::Predicate         IPredicate;
1261   llvm::FCmpInst::Predicate         FPredicate;
1262 } YYSTYPE;
1263 /* Line 196 of yacc.c.  */
1264 #line 1265 "llvmAsmParser.tab.c"
1265 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1266 # define YYSTYPE_IS_DECLARED 1
1267 # define YYSTYPE_IS_TRIVIAL 1
1268 #endif
1269
1270
1271
1272 /* Copy the second part of user declarations.  */
1273
1274
1275 /* Line 219 of yacc.c.  */
1276 #line 1277 "llvmAsmParser.tab.c"
1277
1278 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1279 # define YYSIZE_T __SIZE_TYPE__
1280 #endif
1281 #if ! defined (YYSIZE_T) && defined (size_t)
1282 # define YYSIZE_T size_t
1283 #endif
1284 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
1285 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1286 # define YYSIZE_T size_t
1287 #endif
1288 #if ! defined (YYSIZE_T)
1289 # define YYSIZE_T unsigned int
1290 #endif
1291
1292 #ifndef YY_
1293 # if YYENABLE_NLS
1294 #  if ENABLE_NLS
1295 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1296 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
1297 #  endif
1298 # endif
1299 # ifndef YY_
1300 #  define YY_(msgid) msgid
1301 # endif
1302 #endif
1303
1304 #if ! defined (yyoverflow) || YYERROR_VERBOSE
1305
1306 /* The parser invokes alloca or malloc; define the necessary symbols.  */
1307
1308 # ifdef YYSTACK_USE_ALLOCA
1309 #  if YYSTACK_USE_ALLOCA
1310 #   ifdef __GNUC__
1311 #    define YYSTACK_ALLOC __builtin_alloca
1312 #   else
1313 #    define YYSTACK_ALLOC alloca
1314 #    if defined (__STDC__) || defined (__cplusplus)
1315 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1316 #     define YYINCLUDED_STDLIB_H
1317 #    endif
1318 #   endif
1319 #  endif
1320 # endif
1321
1322 # ifdef YYSTACK_ALLOC
1323    /* Pacify GCC's `empty if-body' warning. */
1324 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
1325 #  ifndef YYSTACK_ALLOC_MAXIMUM
1326     /* The OS might guarantee only one guard page at the bottom of the stack,
1327        and a page size can be as small as 4096 bytes.  So we cannot safely
1328        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
1329        to allow for a few compiler-allocated temporary stack slots.  */
1330 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
1331 #  endif
1332 # else
1333 #  define YYSTACK_ALLOC YYMALLOC
1334 #  define YYSTACK_FREE YYFREE
1335 #  ifndef YYSTACK_ALLOC_MAXIMUM
1336 #   define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
1337 #  endif
1338 #  ifdef __cplusplus
1339 extern "C" {
1340 #  endif
1341 #  ifndef YYMALLOC
1342 #   define YYMALLOC malloc
1343 #   if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
1344         && (defined (__STDC__) || defined (__cplusplus)))
1345 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1346 #   endif
1347 #  endif
1348 #  ifndef YYFREE
1349 #   define YYFREE free
1350 #   if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
1351         && (defined (__STDC__) || defined (__cplusplus)))
1352 void free (void *); /* INFRINGES ON USER NAME SPACE */
1353 #   endif
1354 #  endif
1355 #  ifdef __cplusplus
1356 }
1357 #  endif
1358 # endif
1359 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
1360
1361
1362 #if (! defined (yyoverflow) \
1363      && (! defined (__cplusplus) \
1364          || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
1365
1366 /* A type that is properly aligned for any stack member.  */
1367 union yyalloc
1368 {
1369   short int yyss;
1370   YYSTYPE yyvs;
1371   };
1372
1373 /* The size of the maximum gap between one aligned stack and the next.  */
1374 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1375
1376 /* The size of an array large to enough to hold all stacks, each with
1377    N elements.  */
1378 # define YYSTACK_BYTES(N) \
1379      ((N) * (sizeof (short int) + sizeof (YYSTYPE))                     \
1380       + YYSTACK_GAP_MAXIMUM)
1381
1382 /* Copy COUNT objects from FROM to TO.  The source and destination do
1383    not overlap.  */
1384 # ifndef YYCOPY
1385 #  if defined (__GNUC__) && 1 < __GNUC__
1386 #   define YYCOPY(To, From, Count) \
1387       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1388 #  else
1389 #   define YYCOPY(To, From, Count)              \
1390       do                                        \
1391         {                                       \
1392           YYSIZE_T yyi;                         \
1393           for (yyi = 0; yyi < (Count); yyi++)   \
1394             (To)[yyi] = (From)[yyi];            \
1395         }                                       \
1396       while (0)
1397 #  endif
1398 # endif
1399
1400 /* Relocate STACK from its old location to the new one.  The
1401    local variables YYSIZE and YYSTACKSIZE give the old and new number of
1402    elements in the stack, and YYPTR gives the new location of the
1403    stack.  Advance YYPTR to a properly aligned location for the next
1404    stack.  */
1405 # define YYSTACK_RELOCATE(Stack)                                        \
1406     do                                                                  \
1407       {                                                                 \
1408         YYSIZE_T yynewbytes;                                            \
1409         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
1410         Stack = &yyptr->Stack;                                          \
1411         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1412         yyptr += yynewbytes / sizeof (*yyptr);                          \
1413       }                                                                 \
1414     while (0)
1415
1416 #endif
1417
1418 #if defined (__STDC__) || defined (__cplusplus)
1419    typedef signed char yysigned_char;
1420 #else
1421    typedef short int yysigned_char;
1422 #endif
1423
1424 /* YYFINAL -- State number of the termination state. */
1425 #define YYFINAL  4
1426 /* YYLAST -- Last index in YYTABLE.  */
1427 #define YYLAST   1509
1428
1429 /* YYNTOKENS -- Number of terminals. */
1430 #define YYNTOKENS  159
1431 /* YYNNTS -- Number of nonterminals. */
1432 #define YYNNTS  78
1433 /* YYNRULES -- Number of rules. */
1434 #define YYNRULES  297
1435 /* YYNRULES -- Number of states. */
1436 #define YYNSTATES  578
1437
1438 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
1439 #define YYUNDEFTOK  2
1440 #define YYMAXUTOK   399
1441
1442 #define YYTRANSLATE(YYX)                                                \
1443   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1444
1445 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
1446 static const unsigned char yytranslate[] =
1447 {
1448        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1449        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1450        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1451        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1452      148,   149,   157,     2,   146,     2,     2,     2,     2,     2,
1453        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1454      153,   145,   154,     2,     2,     2,     2,     2,     2,     2,
1455        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1456        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1457        2,   150,   147,   152,     2,     2,     2,     2,     2,   158,
1458        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1459        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1460      151,     2,     2,   155,     2,   156,     2,     2,     2,     2,
1461        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1462        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1463        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1464        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1465        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1466        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1467        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1468        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1469        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1470        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1471        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1472        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1473        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
1474        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
1475       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
1476       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
1477       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
1478       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
1479       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
1480       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
1481       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
1482       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
1483       95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
1484      105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
1485      115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
1486      125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
1487      135,   136,   137,   138,   139,   140,   141,   142,   143,   144
1488 };
1489
1490 #if YYDEBUG
1491 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1492    YYRHS.  */
1493 static const unsigned short int yyprhs[] =
1494 {
1495        0,     0,     3,     5,     7,     9,    11,    13,    15,    17,
1496       19,    21,    23,    25,    27,    29,    31,    33,    35,    37,
1497       39,    41,    43,    45,    47,    49,    51,    53,    55,    57,
1498       59,    61,    63,    65,    67,    69,    71,    73,    75,    77,
1499       79,    81,    83,    85,    87,    89,    91,    93,    95,    97,
1500       99,   101,   103,   105,   107,   109,   111,   113,   115,   117,
1501      119,   121,   123,   125,   127,   129,   131,   133,   135,   137,
1502      139,   141,   143,   145,   147,   149,   151,   153,   156,   157,
1503      159,   161,   163,   165,   167,   169,   171,   172,   173,   175,
1504      177,   179,   181,   183,   185,   188,   189,   192,   193,   197,
1505      200,   201,   203,   204,   208,   210,   213,   215,   217,   219,
1506      221,   223,   225,   227,   229,   231,   233,   235,   237,   239,
1507      241,   243,   245,   247,   249,   251,   253,   255,   258,   263,
1508      269,   275,   279,   282,   285,   287,   291,   293,   297,   299,
1509      300,   305,   309,   313,   318,   323,   327,   330,   333,   336,
1510      339,   342,   345,   348,   351,   354,   357,   364,   370,   379,
1511      386,   393,   400,   408,   416,   423,   430,   439,   448,   452,
1512      454,   456,   458,   460,   463,   466,   471,   474,   476,   481,
1513      484,   489,   490,   498,   499,   507,   508,   516,   517,   525,
1514      529,   534,   535,   537,   539,   541,   545,   549,   553,   557,
1515      561,   565,   567,   568,   570,   572,   574,   575,   578,   582,
1516      584,   586,   590,   592,   593,   602,   604,   606,   610,   612,
1517      614,   617,   618,   620,   622,   623,   628,   629,   631,   633,
1518      635,   637,   639,   641,   643,   645,   647,   651,   653,   659,
1519      661,   663,   665,   667,   670,   673,   676,   680,   683,   684,
1520      686,   689,   692,   696,   706,   716,   725,   739,   741,   743,
1521      750,   756,   759,   766,   774,   776,   780,   782,   783,   786,
1522      788,   794,   800,   806,   813,   820,   823,   828,   833,   840,
1523      845,   850,   857,   864,   867,   875,   877,   880,   881,   883,
1524      884,   888,   895,   899,   906,   909,   914,   921
1525 };
1526
1527 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1528 static const short int yyrhs[] =
1529 {
1530      193,     0,    -1,     5,    -1,     6,    -1,     3,    -1,     4,
1531       -1,    78,    -1,    79,    -1,    80,    -1,    81,    -1,    82,
1532       -1,    83,    -1,    84,    -1,    85,    -1,    86,    -1,    87,
1533       -1,    88,    -1,    89,    -1,    90,    -1,    91,    -1,    92,
1534       -1,    93,    -1,    94,    -1,    95,    -1,   124,    -1,   125,
1535       -1,   126,    -1,   127,    -1,   128,    -1,   129,    -1,   130,
1536       -1,   131,    -1,   132,    -1,   133,    -1,   134,    -1,   135,
1537       -1,   138,    -1,   139,    -1,   140,    -1,    98,    -1,    99,
1538       -1,   100,    -1,   101,    -1,   102,    -1,   103,    -1,   104,
1539       -1,   105,    -1,   106,    -1,   107,    -1,   108,    -1,   109,
1540       -1,   110,    -1,   111,    -1,   112,    -1,   113,    -1,   114,
1541       -1,   115,    -1,   116,    -1,   117,    -1,   104,    -1,   105,
1542       -1,   106,    -1,   107,    -1,    27,    -1,    28,    -1,    16,
1543       -1,    14,    -1,    12,    -1,    10,    -1,    17,    -1,    15,
1544       -1,    13,    -1,    11,    -1,   169,    -1,   170,    -1,    18,
1545       -1,    19,    -1,   205,   145,    -1,    -1,    41,    -1,    42,
1546       -1,    43,    -1,    44,    -1,    45,    -1,    46,    -1,    47,
1547       -1,    -1,    -1,    65,    -1,    66,    -1,    67,    -1,    68,
1548       -1,    69,    -1,    70,    -1,    64,     4,    -1,    -1,    57,
1549        4,    -1,    -1,   146,    57,     4,    -1,    34,    24,    -1,
1550       -1,   178,    -1,    -1,   146,   181,   180,    -1,   178,    -1,
1551       57,     4,    -1,   184,    -1,     8,    -1,   186,    -1,     8,
1552       -1,   186,    -1,     9,    -1,    10,    -1,    11,    -1,    12,
1553       -1,    13,    -1,    14,    -1,    15,    -1,    16,    -1,    17,
1554       -1,    18,    -1,    19,    -1,    20,    -1,    21,    -1,    48,
1555       -1,   185,    -1,   220,    -1,   147,     4,    -1,   183,   148,
1556      188,   149,    -1,   150,     4,   151,   186,   152,    -1,   153,
1557        4,   151,   186,   154,    -1,   155,   187,   156,    -1,   155,
1558      156,    -1,   186,   157,    -1,   186,    -1,   187,   146,   186,
1559       -1,   187,    -1,   187,   146,    37,    -1,    37,    -1,    -1,
1560      184,   150,   191,   152,    -1,   184,   150,   152,    -1,   184,
1561      158,    24,    -1,   184,   153,   191,   154,    -1,   184,   155,
1562      191,   156,    -1,   184,   155,   156,    -1,   184,    38,    -1,
1563      184,    39,    -1,   184,   220,    -1,   184,   190,    -1,   184,
1564       26,    -1,   169,   161,    -1,   170,     4,    -1,     9,    27,
1565       -1,     9,    28,    -1,   172,     7,    -1,   165,   148,   189,
1566       36,   184,   149,    -1,   123,   148,   189,   234,   149,    -1,
1567      137,   148,   189,   146,   189,   146,   189,   149,    -1,   162,
1568      148,   189,   146,   189,   149,    -1,   163,   148,   189,   146,
1569      189,   149,    -1,   164,   148,   189,   146,   189,   149,    -1,
1570       96,   167,   148,   189,   146,   189,   149,    -1,    97,   168,
1571      148,   189,   146,   189,   149,    -1,   166,   148,   189,   146,
1572      189,   149,    -1,   142,   148,   189,   146,   189,   149,    -1,
1573      143,   148,   189,   146,   189,   146,   189,   149,    -1,   144,
1574      148,   189,   146,   189,   146,   189,   149,    -1,   191,   146,
1575      189,    -1,   189,    -1,    32,    -1,    33,    -1,   194,    -1,
1576      194,   214,    -1,   194,   216,    -1,   194,    62,    61,   200,
1577       -1,   194,    25,    -1,   195,    -1,   195,   173,    20,   182,
1578       -1,   195,   216,    -1,   195,    62,    61,   200,    -1,    -1,
1579      195,   173,   174,   192,   189,   196,   180,    -1,    -1,   195,
1580      173,    50,   192,   184,   197,   180,    -1,    -1,   195,   173,
1581       45,   192,   184,   198,   180,    -1,    -1,   195,   173,    47,
1582      192,   184,   199,   180,    -1,   195,    51,   202,    -1,   195,
1583       58,   145,   203,    -1,    -1,    24,    -1,    56,    -1,    55,
1584       -1,    53,   145,   201,    -1,    54,   145,     4,    -1,    52,
1585      145,    24,    -1,    71,   145,    24,    -1,   150,   204,   152,
1586       -1,   204,   146,    24,    -1,    24,    -1,    -1,    22,    -1,
1587       24,    -1,   205,    -1,    -1,   184,   206,    -1,   208,   146,
1588      207,    -1,   207,    -1,   208,    -1,   208,   146,    37,    -1,
1589       37,    -1,    -1,   175,   182,   205,   148,   209,   149,   179,
1590      176,    -1,    29,    -1,   155,    -1,   174,   210,   211,    -1,
1591       30,    -1,   156,    -1,   223,   213,    -1,    -1,    45,    -1,
1592       47,    -1,    -1,    31,   217,   215,   210,    -1,    -1,    63,
1593       -1,     3,    -1,     4,    -1,     7,    -1,    27,    -1,    28,
1594       -1,    38,    -1,    39,    -1,    26,    -1,   153,   191,   154,
1595       -1,   190,    -1,    61,   218,    24,   146,    24,    -1,   160,
1596       -1,   205,    -1,   220,    -1,   219,    -1,   184,   221,    -1,
1597      223,   224,    -1,   212,   224,    -1,   225,   173,   226,    -1,
1598      225,   228,    -1,    -1,    23,    -1,    72,   222,    -1,    72,
1599        8,    -1,    73,    21,   221,    -1,    73,     9,   221,   146,
1600       21,   221,   146,    21,   221,    -1,    74,   171,   221,   146,
1601       21,   221,   150,   227,   152,    -1,    74,   171,   221,   146,
1602       21,   221,   150,   152,    -1,    75,   175,   182,   221,   148,
1603      231,   149,    36,    21,   221,    76,    21,   221,    -1,    76,
1604       -1,    77,    -1,   227,   171,   219,   146,    21,   221,    -1,
1605      171,   219,   146,    21,   221,    -1,   173,   233,    -1,   184,
1606      150,   221,   146,   221,   152,    -1,   229,   146,   150,   221,
1607      146,   221,   152,    -1,   222,    -1,   230,   146,   222,    -1,
1608      230,    -1,    -1,    60,    59,    -1,    59,    -1,   162,   184,
1609      221,   146,   221,    -1,   163,   184,   221,   146,   221,    -1,
1610      164,   184,   221,   146,   221,    -1,    96,   167,   184,   221,
1611      146,   221,    -1,    97,   168,   184,   221,   146,   221,    -1,
1612       49,   222,    -1,   166,   222,   146,   222,    -1,   165,   222,
1613       36,   184,    -1,   137,   222,   146,   222,   146,   222,    -1,
1614      141,   222,   146,   184,    -1,   142,   222,   146,   222,    -1,
1615      143,   222,   146,   222,   146,   222,    -1,   144,   222,   146,
1616      222,   146,   222,    -1,   136,   229,    -1,   232,   175,   182,
1617      221,   148,   231,   149,    -1,   236,    -1,   146,   230,    -1,
1618       -1,    35,    -1,    -1,   118,   184,   177,    -1,   118,   184,
1619      146,    15,   221,   177,    -1,   119,   184,   177,    -1,   119,
1620      184,   146,    15,   221,   177,    -1,   120,   222,    -1,   235,
1621      121,   184,   221,    -1,   235,   122,   222,   146,   184,   221,
1622       -1,   123,   184,   221,   234,    -1
1623 };
1624
1625 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
1626 static const unsigned short int yyrline[] =
1627 {
1628        0,   990,   990,   991,   999,  1000,  1010,  1010,  1010,  1010,
1629     1010,  1010,  1010,  1010,  1010,  1011,  1011,  1011,  1012,  1012,
1630     1012,  1012,  1012,  1012,  1013,  1013,  1013,  1013,  1013,  1013,
1631     1014,  1014,  1014,  1014,  1014,  1014,  1015,  1015,  1015,  1017,
1632     1017,  1018,  1018,  1019,  1019,  1020,  1020,  1021,  1021,  1025,
1633     1025,  1026,  1026,  1027,  1027,  1028,  1028,  1029,  1029,  1030,
1634     1030,  1031,  1031,  1032,  1033,  1038,  1038,  1038,  1038,  1039,
1635     1039,  1039,  1039,  1040,  1040,  1041,  1041,  1044,  1048,  1053,
1636     1054,  1055,  1056,  1057,  1058,  1059,  1060,  1062,  1063,  1064,
1637     1065,  1066,  1067,  1068,  1069,  1078,  1079,  1085,  1086,  1094,
1638     1102,  1103,  1108,  1109,  1110,  1115,  1129,  1129,  1130,  1130,
1639     1132,  1142,  1142,  1142,  1142,  1142,  1142,  1142,  1143,  1143,
1640     1143,  1143,  1143,  1143,  1144,  1148,  1152,  1160,  1168,  1181,
1641     1186,  1198,  1208,  1212,  1223,  1228,  1234,  1235,  1239,  1243,
1642     1254,  1280,  1294,  1324,  1350,  1371,  1384,  1394,  1399,  1460,
1643     1467,  1475,  1481,  1487,  1491,  1495,  1503,  1515,  1536,  1544,
1644     1550,  1561,  1567,  1572,  1577,  1586,  1592,  1598,  1607,  1611,
1645     1619,  1619,  1629,  1637,  1642,  1646,  1650,  1654,  1669,  1691,
1646     1694,  1697,  1697,  1705,  1705,  1713,  1713,  1721,  1721,  1730,
1647     1733,  1736,  1740,  1753,  1754,  1756,  1760,  1769,  1773,  1778,
1648     1780,  1785,  1790,  1799,  1799,  1800,  1800,  1802,  1809,  1815,
1649     1822,  1826,  1832,  1837,  1842,  1937,  1937,  1939,  1947,  1947,
1650     1949,  1954,  1955,  1956,  1958,  1958,  1968,  1972,  1977,  1981,
1651     1985,  1989,  1993,  1997,  2001,  2005,  2009,  2034,  2038,  2052,
1652     2056,  2062,  2062,  2068,  2073,  2077,  2086,  2097,  2106,  2118,
1653     2131,  2135,  2139,  2144,  2153,  2172,  2181,  2237,  2241,  2248,
1654     2259,  2272,  2281,  2290,  2300,  2304,  2311,  2311,  2313,  2317,
1655     2322,  2341,  2356,  2370,  2381,  2392,  2405,  2414,  2425,  2433,
1656     2438,  2444,  2450,  2456,  2471,  2530,  2537,  2540,  2545,  2549,
1657     2556,  2561,  2567,  2572,  2578,  2586,  2598,  2613
1658 };
1659 #endif
1660
1661 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1662 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1663    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1664 static const char *const yytname[] =
1665 {
1666   "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "SINTVAL",
1667   "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT",
1668   "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL",
1669   "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
1670   "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK",
1671   "DECLARE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO",
1672   "DOTDOTDOT", "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE",
1673   "WEAK", "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE",
1674   "NOT", "EXTERNAL", "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE",
1675   "BIG", "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
1676   "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
1677   "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1678   "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB",
1679   "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR",
1680   "XOR", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "ICMP",
1681   "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE",
1682   "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ",
1683   "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR",
1684   "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP",
1685   "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK",
1686   "SELECT", "SHL", "LSHR", "ASHR", "VAARG", "EXTRACTELEMENT",
1687   "INSERTELEMENT", "SHUFFLEVECTOR", "'='", "','", "'\\\\'", "'('", "')'",
1688   "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", "'*'", "'c'", "$accept",
1689   "INTVAL", "EINT64VAL", "ArithmeticOps", "LogicalOps", "SetCondOps",
1690   "CastOps", "ShiftOps", "IPredicates", "FPredicates", "SIntType",
1691   "UIntType", "IntType", "FPType", "OptAssign", "OptLinkage",
1692   "OptCallingConv", "OptAlign", "OptCAlign", "SectionString", "OptSection",
1693   "GlobalVarAttributes", "GlobalVarAttribute", "TypesV", "UpRTypesV",
1694   "Types", "PrimType", "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal",
1695   "ConstExpr", "ConstVector", "GlobalType", "Module", "FunctionList",
1696   "ConstPool", "@1", "@2", "@3", "@4", "AsmBlock", "BigOrLittle",
1697   "TargetDefinition", "LibrariesDefinition", "LibList", "Name", "OptName",
1698   "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN",
1699   "FunctionHeader", "END", "Function", "FnDeclareLinkage", "FunctionProto",
1700   "@5", "OptSideEffect", "ConstValueRef", "SymbolicValueRef", "ValueRef",
1701   "ResolvedVal", "BasicBlockList", "BasicBlock", "InstructionList",
1702   "BBTerminatorInst", "JumpTable", "Inst", "PHIList", "ValueRefList",
1703   "ValueRefListE", "OptTailCall", "InstVal", "IndexList", "OptVolatile",
1704   "MemoryInst", 0
1705 };
1706 #endif
1707
1708 # ifdef YYPRINT
1709 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1710    token YYLEX-NUM.  */
1711 static const unsigned short int yytoknum[] =
1712 {
1713        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
1714      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
1715      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
1716      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
1717      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
1718      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
1719      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
1720      325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
1721      335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
1722      345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
1723      355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
1724      365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
1725      375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
1726      385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
1727      395,   396,   397,   398,   399,    61,    44,    92,    40,    41,
1728       91,   120,    93,    60,    62,   123,   125,    42,    99
1729 };
1730 # endif
1731
1732 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
1733 static const unsigned char yyr1[] =
1734 {
1735        0,   159,   160,   160,   161,   161,   162,   162,   162,   162,
1736      162,   162,   162,   162,   162,   163,   163,   163,   164,   164,
1737      164,   164,   164,   164,   165,   165,   165,   165,   165,   165,
1738      165,   165,   165,   165,   165,   165,   166,   166,   166,   167,
1739      167,   167,   167,   167,   167,   167,   167,   167,   167,   168,
1740      168,   168,   168,   168,   168,   168,   168,   168,   168,   168,
1741      168,   168,   168,   168,   168,   169,   169,   169,   169,   170,
1742      170,   170,   170,   171,   171,   172,   172,   173,   173,   174,
1743      174,   174,   174,   174,   174,   174,   174,   175,   175,   175,
1744      175,   175,   175,   175,   175,   176,   176,   177,   177,   178,
1745      179,   179,   180,   180,   181,   181,   182,   182,   183,   183,
1746      184,   185,   185,   185,   185,   185,   185,   185,   185,   185,
1747      185,   185,   185,   185,   186,   186,   186,   186,   186,   186,
1748      186,   186,   186,   186,   187,   187,   188,   188,   188,   188,
1749      189,   189,   189,   189,   189,   189,   189,   189,   189,   189,
1750      189,   189,   189,   189,   189,   189,   190,   190,   190,   190,
1751      190,   190,   190,   190,   190,   190,   190,   190,   191,   191,
1752      192,   192,   193,   194,   194,   194,   194,   194,   195,   195,
1753      195,   196,   195,   197,   195,   198,   195,   199,   195,   195,
1754      195,   195,   200,   201,   201,   202,   202,   202,   202,   203,
1755      204,   204,   204,   205,   205,   206,   206,   207,   208,   208,
1756      209,   209,   209,   209,   210,   211,   211,   212,   213,   213,
1757      214,   215,   215,   215,   217,   216,   218,   218,   219,   219,
1758      219,   219,   219,   219,   219,   219,   219,   219,   219,   220,
1759      220,   221,   221,   222,   223,   223,   224,   225,   225,   225,
1760      226,   226,   226,   226,   226,   226,   226,   226,   226,   227,
1761      227,   228,   229,   229,   230,   230,   231,   231,   232,   232,
1762      233,   233,   233,   233,   233,   233,   233,   233,   233,   233,
1763      233,   233,   233,   233,   233,   233,   234,   234,   235,   235,
1764      236,   236,   236,   236,   236,   236,   236,   236
1765 };
1766
1767 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
1768 static const unsigned char yyr2[] =
1769 {
1770        0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
1771        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1772        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1773        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1774        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1775        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1776        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1777        1,     1,     1,     1,     1,     1,     1,     2,     0,     1,
1778        1,     1,     1,     1,     1,     1,     0,     0,     1,     1,
1779        1,     1,     1,     1,     2,     0,     2,     0,     3,     2,
1780        0,     1,     0,     3,     1,     2,     1,     1,     1,     1,
1781        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1782        1,     1,     1,     1,     1,     1,     1,     2,     4,     5,
1783        5,     3,     2,     2,     1,     3,     1,     3,     1,     0,
1784        4,     3,     3,     4,     4,     3,     2,     2,     2,     2,
1785        2,     2,     2,     2,     2,     2,     6,     5,     8,     6,
1786        6,     6,     7,     7,     6,     6,     8,     8,     3,     1,
1787        1,     1,     1,     2,     2,     4,     2,     1,     4,     2,
1788        4,     0,     7,     0,     7,     0,     7,     0,     7,     3,
1789        4,     0,     1,     1,     1,     3,     3,     3,     3,     3,
1790        3,     1,     0,     1,     1,     1,     0,     2,     3,     1,
1791        1,     3,     1,     0,     8,     1,     1,     3,     1,     1,
1792        2,     0,     1,     1,     0,     4,     0,     1,     1,     1,
1793        1,     1,     1,     1,     1,     1,     3,     1,     5,     1,
1794        1,     1,     1,     2,     2,     2,     3,     2,     0,     1,
1795        2,     2,     3,     9,     9,     8,    13,     1,     1,     6,
1796        5,     2,     6,     7,     1,     3,     1,     0,     2,     1,
1797        5,     5,     5,     6,     6,     2,     4,     4,     6,     4,
1798        4,     6,     6,     2,     7,     1,     2,     0,     1,     0,
1799        3,     6,     3,     6,     2,     4,     6,     4
1800 };
1801
1802 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1803    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
1804    means the default is an error.  */
1805 static const unsigned short int yydefact[] =
1806 {
1807      191,     0,    86,   177,     1,   176,   224,    79,    80,    81,
1808       82,    83,    84,    85,     0,    87,   248,   173,   174,   248,
1809      203,   204,     0,     0,     0,    86,     0,   179,   221,     0,
1810        0,    88,    89,    90,    91,    92,    93,     0,     0,   249,
1811      245,    78,   218,   219,   220,   244,     0,     0,     0,     0,
1812      189,     0,     0,     0,     0,     0,     0,     0,    77,   222,
1813      223,    87,   192,   175,    94,     2,     3,   107,   111,   112,
1814      113,   114,   115,   116,   117,   118,   119,   120,   121,   122,
1815      123,   124,     0,     0,     0,     0,   239,     0,     0,   106,
1816      125,   110,   240,   126,   215,   216,   217,   289,   247,     0,
1817        0,     0,     0,   202,   190,   180,   178,   170,   171,     0,
1818        0,     0,     0,   225,   127,     0,     0,   109,   132,   134,
1819        0,     0,   139,   133,   288,     0,   269,     0,     0,     0,
1820        0,    87,   257,   258,     6,     7,     8,     9,    10,    11,
1821       12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
1822       22,    23,     0,     0,     0,     0,     0,     0,    24,    25,
1823       26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
1824        0,     0,    36,    37,    38,     0,     0,     0,     0,     0,
1825        0,     0,     0,     0,   246,    87,   261,     0,   285,   197,
1826      194,   193,   195,   196,   198,   201,     0,   185,   187,   183,
1827      111,   112,   113,   114,   115,   116,   117,   118,   119,   120,
1828      121,     0,     0,     0,     0,   181,     0,     0,     0,   131,
1829      213,   138,   136,     0,     0,   275,   268,   251,   250,     0,
1830        0,    68,    72,    67,    71,    66,    70,    65,    69,    73,
1831       74,     0,     0,    39,    40,    41,    42,    43,    44,    45,
1832       46,    47,    48,     0,    63,    64,    59,    60,    61,    62,
1833       49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
1834        0,    97,    97,   294,     0,     0,   283,     0,     0,     0,
1835        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1836        0,   199,   102,   102,   102,   153,   154,     4,     5,   151,
1837      152,   155,   150,   146,   147,     0,     0,     0,     0,     0,
1838        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1839        0,   149,   148,   102,   108,   108,   135,   212,   206,   209,
1840      210,     0,     0,   128,   228,   229,   230,   235,   231,   232,
1841      233,   234,   226,     0,   237,   242,   241,   243,     0,   252,
1842        0,     0,     0,     0,     0,   290,     0,   292,   287,     0,
1843        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1844        0,     0,     0,     0,   200,     0,   186,   188,   184,     0,
1845        0,     0,     0,     0,     0,     0,   141,   169,     0,     0,
1846      145,     0,   142,     0,     0,     0,     0,     0,   182,   129,
1847      130,   205,   207,     0,   100,   137,   227,     0,     0,     0,
1848        0,     0,     0,     0,     0,     0,     0,     0,   297,     0,
1849        0,     0,   279,   280,     0,     0,     0,     0,     0,   277,
1850      276,     0,   295,     0,     0,     0,   104,   102,     0,     0,
1851      287,     0,     0,     0,     0,     0,   140,   143,   144,     0,
1852        0,     0,     0,     0,   211,   208,   101,    95,     0,   236,
1853        0,     0,   267,     0,     0,    97,    98,    97,   264,   286,
1854        0,     0,     0,     0,     0,   270,   271,   272,   267,     0,
1855       99,   105,   103,     0,     0,     0,     0,     0,     0,     0,
1856      168,     0,     0,     0,     0,     0,     0,   214,     0,     0,
1857        0,   266,     0,   273,   274,     0,   291,   293,     0,     0,
1858        0,   278,   281,   282,     0,   296,     0,     0,   157,     0,
1859        0,     0,     0,     0,     0,     0,     0,     0,    96,   238,
1860        0,     0,     0,   265,   262,     0,   284,     0,     0,     0,
1861      165,     0,     0,   159,   160,   161,   156,   164,     0,   255,
1862        0,     0,     0,   263,   162,   163,     0,     0,     0,   253,
1863        0,   254,     0,     0,   158,   166,   167,     0,     0,     0,
1864        0,     0,     0,   260,     0,     0,   259,   256
1865 };
1866
1867 /* YYDEFGOTO[NTERM-NUM]. */
1868 static const short int yydefgoto[] =
1869 {
1870       -1,    86,   299,   316,   317,   318,   319,   320,   253,   270,
1871      211,   212,   241,   213,    25,    15,    37,   497,   355,   436,
1872      457,   376,   437,    87,    88,   214,    90,    91,   120,   223,
1873      387,   344,   388,   109,     1,     2,     3,   323,   294,   292,
1874      293,    63,   192,    50,   104,   196,    92,   402,   329,   330,
1875      331,    38,    96,    16,    44,    17,    61,    18,    28,   407,
1876      345,    93,   347,   468,    19,    40,    41,   184,   551,    98,
1877      276,   501,   502,   185,   186,   418,   187,   188
1878 };
1879
1880 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1881    STATE-NUM.  */
1882 #define YYPACT_NINF -517
1883 static const short int yypact[] =
1884 {
1885     -517,    40,    69,   528,  -517,  -517,  -517,  -517,  -517,  -517,
1886     -517,  -517,  -517,  -517,    16,    90,    76,  -517,  -517,     5,
1887     -517,  -517,    50,   -40,    71,    37,   -15,  -517,    -4,   124,
1888      164,  -517,  -517,  -517,  -517,  -517,  -517,  1244,   -18,  -517,
1889     -517,   125,  -517,  -517,  -517,  -517,    45,    53,    54,    59,
1890     -517,    67,   124,  1244,   103,   103,   103,   103,  -517,  -517,
1891     -517,    90,  -517,  -517,  -517,  -517,  -517,    70,  -517,  -517,
1892     -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,
1893     -517,  -517,   197,   215,   216,   670,  -517,   125,    73,  -517,
1894     -517,   -62,  -517,  -517,  -517,  -517,  -517,  1349,  -517,   198,
1895      111,   219,   200,   201,  -517,  -517,  -517,  -517,  -517,  1264,
1896     1264,  1264,  1309,  -517,  -517,    75,    77,  -517,  -517,   -62,
1897     -108,    81,  1051,  -517,  -517,  1264,  -517,   168,  1354,    24,
1898      112,    90,  -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,
1899     -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,
1900     -517,  -517,   108,    65,  1264,  1264,  1264,  1264,  -517,  -517,
1901     -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,
1902     1264,  1264,  -517,  -517,  -517,  1264,  1264,  1264,  1264,  1264,
1903     1264,  1264,  1264,  1264,  -517,    90,  -517,    42,  -517,  -517,
1904     -517,  -517,  -517,  -517,  -517,  -517,  -110,  -517,  -517,  -517,
1905      157,   183,   226,   185,   227,   189,   228,   191,   230,   231,
1906      235,   193,   239,   237,   577,  -517,  1264,  1264,  1264,  -517,
1907     1092,  -517,    89,    96,   763,  -517,  -517,    70,  -517,   763,
1908      763,  -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,
1909     -517,   763,  1244,  -517,  -517,  -517,  -517,  -517,  -517,  -517,
1910     -517,  -517,  -517,  1264,  -517,  -517,  -517,  -517,  -517,  -517,
1911     -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,  -517,
1912     1264,   101,   102,  -517,   763,    99,   107,   109,   110,   113,
1913      114,   115,   763,   763,   763,   218,   116,  1244,  1264,  1264,
1914      233,  -517,   117,   117,   117,  -517,  -517,  -517,  -517,  -517,
1915     -517,  -517,  -517,  -517,  -517,   108,    65,   119,   120,   121,
1916      123,   126,   998,  1309,   728,   234,   127,   128,   129,   130,
1917      131,  -517,  -517,   117,   -56,  -142,   -62,  -517,   125,  -517,
1918      118,   132,  1149,  -517,  -517,  -517,  -517,  -517,  -517,  -517,
1919     -517,  -517,   202,  1309,  -517,  -517,  -517,  -517,   136,  -517,
1920      137,   763,   763,   763,    -7,  -517,    -2,  -517,   138,   763,
1921      122,  1264,  1264,  1264,  1264,  1264,   146,   147,   148,  1264,
1922     1264,   763,   763,   149,  -517,   -20,  -517,  -517,  -517,   150,
1923      156,  1309,  1309,  1309,  1309,  1309,  -517,  -517,   -76,   -57,
1924     -517,   -71,  -517,  1309,  1309,  1309,  1309,  1309,  -517,  -517,
1925     -517,  -517,  -517,  1203,   262,  -517,  -517,   249,   -48,   284,
1926      285,   159,   165,   166,   763,   306,   763,  1264,  -517,   167,
1927      763,   169,  -517,  -517,   170,   171,   763,   763,   763,  -517,
1928     -517,   173,  -517,  1264,   290,   314,  -517,   117,  1309,  1309,
1929      138,   176,   177,   188,   190,  1309,  -517,  -517,  -517,   195,
1930      196,   206,   283,   208,  -517,  -517,  -517,   272,   209,  -517,
1931      763,   763,  1264,   763,   763,   210,  -517,   210,  -517,   211,
1932      763,   212,  1264,  1264,  1264,  -517,  -517,  -517,  1264,   763,
1933     -517,  -517,  -517,   213,   214,   186,  1309,  1309,  1309,  1309,
1934     -517,  1309,  1309,  1309,  1264,  1309,   333,  -517,   319,   221,
1935      220,   211,   222,  -517,  -517,   289,  -517,  -517,  1264,   217,
1936      763,  -517,  -517,  -517,   223,  -517,  1309,  1309,  -517,   229,
1937      224,   232,   236,   225,   238,   240,   241,   242,  -517,  -517,
1938      326,    10,   328,  -517,  -517,   248,  -517,   253,   254,  1309,
1939     -517,  1309,  1309,  -517,  -517,  -517,  -517,  -517,   763,  -517,
1940      905,    51,   344,  -517,  -517,  -517,   256,   261,   263,  -517,
1941      265,  -517,   905,   763,  -517,  -517,  -517,   347,   267,   300,
1942      763,   356,   358,  -517,   763,   763,  -517,  -517
1943 };
1944
1945 /* YYPGOTO[NTERM-NUM].  */
1946 static const short int yypgoto[] =
1947 {
1948     -517,  -517,  -517,   286,   288,   291,   317,   320,   134,    80,
1949     -127,  -125,  -502,  -517,   340,   391,  -114,  -517,  -265,    14,
1950     -517,  -284,  -517,   -51,  -517,   -37,  -517,   -66,   297,  -517,
1951      -94,   207,  -283,    52,  -517,  -517,  -517,  -517,  -517,  -517,
1952     -517,   368,  -517,  -517,  -517,  -517,     3,  -517,    26,  -517,
1953     -517,   372,  -517,  -517,  -517,  -517,  -517,   431,  -517,  -517,
1954     -516,    56,    79,  -124,  -517,   421,  -517,  -517,  -517,  -517,
1955     -517,    25,   -35,  -517,  -517,     4,  -517,  -517
1956 };
1957
1958 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
1959    positive, shift that token.  If negative, reduce the rule which
1960    number is the opposite.  If zero, do what YYDEFACT says.
1961    If YYTABLE_NINF, syntax error.  */
1962 #define YYTABLE_NINF -173
1963 static const short int yytable[] =
1964 {
1965       89,   225,   106,   239,   228,   240,    26,   357,   414,   377,
1966      378,    94,   400,   416,   434,   123,    89,   242,   215,   119,
1967      231,   232,   233,   234,   235,   236,   237,   238,    39,   550,
1968      389,   391,   273,   229,   560,    42,   290,   435,   218,   398,
1969        4,    59,   291,    60,    26,   230,   568,   277,   219,   562,
1970      415,   278,   279,   280,   281,   415,   119,    53,   285,   286,
1971      408,   231,   232,   233,   234,   235,   236,   237,   238,  -172,
1972      445,   287,   197,   198,   199,   445,   446,    29,     7,     8,
1973        9,    10,    54,    12,    55,   448,  -108,    56,   224,   445,
1974      121,   224,   254,   255,     5,   123,   399,   447,   445,    39,
1975        6,   123,    46,    47,    48,    51,   459,   110,   111,   112,
1976        7,     8,     9,    10,    11,    12,    13,   271,   272,   224,
1977      274,    49,   231,   232,   233,   234,   235,   236,   237,   238,
1978       58,    14,    52,   275,   224,   107,   108,    95,   224,   224,
1979      224,   224,   282,   283,   284,   224,   224,    20,    62,    21,
1980      324,   325,   326,   482,    30,    31,    32,    33,    34,    35,
1981       36,    43,   549,   288,   289,   373,   190,   191,    64,   256,
1982      257,   258,   259,   260,   261,   262,   263,   264,   265,   266,
1983      267,   268,   269,   328,   295,   296,   -68,   -68,   -67,   -67,
1984       99,   351,   -66,   -66,   -65,   -65,   297,   298,   100,   101,
1985      506,   114,   507,   561,   102,    89,   243,   244,   245,   246,
1986      247,   248,   249,   250,   251,   252,   352,   103,  -109,   115,
1987      116,   122,   189,   193,   194,   195,   216,   226,   217,   220,
1988      -72,   -71,   -70,   353,   -69,   332,   371,   421,   -75,   423,
1989      424,   425,   -76,   300,   301,   333,   430,   354,   356,   359,
1990       89,   372,   224,   360,   369,   361,   362,   374,   392,   363,
1991      364,   365,   370,   375,   403,   406,   326,   381,   382,   383,
1992      322,   384,   420,   458,   385,   393,   394,   395,   396,   397,
1993      346,   404,   409,   410,   417,   346,   346,   440,   441,   442,
1994      443,   444,   426,   427,   428,   433,   434,   346,   438,   449,
1995      450,   451,   452,   453,   439,   460,   461,   462,   348,   349,
1996      466,   463,   464,   470,   480,   472,   473,   474,   481,   494,
1997      350,   478,   486,   487,   224,   422,   224,   224,   224,   496,
1998      346,   401,   429,   224,   488,   518,   489,   528,   346,   346,
1999      346,   491,   492,   529,   483,   484,   415,   548,   511,   512,
2000      513,   490,   493,   358,   495,   498,   505,   508,   510,   516,
2001      517,   366,   367,   368,   552,   563,   328,   530,   570,   534,
2002      531,   532,   536,   540,   543,   539,   572,   574,   541,   575,
2003      224,    97,   542,   179,   533,   180,   380,   544,   181,   545,
2004      546,   547,   519,   520,   521,   522,   479,   523,   524,   525,
2005      553,   527,   554,   555,   239,   564,   240,   346,   346,   346,
2006      565,   567,   566,   571,   182,   346,    57,   183,   456,   222,
2007      105,   321,   537,   538,   239,   224,   240,   346,   346,   455,
2008      411,   412,   413,   113,    27,   224,   224,   224,   419,   379,
2009       45,   224,   469,   514,   485,   556,     0,   557,   558,     0,
2010      431,   432,     0,     0,     0,     0,     0,   526,     0,     0,
2011        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2012      346,   224,   346,     0,     0,     0,   346,     0,     0,     0,
2013        0,     0,   346,   346,   346,     0,     0,     0,     0,     0,
2014        0,     0,     0,   465,     0,   467,     0,     0,     0,   471,
2015        0,     0,     0,     0,     0,   475,   476,   477,     0,     0,
2016        0,     0,     0,     0,     0,     0,   346,   346,     0,   346,
2017      346,     0,     0,     0,     0,     0,   346,     0,     0,     0,
2018        0,     0,     0,     0,     0,   346,     0,     0,     0,   499,
2019      500,     0,   503,   504,     0,     0,     0,     0,   -78,   509,
2020       20,     0,    21,     0,     0,     0,     0,     0,   515,     6,
2021      -78,   -78,     0,     0,     0,     0,   346,     0,     0,   -78,
2022      -78,   -78,   -78,   -78,   -78,   -78,     0,     0,   -78,    22,
2023        0,     0,    65,    66,     0,     0,    23,     0,     0,   535,
2024       24,     0,     0,     0,     0,     0,     0,     0,     0,    20,
2025        0,    21,     0,   302,   346,     0,     0,     0,     0,     0,
2026        0,     0,     0,     0,     0,   303,   304,     0,     0,   346,
2027        0,     0,     0,     0,     0,     0,   346,   559,     0,     0,
2028      346,   346,     0,     0,     0,     0,     0,     0,     0,     0,
2029        0,     0,   569,     0,     0,     0,     0,     0,     0,   573,
2030        0,     0,     0,   576,   577,   134,   135,   136,   137,   138,
2031      139,   140,   141,   142,   143,   144,   145,   146,   147,   148,
2032      149,   150,   151,   305,   306,    65,    66,     0,   117,    68,
2033       69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
2034       79,    80,    20,     0,    21,     0,     0,     0,     0,     0,
2035      307,   158,   159,   160,   161,   162,   163,   164,   165,   166,
2036      167,   168,   169,     0,   308,   172,   173,   174,    81,   309,
2037      310,   311,     0,     0,     0,     0,     0,   312,     0,     0,
2038      313,     0,   314,    65,    66,   315,   117,   200,   201,   202,
2039      203,   204,   205,   206,   207,   208,   209,   210,    79,    80,
2040       20,     0,    21,     0,     0,     0,     0,     0,     0,     0,
2041        0,     0,     0,     0,     0,     0,   334,   335,    65,    66,
2042      336,     0,     0,     0,     0,     0,    81,     0,     0,     0,
2043        0,     0,     0,     0,     0,    20,     0,    21,     0,   337,
2044      338,   339,     0,     0,     0,     0,     0,     0,     0,     0,
2045        0,   340,   341,     0,     0,     0,     0,     0,     0,     0,
2046        0,     0,     0,     0,     0,     0,     0,    82,     0,     0,
2047       83,     0,     0,    84,   342,    85,   118,     0,     0,     0,
2048        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2049        0,   134,   135,   136,   137,   138,   139,   140,   141,   142,
2050      143,   144,   145,   146,   147,   148,   149,   150,   151,   305,
2051      306,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2052        0,     0,     0,     0,     0,    82,     0,     0,    83,     0,
2053        0,    84,     0,    85,   390,     0,   307,   158,   159,   160,
2054      161,   162,   163,   164,   165,   166,   167,   168,   169,     0,
2055      308,   172,   173,   174,     0,   309,   310,   311,   334,   335,
2056        0,     0,   336,     0,     0,     0,   343,     0,     0,     0,
2057        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2058        0,   337,   338,   339,     0,     0,     0,     0,     0,     0,
2059        0,     0,     0,   340,   341,     0,     0,     0,     0,     0,
2060        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2061        0,     0,     0,     0,     0,     0,   342,     0,     0,     0,
2062        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2063        0,     0,     0,   134,   135,   136,   137,   138,   139,   140,
2064      141,   142,   143,   144,   145,   146,   147,   148,   149,   150,
2065      151,   305,   306,    65,    66,     0,   117,   200,   201,   202,
2066      203,   204,   205,   206,   207,   208,   209,   210,    79,    80,
2067       20,     0,    21,     0,     0,     0,     0,     0,   307,   158,
2068      159,   160,   161,   162,   163,   164,   165,   166,   167,   168,
2069      169,     0,   308,   172,   173,   174,    81,   309,   310,   311,
2070        0,     0,     0,     0,     0,     0,    65,    66,   343,   117,
2071       68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
2072       78,    79,    80,    20,     0,    21,     0,     0,     0,     0,
2073        0,     0,     0,     0,     0,     0,     0,     0,   221,     0,
2074        0,     0,     0,     0,     0,     0,     0,    65,    66,    81,
2075      117,    68,    69,    70,    71,    72,    73,    74,    75,    76,
2076       77,    78,    79,    80,    20,     0,    21,     0,     0,     0,
2077        0,     0,     0,     0,     0,     0,     0,     0,     0,   327,
2078        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2079       81,     0,     0,     0,     0,    82,     0,     0,    83,     0,
2080      386,    84,     0,    85,    65,    66,     0,   117,    68,    69,
2081       70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
2082       80,    20,     0,    21,     0,     0,     0,     0,     0,     0,
2083        0,     0,     0,     0,     0,     0,   405,     0,     0,     0,
2084        0,     0,     0,     0,     0,     0,     0,    81,    82,     0,
2085        0,    83,     0,     0,    84,     0,    85,     0,    65,    66,
2086        0,   117,    68,    69,    70,    71,    72,    73,    74,    75,
2087       76,    77,    78,    79,    80,    20,     0,    21,     0,     0,
2088        0,     0,     0,     0,     0,     0,     0,     0,     0,    82,
2089      454,     0,    83,     0,     0,    84,     0,    85,     0,    65,
2090       66,    81,    67,    68,    69,    70,    71,    72,    73,    74,
2091       75,    76,    77,    78,    79,    80,    20,     0,    21,    65,
2092       66,     0,   117,    68,    69,    70,    71,    72,    73,    74,
2093       75,    76,    77,    78,    79,    80,    20,     0,    21,     0,
2094        0,     0,    81,     0,     0,     0,    82,     0,     0,    83,
2095        0,     0,    84,     0,    85,     0,     0,     0,     0,     0,
2096        0,     0,    81,     0,    65,    66,     0,   117,   200,   201,
2097      202,   203,   204,   205,   206,   207,   208,   209,   210,    79,
2098       80,    20,     0,    21,     0,     0,     0,     0,     0,     0,
2099        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2100       82,     0,     0,    83,     0,     0,    84,    81,    85,    65,
2101       66,     0,   227,    68,    69,    70,    71,    72,    73,    74,
2102       75,    76,    77,    78,    79,    80,    20,     0,    21,     0,
2103        0,     0,     0,     0,   124,     0,     0,     0,     0,     0,
2104        0,    82,     0,     0,    83,     0,     0,    84,   125,    85,
2105        0,     0,    81,     0,     0,     0,     0,     0,   126,   127,
2106        0,    82,     0,     0,    83,     0,     0,    84,     0,    85,
2107        0,   128,   129,   130,   131,   132,   133,   134,   135,   136,
2108      137,   138,   139,   140,   141,   142,   143,   144,   145,   146,
2109      147,   148,   149,   150,   151,   152,   153,     0,     0,     0,
2110        0,     0,     0,     0,     0,     0,    82,     0,     0,    83,
2111        0,     0,    84,     0,    85,     0,     0,   154,   155,   156,
2112        0,     0,   157,   158,   159,   160,   161,   162,   163,   164,
2113      165,   166,   167,   168,   169,   170,   171,   172,   173,   174,
2114      175,   176,   177,   178,     0,     0,     0,     0,     0,     0,
2115        0,    82,     0,     0,    83,     0,     0,    84,     0,    85
2116 };
2117
2118 static const short int yycheck[] =
2119 {
2120       37,   125,    53,   130,   128,   130,     3,   272,    15,   293,
2121      294,    29,   154,    15,    34,   157,    53,   131,   112,    85,
2122       10,    11,    12,    13,    14,    15,    16,    17,    23,   531,
2123      313,   314,   156,     9,   550,    30,   146,    57,   146,   323,
2124        0,    45,   152,    47,    41,    21,   562,   171,   156,   551,
2125       57,   175,   176,   177,   178,    57,   122,    20,   182,   183,
2126      343,    10,    11,    12,    13,    14,    15,    16,    17,     0,
2127      146,   185,   109,   110,   111,   146,   152,    61,    41,    42,
2128       43,    44,    45,    46,    47,   156,   148,    50,   125,   146,
2129       87,   128,    27,    28,    25,   157,   152,   154,   146,    23,
2130       31,   157,    52,    53,    54,   145,   154,    55,    56,    57,
2131       41,    42,    43,    44,    45,    46,    47,   154,   155,   156,
2132      157,    71,    10,    11,    12,    13,    14,    15,    16,    17,
2133      145,    62,    61,   170,   171,    32,    33,   155,   175,   176,
2134      177,   178,   179,   180,   181,   182,   183,    22,    24,    24,
2135      216,   217,   218,   437,    64,    65,    66,    67,    68,    69,
2136       70,   156,   152,   121,   122,   289,    55,    56,     4,   104,
2137      105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
2138      115,   116,   117,   220,    27,    28,     3,     4,     3,     4,
2139      145,   242,     3,     4,     3,     4,     3,     4,   145,   145,
2140      465,     4,   467,   152,   145,   242,    98,    99,   100,   101,
2141      102,   103,   104,   105,   106,   107,   253,   150,   148,     4,
2142        4,   148,    24,     4,    24,    24,   151,    59,   151,   148,
2143        4,     4,     4,   270,     4,   146,   287,   361,     7,   363,
2144      364,   365,     7,     4,     7,   149,   370,   146,   146,   150,
2145      287,   288,   289,   146,    36,   146,   146,    24,    24,   146,
2146      146,   146,   146,   146,   146,    63,   332,   148,   148,   148,
2147      214,   148,   150,    24,   148,   148,   148,   148,   148,   148,
2148      224,   149,   146,   146,   146,   229,   230,   381,   382,   383,
2149      384,   385,   146,   146,   146,   146,    34,   241,   148,   393,
2150      394,   395,   396,   397,   148,    21,    21,   148,   229,   230,
2151        4,   146,   146,   146,    24,   146,   146,   146,     4,    36,
2152      241,   148,   146,   146,   361,   362,   363,   364,   365,    57,
2153      274,   328,   369,   370,   146,   149,   146,     4,   282,   283,
2154      284,   146,   146,    24,   438,   439,    57,    21,   472,   473,
2155      474,   445,   146,   274,   146,   146,   146,   146,   146,   146,
2156      146,   282,   283,   284,    36,    21,   403,   146,    21,   152,
2157      150,   149,   149,   149,   149,   146,    76,    21,   146,    21,
2158      417,    41,   146,    97,   508,    97,   306,   149,    97,   149,
2159      149,   149,   486,   487,   488,   489,   433,   491,   492,   493,
2160      152,   495,   149,   149,   531,   149,   531,   351,   352,   353,
2161      149,   146,   149,   146,    97,   359,    25,    97,   404,   122,
2162       52,   214,   516,   517,   551,   462,   551,   371,   372,   403,
2163      351,   352,   353,    61,     3,   472,   473,   474,   359,   305,
2164       19,   478,   417,   478,   440,   539,    -1,   541,   542,    -1,
2165      371,   372,    -1,    -1,    -1,    -1,    -1,   494,    -1,    -1,
2166       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2167      414,   508,   416,    -1,    -1,    -1,   420,    -1,    -1,    -1,
2168       -1,    -1,   426,   427,   428,    -1,    -1,    -1,    -1,    -1,
2169       -1,    -1,    -1,   414,    -1,   416,    -1,    -1,    -1,   420,
2170       -1,    -1,    -1,    -1,    -1,   426,   427,   428,    -1,    -1,
2171       -1,    -1,    -1,    -1,    -1,    -1,   460,   461,    -1,   463,
2172      464,    -1,    -1,    -1,    -1,    -1,   470,    -1,    -1,    -1,
2173       -1,    -1,    -1,    -1,    -1,   479,    -1,    -1,    -1,   460,
2174      461,    -1,   463,   464,    -1,    -1,    -1,    -1,    20,   470,
2175       22,    -1,    24,    -1,    -1,    -1,    -1,    -1,   479,    31,
2176       32,    33,    -1,    -1,    -1,    -1,   510,    -1,    -1,    41,
2177       42,    43,    44,    45,    46,    47,    -1,    -1,    50,    51,
2178       -1,    -1,     5,     6,    -1,    -1,    58,    -1,    -1,   510,
2179       62,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    22,
2180       -1,    24,    -1,    26,   548,    -1,    -1,    -1,    -1,    -1,
2181       -1,    -1,    -1,    -1,    -1,    38,    39,    -1,    -1,   563,
2182       -1,    -1,    -1,    -1,    -1,    -1,   570,   548,    -1,    -1,
2183      574,   575,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2184       -1,    -1,   563,    -1,    -1,    -1,    -1,    -1,    -1,   570,
2185       -1,    -1,    -1,   574,   575,    78,    79,    80,    81,    82,
2186       83,    84,    85,    86,    87,    88,    89,    90,    91,    92,
2187       93,    94,    95,    96,    97,     5,     6,    -1,     8,     9,
2188       10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
2189       20,    21,    22,    -1,    24,    -1,    -1,    -1,    -1,    -1,
2190      123,   124,   125,   126,   127,   128,   129,   130,   131,   132,
2191      133,   134,   135,    -1,   137,   138,   139,   140,    48,   142,
2192      143,   144,    -1,    -1,    -1,    -1,    -1,   150,    -1,    -1,
2193      153,    -1,   155,     5,     6,   158,     8,     9,    10,    11,
2194       12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
2195       22,    -1,    24,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2196       -1,    -1,    -1,    -1,    -1,    -1,     3,     4,     5,     6,
2197        7,    -1,    -1,    -1,    -1,    -1,    48,    -1,    -1,    -1,
2198       -1,    -1,    -1,    -1,    -1,    22,    -1,    24,    -1,    26,
2199       27,    28,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2200       -1,    38,    39,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2201       -1,    -1,    -1,    -1,    -1,    -1,    -1,   147,    -1,    -1,
2202      150,    -1,    -1,   153,    61,   155,   156,    -1,    -1,    -1,
2203       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2204       -1,    78,    79,    80,    81,    82,    83,    84,    85,    86,
2205       87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
2206       97,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2207       -1,    -1,    -1,    -1,    -1,   147,    -1,    -1,   150,    -1,
2208       -1,   153,    -1,   155,   156,    -1,   123,   124,   125,   126,
2209      127,   128,   129,   130,   131,   132,   133,   134,   135,    -1,
2210      137,   138,   139,   140,    -1,   142,   143,   144,     3,     4,
2211       -1,    -1,     7,    -1,    -1,    -1,   153,    -1,    -1,    -1,
2212       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2213       -1,    26,    27,    28,    -1,    -1,    -1,    -1,    -1,    -1,
2214       -1,    -1,    -1,    38,    39,    -1,    -1,    -1,    -1,    -1,
2215       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2216       -1,    -1,    -1,    -1,    -1,    -1,    61,    -1,    -1,    -1,
2217       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2218       -1,    -1,    -1,    78,    79,    80,    81,    82,    83,    84,
2219       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
2220       95,    96,    97,     5,     6,    -1,     8,     9,    10,    11,
2221       12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
2222       22,    -1,    24,    -1,    -1,    -1,    -1,    -1,   123,   124,
2223      125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
2224      135,    -1,   137,   138,   139,   140,    48,   142,   143,   144,
2225       -1,    -1,    -1,    -1,    -1,    -1,     5,     6,   153,     8,
2226        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
2227       19,    20,    21,    22,    -1,    24,    -1,    -1,    -1,    -1,
2228       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    37,    -1,
2229       -1,    -1,    -1,    -1,    -1,    -1,    -1,     5,     6,    48,
2230        8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
2231       18,    19,    20,    21,    22,    -1,    24,    -1,    -1,    -1,
2232       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    37,
2233       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2234       48,    -1,    -1,    -1,    -1,   147,    -1,    -1,   150,    -1,
2235      152,   153,    -1,   155,     5,     6,    -1,     8,     9,    10,
2236       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
2237       21,    22,    -1,    24,    -1,    -1,    -1,    -1,    -1,    -1,
2238       -1,    -1,    -1,    -1,    -1,    -1,    37,    -1,    -1,    -1,
2239       -1,    -1,    -1,    -1,    -1,    -1,    -1,    48,   147,    -1,
2240       -1,   150,    -1,    -1,   153,    -1,   155,    -1,     5,     6,
2241       -1,     8,     9,    10,    11,    12,    13,    14,    15,    16,
2242       17,    18,    19,    20,    21,    22,    -1,    24,    -1,    -1,
2243       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   147,
2244       37,    -1,   150,    -1,    -1,   153,    -1,   155,    -1,     5,
2245        6,    48,     8,     9,    10,    11,    12,    13,    14,    15,
2246       16,    17,    18,    19,    20,    21,    22,    -1,    24,     5,
2247        6,    -1,     8,     9,    10,    11,    12,    13,    14,    15,
2248       16,    17,    18,    19,    20,    21,    22,    -1,    24,    -1,
2249       -1,    -1,    48,    -1,    -1,    -1,   147,    -1,    -1,   150,
2250       -1,    -1,   153,    -1,   155,    -1,    -1,    -1,    -1,    -1,
2251       -1,    -1,    48,    -1,     5,     6,    -1,     8,     9,    10,
2252       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
2253       21,    22,    -1,    24,    -1,    -1,    -1,    -1,    -1,    -1,
2254       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2255      147,    -1,    -1,   150,    -1,    -1,   153,    48,   155,     5,
2256        6,    -1,     8,     9,    10,    11,    12,    13,    14,    15,
2257       16,    17,    18,    19,    20,    21,    22,    -1,    24,    -1,
2258       -1,    -1,    -1,    -1,    35,    -1,    -1,    -1,    -1,    -1,
2259       -1,   147,    -1,    -1,   150,    -1,    -1,   153,    49,   155,
2260       -1,    -1,    48,    -1,    -1,    -1,    -1,    -1,    59,    60,
2261       -1,   147,    -1,    -1,   150,    -1,    -1,   153,    -1,   155,
2262       -1,    72,    73,    74,    75,    76,    77,    78,    79,    80,
2263       81,    82,    83,    84,    85,    86,    87,    88,    89,    90,
2264       91,    92,    93,    94,    95,    96,    97,    -1,    -1,    -1,
2265       -1,    -1,    -1,    -1,    -1,    -1,   147,    -1,    -1,   150,
2266       -1,    -1,   153,    -1,   155,    -1,    -1,   118,   119,   120,
2267       -1,    -1,   123,   124,   125,   126,   127,   128,   129,   130,
2268      131,   132,   133,   134,   135,   136,   137,   138,   139,   140,
2269      141,   142,   143,   144,    -1,    -1,    -1,    -1,    -1,    -1,
2270       -1,   147,    -1,    -1,   150,    -1,    -1,   153,    -1,   155
2271 };
2272
2273 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2274    symbol of state STATE-NUM.  */
2275 static const unsigned char yystos[] =
2276 {
2277        0,   193,   194,   195,     0,    25,    31,    41,    42,    43,
2278       44,    45,    46,    47,    62,   174,   212,   214,   216,   223,
2279       22,    24,    51,    58,    62,   173,   205,   216,   217,    61,
2280       64,    65,    66,    67,    68,    69,    70,   175,   210,    23,
2281      224,   225,    30,   156,   213,   224,    52,    53,    54,    71,
2282      202,   145,    61,    20,    45,    47,    50,   174,   145,    45,
2283       47,   215,    24,   200,     4,     5,     6,     8,     9,    10,
2284       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
2285       21,    48,   147,   150,   153,   155,   160,   182,   183,   184,
2286      185,   186,   205,   220,    29,   155,   211,   173,   228,   145,
2287      145,   145,   145,   150,   203,   200,   182,    32,    33,   192,
2288      192,   192,   192,   210,     4,     4,     4,     8,   156,   186,
2289      187,   205,   148,   157,    35,    49,    59,    60,    72,    73,
2290       74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
2291       84,    85,    86,    87,    88,    89,    90,    91,    92,    93,
2292       94,    95,    96,    97,   118,   119,   120,   123,   124,   125,
2293      126,   127,   128,   129,   130,   131,   132,   133,   134,   135,
2294      136,   137,   138,   139,   140,   141,   142,   143,   144,   162,
2295      163,   164,   165,   166,   226,   232,   233,   235,   236,    24,
2296       55,    56,   201,     4,    24,    24,   204,   184,   184,   184,
2297        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
2298       19,   169,   170,   172,   184,   189,   151,   151,   146,   156,
2299      148,    37,   187,   188,   184,   222,    59,     8,   222,     9,
2300       21,    10,    11,    12,    13,    14,    15,    16,    17,   169,
2301      170,   171,   175,    98,    99,   100,   101,   102,   103,   104,
2302      105,   106,   107,   167,    27,    28,   104,   105,   106,   107,
2303      108,   109,   110,   111,   112,   113,   114,   115,   116,   117,
2304      168,   184,   184,   222,   184,   184,   229,   222,   222,   222,
2305      222,   222,   184,   184,   184,   222,   222,   175,   121,   122,
2306      146,   152,   198,   199,   197,    27,    28,     3,     4,   161,
2307        4,     7,    26,    38,    39,    96,    97,   123,   137,   142,
2308      143,   144,   150,   153,   155,   158,   162,   163,   164,   165,
2309      166,   190,   220,   196,   186,   186,   186,    37,   184,   207,
2310      208,   209,   146,   149,     3,     4,     7,    26,    27,    28,
2311       38,    39,    61,   153,   190,   219,   220,   221,   221,   221,
2312      221,   182,   184,   184,   146,   177,   146,   177,   221,   150,
2313      146,   146,   146,   146,   146,   146,   221,   221,   221,    36,
2314      146,   182,   184,   222,    24,   146,   180,   180,   180,   167,
2315      168,   148,   148,   148,   148,   148,   152,   189,   191,   191,
2316      156,   191,    24,   148,   148,   148,   148,   148,   180,   152,
2317      154,   205,   206,   146,   149,    37,    63,   218,   191,   146,
2318      146,   221,   221,   221,    15,    57,    15,   146,   234,   221,
2319      150,   222,   184,   222,   222,   222,   146,   146,   146,   184,
2320      222,   221,   221,   146,    34,    57,   178,   181,   148,   148,
2321      189,   189,   189,   189,   189,   146,   152,   154,   156,   189,
2322      189,   189,   189,   189,    37,   207,   178,   179,    24,   154,
2323       21,    21,   148,   146,   146,   221,     4,   221,   222,   230,
2324      146,   221,   146,   146,   146,   221,   221,   221,   148,   184,
2325       24,     4,   180,   189,   189,   234,   146,   146,   146,   146,
2326      189,   146,   146,   146,    36,   146,    57,   176,   146,   221,
2327      221,   230,   231,   221,   221,   146,   177,   177,   146,   221,
2328      146,   222,   222,   222,   231,   221,   146,   146,   149,   189,
2329      189,   189,   189,   189,   189,   189,   184,   189,     4,    24,
2330      146,   150,   149,   222,   152,   221,   149,   189,   189,   146,
2331      149,   146,   146,   149,   149,   149,   149,   149,    21,   152,
2332      171,   227,    36,   152,   149,   149,   189,   189,   189,   221,
2333      219,   152,   171,    21,   149,   149,   149,   146,   219,   221,
2334       21,   146,    76,   221,    21,    21,   221,   221
2335 };
2336
2337 #define yyerrok         (yyerrstatus = 0)
2338 #define yyclearin       (yychar = YYEMPTY)
2339 #define YYEMPTY         (-2)
2340 #define YYEOF           0
2341
2342 #define YYACCEPT        goto yyacceptlab
2343 #define YYABORT         goto yyabortlab
2344 #define YYERROR         goto yyerrorlab
2345
2346
2347 /* Like YYERROR except do call yyerror.  This remains here temporarily
2348    to ease the transition to the new meaning of YYERROR, for GCC.
2349    Once GCC version 2 has supplanted version 1, this can go.  */
2350
2351 #define YYFAIL          goto yyerrlab
2352
2353 #define YYRECOVERING()  (!!yyerrstatus)
2354
2355 #define YYBACKUP(Token, Value)                                  \
2356 do                                                              \
2357   if (yychar == YYEMPTY && yylen == 1)                          \
2358     {                                                           \
2359       yychar = (Token);                                         \
2360       yylval = (Value);                                         \
2361       yytoken = YYTRANSLATE (yychar);                           \
2362       YYPOPSTACK;                                               \
2363       goto yybackup;                                            \
2364     }                                                           \
2365   else                                                          \
2366     {                                                           \
2367       yyerror (YY_("syntax error: cannot back up")); \
2368       YYERROR;                                                  \
2369     }                                                           \
2370 while (0)
2371
2372
2373 #define YYTERROR        1
2374 #define YYERRCODE       256
2375
2376
2377 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2378    If N is 0, then set CURRENT to the empty location which ends
2379    the previous symbol: RHS[0] (always defined).  */
2380
2381 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2382 #ifndef YYLLOC_DEFAULT
2383 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
2384     do                                                                  \
2385       if (N)                                                            \
2386         {                                                               \
2387           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
2388           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
2389           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
2390           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
2391         }                                                               \
2392       else                                                              \
2393         {                                                               \
2394           (Current).first_line   = (Current).last_line   =              \
2395             YYRHSLOC (Rhs, 0).last_line;                                \
2396           (Current).first_column = (Current).last_column =              \
2397             YYRHSLOC (Rhs, 0).last_column;                              \
2398         }                                                               \
2399     while (0)
2400 #endif
2401
2402
2403 /* YY_LOCATION_PRINT -- Print the location on the stream.
2404    This macro was not mandated originally: define only if we know
2405    we won't break user code: when these are the locations we know.  */
2406
2407 #ifndef YY_LOCATION_PRINT
2408 # if YYLTYPE_IS_TRIVIAL
2409 #  define YY_LOCATION_PRINT(File, Loc)                  \
2410      fprintf (File, "%d.%d-%d.%d",                      \
2411               (Loc).first_line, (Loc).first_column,     \
2412               (Loc).last_line,  (Loc).last_column)
2413 # else
2414 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2415 # endif
2416 #endif
2417
2418
2419 /* YYLEX -- calling `yylex' with the right arguments.  */
2420
2421 #ifdef YYLEX_PARAM
2422 # define YYLEX yylex (YYLEX_PARAM)
2423 #else
2424 # define YYLEX yylex ()
2425 #endif
2426
2427 /* Enable debugging if requested.  */
2428 #if YYDEBUG
2429
2430 # ifndef YYFPRINTF
2431 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2432 #  define YYFPRINTF fprintf
2433 # endif
2434
2435 # define YYDPRINTF(Args)                        \
2436 do {                                            \
2437   if (yydebug)                                  \
2438     YYFPRINTF Args;                             \
2439 } while (0)
2440
2441 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)          \
2442 do {                                                            \
2443   if (yydebug)                                                  \
2444     {                                                           \
2445       YYFPRINTF (stderr, "%s ", Title);                         \
2446       yysymprint (stderr,                                       \
2447                   Type, Value); \
2448       YYFPRINTF (stderr, "\n");                                 \
2449     }                                                           \
2450 } while (0)
2451
2452 /*------------------------------------------------------------------.
2453 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2454 | TOP (included).                                                   |
2455 `------------------------------------------------------------------*/
2456
2457 #if defined (__STDC__) || defined (__cplusplus)
2458 static void
2459 yy_stack_print (short int *bottom, short int *top)
2460 #else
2461 static void
2462 yy_stack_print (bottom, top)
2463     short int *bottom;
2464     short int *top;
2465 #endif
2466 {
2467   YYFPRINTF (stderr, "Stack now");
2468   for (/* Nothing. */; bottom <= top; ++bottom)
2469     YYFPRINTF (stderr, " %d", *bottom);
2470   YYFPRINTF (stderr, "\n");
2471 }
2472
2473 # define YY_STACK_PRINT(Bottom, Top)                            \
2474 do {                                                            \
2475   if (yydebug)                                                  \
2476     yy_stack_print ((Bottom), (Top));                           \
2477 } while (0)
2478
2479
2480 /*------------------------------------------------.
2481 | Report that the YYRULE is going to be reduced.  |
2482 `------------------------------------------------*/
2483
2484 #if defined (__STDC__) || defined (__cplusplus)
2485 static void
2486 yy_reduce_print (int yyrule)
2487 #else
2488 static void
2489 yy_reduce_print (yyrule)
2490     int yyrule;
2491 #endif
2492 {
2493   int yyi;
2494   unsigned long int yylno = yyrline[yyrule];
2495   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
2496              yyrule - 1, yylno);
2497   /* Print the symbols being reduced, and their result.  */
2498   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
2499     YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
2500   YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
2501 }
2502
2503 # define YY_REDUCE_PRINT(Rule)          \
2504 do {                                    \
2505   if (yydebug)                          \
2506     yy_reduce_print (Rule);             \
2507 } while (0)
2508
2509 /* Nonzero means print parse trace.  It is left uninitialized so that
2510    multiple parsers can coexist.  */
2511 int yydebug;
2512 #else /* !YYDEBUG */
2513 # define YYDPRINTF(Args)
2514 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2515 # define YY_STACK_PRINT(Bottom, Top)
2516 # define YY_REDUCE_PRINT(Rule)
2517 #endif /* !YYDEBUG */
2518
2519
2520 /* YYINITDEPTH -- initial size of the parser's stacks.  */
2521 #ifndef YYINITDEPTH
2522 # define YYINITDEPTH 200
2523 #endif
2524
2525 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2526    if the built-in stack extension method is used).
2527
2528    Do not make this value too large; the results are undefined if
2529    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2530    evaluated with infinite-precision integer arithmetic.  */
2531
2532 #ifndef YYMAXDEPTH
2533 # define YYMAXDEPTH 10000
2534 #endif
2535
2536 \f
2537
2538 #if YYERROR_VERBOSE
2539
2540 # ifndef yystrlen
2541 #  if defined (__GLIBC__) && defined (_STRING_H)
2542 #   define yystrlen strlen
2543 #  else
2544 /* Return the length of YYSTR.  */
2545 static YYSIZE_T
2546 #   if defined (__STDC__) || defined (__cplusplus)
2547 yystrlen (const char *yystr)
2548 #   else
2549 yystrlen (yystr)
2550      const char *yystr;
2551 #   endif
2552 {
2553   const char *yys = yystr;
2554
2555   while (*yys++ != '\0')
2556     continue;
2557
2558   return yys - yystr - 1;
2559 }
2560 #  endif
2561 # endif
2562
2563 # ifndef yystpcpy
2564 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2565 #   define yystpcpy stpcpy
2566 #  else
2567 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2568    YYDEST.  */
2569 static char *
2570 #   if defined (__STDC__) || defined (__cplusplus)
2571 yystpcpy (char *yydest, const char *yysrc)
2572 #   else
2573 yystpcpy (yydest, yysrc)
2574      char *yydest;
2575      const char *yysrc;
2576 #   endif
2577 {
2578   char *yyd = yydest;
2579   const char *yys = yysrc;
2580
2581   while ((*yyd++ = *yys++) != '\0')
2582     continue;
2583
2584   return yyd - 1;
2585 }
2586 #  endif
2587 # endif
2588
2589 # ifndef yytnamerr
2590 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2591    quotes and backslashes, so that it's suitable for yyerror.  The
2592    heuristic is that double-quoting is unnecessary unless the string
2593    contains an apostrophe, a comma, or backslash (other than
2594    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
2595    null, do not copy; instead, return the length of what the result
2596    would have been.  */
2597 static YYSIZE_T
2598 yytnamerr (char *yyres, const char *yystr)
2599 {
2600   if (*yystr == '"')
2601     {
2602       size_t yyn = 0;
2603       char const *yyp = yystr;
2604
2605       for (;;)
2606         switch (*++yyp)
2607           {
2608           case '\'':
2609           case ',':
2610             goto do_not_strip_quotes;
2611
2612           case '\\':
2613             if (*++yyp != '\\')
2614               goto do_not_strip_quotes;
2615             /* Fall through.  */
2616           default:
2617             if (yyres)
2618               yyres[yyn] = *yyp;
2619             yyn++;
2620             break;
2621
2622           case '"':
2623             if (yyres)
2624               yyres[yyn] = '\0';
2625             return yyn;
2626           }
2627     do_not_strip_quotes: ;
2628     }
2629
2630   if (! yyres)
2631     return yystrlen (yystr);
2632
2633   return yystpcpy (yyres, yystr) - yyres;
2634 }
2635 # endif
2636
2637 #endif /* YYERROR_VERBOSE */
2638
2639 \f
2640
2641 #if YYDEBUG
2642 /*--------------------------------.
2643 | Print this symbol on YYOUTPUT.  |
2644 `--------------------------------*/
2645
2646 #if defined (__STDC__) || defined (__cplusplus)
2647 static void
2648 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2649 #else
2650 static void
2651 yysymprint (yyoutput, yytype, yyvaluep)
2652     FILE *yyoutput;
2653     int yytype;
2654     YYSTYPE *yyvaluep;
2655 #endif
2656 {
2657   /* Pacify ``unused variable'' warnings.  */
2658   (void) yyvaluep;
2659
2660   if (yytype < YYNTOKENS)
2661     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2662   else
2663     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2664
2665
2666 # ifdef YYPRINT
2667   if (yytype < YYNTOKENS)
2668     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2669 # endif
2670   switch (yytype)
2671     {
2672       default:
2673         break;
2674     }
2675   YYFPRINTF (yyoutput, ")");
2676 }
2677
2678 #endif /* ! YYDEBUG */
2679 /*-----------------------------------------------.
2680 | Release the memory associated to this symbol.  |
2681 `-----------------------------------------------*/
2682
2683 #if defined (__STDC__) || defined (__cplusplus)
2684 static void
2685 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2686 #else
2687 static void
2688 yydestruct (yymsg, yytype, yyvaluep)
2689     const char *yymsg;
2690     int yytype;
2691     YYSTYPE *yyvaluep;
2692 #endif
2693 {
2694   /* Pacify ``unused variable'' warnings.  */
2695   (void) yyvaluep;
2696
2697   if (!yymsg)
2698     yymsg = "Deleting";
2699   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2700
2701   switch (yytype)
2702     {
2703
2704       default:
2705         break;
2706     }
2707 }
2708 \f
2709
2710 /* Prevent warnings from -Wmissing-prototypes.  */
2711
2712 #ifdef YYPARSE_PARAM
2713 # if defined (__STDC__) || defined (__cplusplus)
2714 int yyparse (void *YYPARSE_PARAM);
2715 # else
2716 int yyparse ();
2717 # endif
2718 #else /* ! YYPARSE_PARAM */
2719 #if defined (__STDC__) || defined (__cplusplus)
2720 int yyparse (void);
2721 #else
2722 int yyparse ();
2723 #endif
2724 #endif /* ! YYPARSE_PARAM */
2725
2726
2727
2728 /* The look-ahead symbol.  */
2729 int yychar;
2730
2731 /* The semantic value of the look-ahead symbol.  */
2732 YYSTYPE yylval;
2733
2734 /* Number of syntax errors so far.  */
2735 int yynerrs;
2736
2737
2738
2739 /*----------.
2740 | yyparse.  |
2741 `----------*/
2742
2743 #ifdef YYPARSE_PARAM
2744 # if defined (__STDC__) || defined (__cplusplus)
2745 int yyparse (void *YYPARSE_PARAM)
2746 # else
2747 int yyparse (YYPARSE_PARAM)
2748   void *YYPARSE_PARAM;
2749 # endif
2750 #else /* ! YYPARSE_PARAM */
2751 #if defined (__STDC__) || defined (__cplusplus)
2752 int
2753 yyparse (void)
2754 #else
2755 int
2756 yyparse ()
2757
2758 #endif
2759 #endif
2760 {
2761   
2762   int yystate;
2763   int yyn;
2764   int yyresult;
2765   /* Number of tokens to shift before error messages enabled.  */
2766   int yyerrstatus;
2767   /* Look-ahead token as an internal (translated) token number.  */
2768   int yytoken = 0;
2769
2770   /* Three stacks and their tools:
2771      `yyss': related to states,
2772      `yyvs': related to semantic values,
2773      `yyls': related to locations.
2774
2775      Refer to the stacks thru separate pointers, to allow yyoverflow
2776      to reallocate them elsewhere.  */
2777
2778   /* The state stack.  */
2779   short int yyssa[YYINITDEPTH];
2780   short int *yyss = yyssa;
2781   short int *yyssp;
2782
2783   /* The semantic value stack.  */
2784   YYSTYPE yyvsa[YYINITDEPTH];
2785   YYSTYPE *yyvs = yyvsa;
2786   YYSTYPE *yyvsp;
2787
2788
2789
2790 #define YYPOPSTACK   (yyvsp--, yyssp--)
2791
2792   YYSIZE_T yystacksize = YYINITDEPTH;
2793
2794   /* The variables used to return semantic value and location from the
2795      action routines.  */
2796   YYSTYPE yyval;
2797
2798
2799   /* When reducing, the number of symbols on the RHS of the reduced
2800      rule.  */
2801   int yylen;
2802
2803   YYDPRINTF ((stderr, "Starting parse\n"));
2804
2805   yystate = 0;
2806   yyerrstatus = 0;
2807   yynerrs = 0;
2808   yychar = YYEMPTY;             /* Cause a token to be read.  */
2809
2810   /* Initialize stack pointers.
2811      Waste one element of value and location stack
2812      so that they stay on the same level as the state stack.
2813      The wasted elements are never initialized.  */
2814
2815   yyssp = yyss;
2816   yyvsp = yyvs;
2817
2818   goto yysetstate;
2819
2820 /*------------------------------------------------------------.
2821 | yynewstate -- Push a new state, which is found in yystate.  |
2822 `------------------------------------------------------------*/
2823  yynewstate:
2824   /* In all cases, when you get here, the value and location stacks
2825      have just been pushed. so pushing a state here evens the stacks.
2826      */
2827   yyssp++;
2828
2829  yysetstate:
2830   *yyssp = yystate;
2831
2832   if (yyss + yystacksize - 1 <= yyssp)
2833     {
2834       /* Get the current used size of the three stacks, in elements.  */
2835       YYSIZE_T yysize = yyssp - yyss + 1;
2836
2837 #ifdef yyoverflow
2838       {
2839         /* Give user a chance to reallocate the stack. Use copies of
2840            these so that the &'s don't force the real ones into
2841            memory.  */
2842         YYSTYPE *yyvs1 = yyvs;
2843         short int *yyss1 = yyss;
2844
2845
2846         /* Each stack pointer address is followed by the size of the
2847            data in use in that stack, in bytes.  This used to be a
2848            conditional around just the two extra args, but that might
2849            be undefined if yyoverflow is a macro.  */
2850         yyoverflow (YY_("memory exhausted"),
2851                     &yyss1, yysize * sizeof (*yyssp),
2852                     &yyvs1, yysize * sizeof (*yyvsp),
2853
2854                     &yystacksize);
2855
2856         yyss = yyss1;
2857         yyvs = yyvs1;
2858       }
2859 #else /* no yyoverflow */
2860 # ifndef YYSTACK_RELOCATE
2861       goto yyexhaustedlab;
2862 # else
2863       /* Extend the stack our own way.  */
2864       if (YYMAXDEPTH <= yystacksize)
2865         goto yyexhaustedlab;
2866       yystacksize *= 2;
2867       if (YYMAXDEPTH < yystacksize)
2868         yystacksize = YYMAXDEPTH;
2869
2870       {
2871         short int *yyss1 = yyss;
2872         union yyalloc *yyptr =
2873           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2874         if (! yyptr)
2875           goto yyexhaustedlab;
2876         YYSTACK_RELOCATE (yyss);
2877         YYSTACK_RELOCATE (yyvs);
2878
2879 #  undef YYSTACK_RELOCATE
2880         if (yyss1 != yyssa)
2881           YYSTACK_FREE (yyss1);
2882       }
2883 # endif
2884 #endif /* no yyoverflow */
2885
2886       yyssp = yyss + yysize - 1;
2887       yyvsp = yyvs + yysize - 1;
2888
2889
2890       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2891                   (unsigned long int) yystacksize));
2892
2893       if (yyss + yystacksize - 1 <= yyssp)
2894         YYABORT;
2895     }
2896
2897   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2898
2899   goto yybackup;
2900
2901 /*-----------.
2902 | yybackup.  |
2903 `-----------*/
2904 yybackup:
2905
2906 /* Do appropriate processing given the current state.  */
2907 /* Read a look-ahead token if we need one and don't already have one.  */
2908 /* yyresume: */
2909
2910   /* First try to decide what to do without reference to look-ahead token.  */
2911
2912   yyn = yypact[yystate];
2913   if (yyn == YYPACT_NINF)
2914     goto yydefault;
2915
2916   /* Not known => get a look-ahead token if don't already have one.  */
2917
2918   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
2919   if (yychar == YYEMPTY)
2920     {
2921       YYDPRINTF ((stderr, "Reading a token: "));
2922       yychar = YYLEX;
2923     }
2924
2925   if (yychar <= YYEOF)
2926     {
2927       yychar = yytoken = YYEOF;
2928       YYDPRINTF ((stderr, "Now at end of input.\n"));
2929     }
2930   else
2931     {
2932       yytoken = YYTRANSLATE (yychar);
2933       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2934     }
2935
2936   /* If the proper action on seeing token YYTOKEN is to reduce or to
2937      detect an error, take that action.  */
2938   yyn += yytoken;
2939   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2940     goto yydefault;
2941   yyn = yytable[yyn];
2942   if (yyn <= 0)
2943     {
2944       if (yyn == 0 || yyn == YYTABLE_NINF)
2945         goto yyerrlab;
2946       yyn = -yyn;
2947       goto yyreduce;
2948     }
2949
2950   if (yyn == YYFINAL)
2951     YYACCEPT;
2952
2953   /* Shift the look-ahead token.  */
2954   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2955
2956   /* Discard the token being shifted unless it is eof.  */
2957   if (yychar != YYEOF)
2958     yychar = YYEMPTY;
2959
2960   *++yyvsp = yylval;
2961
2962
2963   /* Count tokens shifted since error; after three, turn off error
2964      status.  */
2965   if (yyerrstatus)
2966     yyerrstatus--;
2967
2968   yystate = yyn;
2969   goto yynewstate;
2970
2971
2972 /*-----------------------------------------------------------.
2973 | yydefault -- do the default action for the current state.  |
2974 `-----------------------------------------------------------*/
2975 yydefault:
2976   yyn = yydefact[yystate];
2977   if (yyn == 0)
2978     goto yyerrlab;
2979   goto yyreduce;
2980
2981
2982 /*-----------------------------.
2983 | yyreduce -- Do a reduction.  |
2984 `-----------------------------*/
2985 yyreduce:
2986   /* yyn is the number of a rule to reduce with.  */
2987   yylen = yyr2[yyn];
2988
2989   /* If YYLEN is nonzero, implement the default value of the action:
2990      `$$ = $1'.
2991
2992      Otherwise, the following line sets YYVAL to garbage.
2993      This behavior is undocumented and Bison
2994      users should not rely upon it.  Assigning to YYVAL
2995      unconditionally makes the parser a bit smaller, and it avoids a
2996      GCC warning that YYVAL may be used uninitialized.  */
2997   yyval = yyvsp[1-yylen];
2998
2999
3000   YY_REDUCE_PRINT (yyn);
3001   switch (yyn)
3002     {
3003         case 3:
3004 #line 991 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3005     {
3006   if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX)     // Outside of my range!
3007     GEN_ERROR("Value too large for type!");
3008   (yyval.SIntVal) = (int32_t)(yyvsp[0].UIntVal);
3009   CHECK_FOR_ERROR
3010 ;}
3011     break;
3012
3013   case 5:
3014 #line 1000 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3015     {
3016   if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX)     // Outside of my range!
3017     GEN_ERROR("Value too large for type!");
3018   (yyval.SInt64Val) = (int64_t)(yyvsp[0].UInt64Val);
3019   CHECK_FOR_ERROR
3020 ;}
3021     break;
3022
3023   case 39:
3024 #line 1017 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3025     { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3026     break;
3027
3028   case 40:
3029 #line 1017 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3030     { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3031     break;
3032
3033   case 41:
3034 #line 1018 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3035     { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3036     break;
3037
3038   case 42:
3039 #line 1018 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3040     { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3041     break;
3042
3043   case 43:
3044 #line 1019 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3045     { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3046     break;
3047
3048   case 44:
3049 #line 1019 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3050     { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3051     break;
3052
3053   case 45:
3054 #line 1020 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3055     { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3056     break;
3057
3058   case 46:
3059 #line 1020 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3060     { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3061     break;
3062
3063   case 47:
3064 #line 1021 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3065     { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3066     break;
3067
3068   case 48:
3069 #line 1021 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3070     { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3071     break;
3072
3073   case 49:
3074 #line 1025 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3075     { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3076     break;
3077
3078   case 50:
3079 #line 1025 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3080     { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3081     break;
3082
3083   case 51:
3084 #line 1026 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3085     { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3086     break;
3087
3088   case 52:
3089 #line 1026 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3090     { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3091     break;
3092
3093   case 53:
3094 #line 1027 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3095     { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3096     break;
3097
3098   case 54:
3099 #line 1027 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3100     { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3101     break;
3102
3103   case 55:
3104 #line 1028 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3105     { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3106     break;
3107
3108   case 56:
3109 #line 1028 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3110     { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3111     break;
3112
3113   case 57:
3114 #line 1029 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3115     { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3116     break;
3117
3118   case 58:
3119 #line 1029 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3120     { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3121     break;
3122
3123   case 59:
3124 #line 1030 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3125     { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3126     break;
3127
3128   case 60:
3129 #line 1030 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3130     { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3131     break;
3132
3133   case 61:
3134 #line 1031 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3135     { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3136     break;
3137
3138   case 62:
3139 #line 1031 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3140     { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3141     break;
3142
3143   case 63:
3144 #line 1032 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3145     { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3146     break;
3147
3148   case 64:
3149 #line 1033 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3150     { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3151     break;
3152
3153   case 77:
3154 #line 1044 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3155     {
3156     (yyval.StrVal) = (yyvsp[-1].StrVal);
3157     CHECK_FOR_ERROR
3158   ;}
3159     break;
3160
3161   case 78:
3162 #line 1048 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3163     {
3164     (yyval.StrVal) = 0;
3165     CHECK_FOR_ERROR
3166   ;}
3167     break;
3168
3169   case 79:
3170 #line 1053 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3171     { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3172     break;
3173
3174   case 80:
3175 #line 1054 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3176     { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3177     break;
3178
3179   case 81:
3180 #line 1055 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3181     { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3182     break;
3183
3184   case 82:
3185 #line 1056 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3186     { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3187     break;
3188
3189   case 83:
3190 #line 1057 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3191     { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3192     break;
3193
3194   case 84:
3195 #line 1058 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3196     { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3197     break;
3198
3199   case 85:
3200 #line 1059 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3201     { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3202     break;
3203
3204   case 86:
3205 #line 1060 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3206     { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3207     break;
3208
3209   case 87:
3210 #line 1062 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3211     { (yyval.UIntVal) = CallingConv::C; ;}
3212     break;
3213
3214   case 88:
3215 #line 1063 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3216     { (yyval.UIntVal) = CallingConv::C; ;}
3217     break;
3218
3219   case 89:
3220 #line 1064 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3221     { (yyval.UIntVal) = CallingConv::CSRet; ;}
3222     break;
3223
3224   case 90:
3225 #line 1065 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3226     { (yyval.UIntVal) = CallingConv::Fast; ;}
3227     break;
3228
3229   case 91:
3230 #line 1066 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3231     { (yyval.UIntVal) = CallingConv::Cold; ;}
3232     break;
3233
3234   case 92:
3235 #line 1067 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3236     { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3237     break;
3238
3239   case 93:
3240 #line 1068 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3241     { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3242     break;
3243
3244   case 94:
3245 #line 1069 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3246     {
3247                    if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val))
3248                      GEN_ERROR("Calling conv too large!");
3249                    (yyval.UIntVal) = (yyvsp[0].UInt64Val);
3250                   CHECK_FOR_ERROR
3251                  ;}
3252     break;
3253
3254   case 95:
3255 #line 1078 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3256     { (yyval.UIntVal) = 0; ;}
3257     break;
3258
3259   case 96:
3260 #line 1079 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3261     {
3262   (yyval.UIntVal) = (yyvsp[0].UInt64Val);
3263   if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
3264     GEN_ERROR("Alignment must be a power of two!");
3265   CHECK_FOR_ERROR
3266 ;}
3267     break;
3268
3269   case 97:
3270 #line 1085 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3271     { (yyval.UIntVal) = 0; ;}
3272     break;
3273
3274   case 98:
3275 #line 1086 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3276     {
3277   (yyval.UIntVal) = (yyvsp[0].UInt64Val);
3278   if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
3279     GEN_ERROR("Alignment must be a power of two!");
3280   CHECK_FOR_ERROR
3281 ;}
3282     break;
3283
3284   case 99:
3285 #line 1094 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3286     {
3287   for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i)
3288     if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\')
3289       GEN_ERROR("Invalid character in section name!");
3290   (yyval.StrVal) = (yyvsp[0].StrVal);
3291   CHECK_FOR_ERROR
3292 ;}
3293     break;
3294
3295   case 100:
3296 #line 1102 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3297     { (yyval.StrVal) = 0; ;}
3298     break;
3299
3300   case 101:
3301 #line 1103 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3302     { (yyval.StrVal) = (yyvsp[0].StrVal); ;}
3303     break;
3304
3305   case 102:
3306 #line 1108 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3307     {;}
3308     break;
3309
3310   case 103:
3311 #line 1109 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3312     {;}
3313     break;
3314
3315   case 104:
3316 #line 1110 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3317     {
3318     CurGV->setSection((yyvsp[0].StrVal));
3319     free((yyvsp[0].StrVal));
3320     CHECK_FOR_ERROR
3321   ;}
3322     break;
3323
3324   case 105:
3325 #line 1115 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3326     {
3327     if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val)))
3328       GEN_ERROR("Alignment must be a power of two!");
3329     CurGV->setAlignment((yyvsp[0].UInt64Val));
3330     CHECK_FOR_ERROR
3331   ;}
3332     break;
3333
3334   case 107:
3335 #line 1129 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3336     { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;}
3337     break;
3338
3339   case 109:
3340 #line 1130 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3341     { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;}
3342     break;
3343
3344   case 110:
3345 #line 1132 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3346     {
3347     if (!UpRefs.empty())
3348       GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription());
3349     (yyval.TypeVal) = (yyvsp[0].TypeVal);
3350     CHECK_FOR_ERROR
3351   ;}
3352     break;
3353
3354   case 124:
3355 #line 1144 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3356     {
3357     (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
3358     CHECK_FOR_ERROR
3359   ;}
3360     break;
3361
3362   case 125:
3363 #line 1148 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3364     {
3365     (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType));
3366     CHECK_FOR_ERROR
3367   ;}
3368     break;
3369
3370   case 126:
3371 #line 1152 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3372     {            // Named types are also simple types...
3373   const Type* tmp = getTypeVal((yyvsp[0].ValIDVal));
3374   CHECK_FOR_ERROR
3375   (yyval.TypeVal) = new PATypeHolder(tmp);
3376 ;}
3377     break;
3378
3379   case 127:
3380 #line 1160 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3381     {                   // Type UpReference
3382     if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range!");
3383     OpaqueType *OT = OpaqueType::get();        // Use temporary placeholder
3384     UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[0].UInt64Val), OT));  // Add to vector...
3385     (yyval.TypeVal) = new PATypeHolder(OT);
3386     UR_OUT("New Upreference!\n");
3387     CHECK_FOR_ERROR
3388   ;}
3389     break;
3390
3391   case 128:
3392 #line 1168 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3393     {           // Function derived type?
3394     std::vector<const Type*> Params;
3395     for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[-1].TypeList)->begin(),
3396            E = (yyvsp[-1].TypeList)->end(); I != E; ++I)
3397       Params.push_back(*I);
3398     bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
3399     if (isVarArg) Params.pop_back();
3400
3401     (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FunctionType::get(*(yyvsp[-3].TypeVal),Params,isVarArg)));
3402     delete (yyvsp[-1].TypeList);      // Delete the argument list
3403     delete (yyvsp[-3].TypeVal);      // Delete the return type handle
3404     CHECK_FOR_ERROR
3405   ;}
3406     break;
3407
3408   case 129:
3409 #line 1181 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3410     {          // Sized array type?
3411     (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val))));
3412     delete (yyvsp[-1].TypeVal);
3413     CHECK_FOR_ERROR
3414   ;}
3415     break;
3416
3417   case 130:
3418 #line 1186 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3419     {          // Packed array type?
3420      const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get();
3421      if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val))
3422         GEN_ERROR("Unsigned result not equal to signed result");
3423      if (!ElemTy->isPrimitiveType())
3424         GEN_ERROR("Elemental type of a PackedType must be primitive");
3425      if (!isPowerOf2_32((yyvsp[-3].UInt64Val)))
3426        GEN_ERROR("Vector length should be a power of 2!");
3427      (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PackedType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val))));
3428      delete (yyvsp[-1].TypeVal);
3429      CHECK_FOR_ERROR
3430   ;}
3431     break;
3432
3433   case 131:
3434 #line 1198 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3435     {                        // Structure type?
3436     std::vector<const Type*> Elements;
3437     for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[-1].TypeList)->begin(),
3438            E = (yyvsp[-1].TypeList)->end(); I != E; ++I)
3439       Elements.push_back(*I);
3440
3441     (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
3442     delete (yyvsp[-1].TypeList);
3443     CHECK_FOR_ERROR
3444   ;}
3445     break;
3446
3447   case 132:
3448 #line 1208 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3449     {                                  // Empty structure type?
3450     (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
3451     CHECK_FOR_ERROR
3452   ;}
3453     break;
3454
3455   case 133:
3456 #line 1212 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3457     {                             // Pointer type?
3458     if (*(yyvsp[-1].TypeVal) == Type::LabelTy)
3459       GEN_ERROR("Cannot form a pointer to a basic block");
3460     (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal))));
3461     delete (yyvsp[-1].TypeVal);
3462     CHECK_FOR_ERROR
3463   ;}
3464     break;
3465
3466   case 134:
3467 #line 1223 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3468     {
3469     (yyval.TypeList) = new std::list<PATypeHolder>();
3470     (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal);
3471     CHECK_FOR_ERROR
3472   ;}
3473     break;
3474
3475   case 135:
3476 #line 1228 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3477     {
3478     ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal);
3479     CHECK_FOR_ERROR
3480   ;}
3481     break;
3482
3483   case 137:
3484 #line 1235 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3485     {
3486     ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(Type::VoidTy);
3487     CHECK_FOR_ERROR
3488   ;}
3489     break;
3490
3491   case 138:
3492 #line 1239 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3493     {
3494     ((yyval.TypeList) = new std::list<PATypeHolder>())->push_back(Type::VoidTy);
3495     CHECK_FOR_ERROR
3496   ;}
3497     break;
3498
3499   case 139:
3500 #line 1243 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3501     {
3502     (yyval.TypeList) = new std::list<PATypeHolder>();
3503     CHECK_FOR_ERROR
3504   ;}
3505     break;
3506
3507   case 140:
3508 #line 1254 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3509     { // Nonempty unsized arr
3510     const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-3].TypeVal)->get());
3511     if (ATy == 0)
3512       GEN_ERROR("Cannot make array constant with type: '" + 
3513                      (*(yyvsp[-3].TypeVal))->getDescription() + "'!");
3514     const Type *ETy = ATy->getElementType();
3515     int NumElements = ATy->getNumElements();
3516
3517     // Verify that we have the correct size...
3518     if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size())
3519       GEN_ERROR("Type mismatch: constant sized array initialized with " +
3520                      utostr((yyvsp[-1].ConstVector)->size()) +  " arguments, but has size of " + 
3521                      itostr(NumElements) + "!");
3522
3523     // Verify all elements are correct type!
3524     for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) {
3525       if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType())
3526         GEN_ERROR("Element #" + utostr(i) + " is not of type '" + 
3527                        ETy->getDescription() +"' as required!\nIt is of type '"+
3528                        (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'.");
3529     }
3530
3531     (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[-1].ConstVector));
3532     delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector);
3533     CHECK_FOR_ERROR
3534   ;}
3535     break;
3536
3537   case 141:
3538 #line 1280 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3539     {
3540     const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal)->get());
3541     if (ATy == 0)
3542       GEN_ERROR("Cannot make array constant with type: '" + 
3543                      (*(yyvsp[-2].TypeVal))->getDescription() + "'!");
3544
3545     int NumElements = ATy->getNumElements();
3546     if (NumElements != -1 && NumElements != 0) 
3547       GEN_ERROR("Type mismatch: constant sized array initialized with 0"
3548                      " arguments, but has size of " + itostr(NumElements) +"!");
3549     (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
3550     delete (yyvsp[-2].TypeVal);
3551     CHECK_FOR_ERROR
3552   ;}
3553     break;
3554
3555   case 142:
3556 #line 1294 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3557     {
3558     const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal)->get());
3559     if (ATy == 0)
3560       GEN_ERROR("Cannot make array constant with type: '" + 
3561                      (*(yyvsp[-2].TypeVal))->getDescription() + "'!");
3562
3563     int NumElements = ATy->getNumElements();
3564     const Type *ETy = ATy->getElementType();
3565     char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true);
3566     if (NumElements != -1 && NumElements != (EndStr-(yyvsp[0].StrVal)))
3567       GEN_ERROR("Can't build string constant of size " + 
3568                      itostr((int)(EndStr-(yyvsp[0].StrVal))) +
3569                      " when array has size " + itostr(NumElements) + "!");
3570     std::vector<Constant*> Vals;
3571     if (ETy == Type::SByteTy) {
3572       for (signed char *C = (signed char *)(yyvsp[0].StrVal); C != (signed char *)EndStr; ++C)
3573         Vals.push_back(ConstantInt::get(ETy, *C));
3574     } else if (ETy == Type::UByteTy) {
3575       for (unsigned char *C = (unsigned char *)(yyvsp[0].StrVal); 
3576            C != (unsigned char*)EndStr; ++C)
3577         Vals.push_back(ConstantInt::get(ETy, *C));
3578     } else {
3579       free((yyvsp[0].StrVal));
3580       GEN_ERROR("Cannot build string arrays of non byte sized elements!");
3581     }
3582     free((yyvsp[0].StrVal));
3583     (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
3584     delete (yyvsp[-2].TypeVal);
3585     CHECK_FOR_ERROR
3586   ;}
3587     break;
3588
3589   case 143:
3590 #line 1324 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3591     { // Nonempty unsized arr
3592     const PackedType *PTy = dyn_cast<PackedType>((yyvsp[-3].TypeVal)->get());
3593     if (PTy == 0)
3594       GEN_ERROR("Cannot make packed constant with type: '" + 
3595                      (*(yyvsp[-3].TypeVal))->getDescription() + "'!");
3596     const Type *ETy = PTy->getElementType();
3597     int NumElements = PTy->getNumElements();
3598
3599     // Verify that we have the correct size...
3600     if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size())
3601       GEN_ERROR("Type mismatch: constant sized packed initialized with " +
3602                      utostr((yyvsp[-1].ConstVector)->size()) +  " arguments, but has size of " + 
3603                      itostr(NumElements) + "!");
3604
3605     // Verify all elements are correct type!
3606     for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) {
3607       if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType())
3608         GEN_ERROR("Element #" + utostr(i) + " is not of type '" + 
3609            ETy->getDescription() +"' as required!\nIt is of type '"+
3610            (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'.");
3611     }
3612
3613     (yyval.ConstVal) = ConstantPacked::get(PTy, *(yyvsp[-1].ConstVector));
3614     delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector);
3615     CHECK_FOR_ERROR
3616   ;}
3617     break;
3618
3619   case 144:
3620 #line 1350 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3621     {
3622     const StructType *STy = dyn_cast<StructType>((yyvsp[-3].TypeVal)->get());
3623     if (STy == 0)
3624       GEN_ERROR("Cannot make struct constant with type: '" + 
3625                      (*(yyvsp[-3].TypeVal))->getDescription() + "'!");
3626
3627     if ((yyvsp[-1].ConstVector)->size() != STy->getNumContainedTypes())
3628       GEN_ERROR("Illegal number of initializers for structure type!");
3629
3630     // Check to ensure that constants are compatible with the type initializer!
3631     for (unsigned i = 0, e = (yyvsp[-1].ConstVector)->size(); i != e; ++i)
3632       if ((*(yyvsp[-1].ConstVector))[i]->getType() != STy->getElementType(i))
3633         GEN_ERROR("Expected type '" +
3634                        STy->getElementType(i)->getDescription() +
3635                        "' for element #" + utostr(i) +
3636                        " of structure initializer!");
3637
3638     (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-1].ConstVector));
3639     delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector);
3640     CHECK_FOR_ERROR
3641   ;}
3642     break;
3643
3644   case 145:
3645 #line 1371 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3646     {
3647     const StructType *STy = dyn_cast<StructType>((yyvsp[-2].TypeVal)->get());
3648     if (STy == 0)
3649       GEN_ERROR("Cannot make struct constant with type: '" + 
3650                      (*(yyvsp[-2].TypeVal))->getDescription() + "'!");
3651
3652     if (STy->getNumContainedTypes() != 0)
3653       GEN_ERROR("Illegal number of initializers for structure type!");
3654
3655     (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
3656     delete (yyvsp[-2].TypeVal);
3657     CHECK_FOR_ERROR
3658   ;}
3659     break;
3660
3661   case 146:
3662 #line 1384 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3663     {
3664     const PointerType *PTy = dyn_cast<PointerType>((yyvsp[-1].TypeVal)->get());
3665     if (PTy == 0)
3666       GEN_ERROR("Cannot make null pointer constant with type: '" + 
3667                      (*(yyvsp[-1].TypeVal))->getDescription() + "'!");
3668
3669     (yyval.ConstVal) = ConstantPointerNull::get(PTy);
3670     delete (yyvsp[-1].TypeVal);
3671     CHECK_FOR_ERROR
3672   ;}
3673     break;
3674
3675   case 147:
3676 #line 1394 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3677     {
3678     (yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal)->get());
3679     delete (yyvsp[-1].TypeVal);
3680     CHECK_FOR_ERROR
3681   ;}
3682     break;
3683
3684   case 148:
3685 #line 1399 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3686     {
3687     const PointerType *Ty = dyn_cast<PointerType>((yyvsp[-1].TypeVal)->get());
3688     if (Ty == 0)
3689       GEN_ERROR("Global const reference must be a pointer type!");
3690
3691     // ConstExprs can exist in the body of a function, thus creating
3692     // GlobalValues whenever they refer to a variable.  Because we are in
3693     // the context of a function, getValNonImprovising will search the functions
3694     // symbol table instead of the module symbol table for the global symbol,
3695     // which throws things all off.  To get around this, we just tell
3696     // getValNonImprovising that we are at global scope here.
3697     //
3698     Function *SavedCurFn = CurFun.CurrentFunction;
3699     CurFun.CurrentFunction = 0;
3700
3701     Value *V = getValNonImprovising(Ty, (yyvsp[0].ValIDVal));
3702     CHECK_FOR_ERROR
3703
3704     CurFun.CurrentFunction = SavedCurFn;
3705
3706     // If this is an initializer for a constant pointer, which is referencing a
3707     // (currently) undefined variable, create a stub now that shall be replaced
3708     // in the future with the right type of variable.
3709     //
3710     if (V == 0) {
3711       assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
3712       const PointerType *PT = cast<PointerType>(Ty);
3713
3714       // First check to see if the forward references value is already created!
3715       PerModuleInfo::GlobalRefsType::iterator I =
3716         CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[0].ValIDVal)));
3717     
3718       if (I != CurModule.GlobalRefs.end()) {
3719         V = I->second;             // Placeholder already exists, use it...
3720         (yyvsp[0].ValIDVal).destroy();
3721       } else {
3722         std::string Name;
3723         if ((yyvsp[0].ValIDVal).Type == ValID::NameVal) Name = (yyvsp[0].ValIDVal).Name;
3724
3725         // Create the forward referenced global.
3726         GlobalValue *GV;
3727         if (const FunctionType *FTy = 
3728                  dyn_cast<FunctionType>(PT->getElementType())) {
3729           GV = new Function(FTy, GlobalValue::ExternalLinkage, Name,
3730                             CurModule.CurrentModule);
3731         } else {
3732           GV = new GlobalVariable(PT->getElementType(), false,
3733                                   GlobalValue::ExternalLinkage, 0,
3734                                   Name, CurModule.CurrentModule);
3735         }
3736
3737         // Keep track of the fact that we have a forward ref to recycle it
3738         CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[0].ValIDVal)), GV));
3739         V = GV;
3740       }
3741     }
3742
3743     (yyval.ConstVal) = cast<GlobalValue>(V);
3744     delete (yyvsp[-1].TypeVal);            // Free the type handle
3745     CHECK_FOR_ERROR
3746   ;}
3747     break;
3748
3749   case 149:
3750 #line 1460 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3751     {
3752     if ((yyvsp[-1].TypeVal)->get() != (yyvsp[0].ConstVal)->getType())
3753       GEN_ERROR("Mismatched types for constant expression!");
3754     (yyval.ConstVal) = (yyvsp[0].ConstVal);
3755     delete (yyvsp[-1].TypeVal);
3756     CHECK_FOR_ERROR
3757   ;}
3758     break;
3759
3760   case 150:
3761 #line 1467 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3762     {
3763     const Type *Ty = (yyvsp[-1].TypeVal)->get();
3764     if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
3765       GEN_ERROR("Cannot create a null initialized value of this type!");
3766     (yyval.ConstVal) = Constant::getNullValue(Ty);
3767     delete (yyvsp[-1].TypeVal);
3768     CHECK_FOR_ERROR
3769   ;}
3770     break;
3771
3772   case 151:
3773 #line 1475 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3774     {      // integral constants
3775     if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val)))
3776       GEN_ERROR("Constant value doesn't fit in type!");
3777     (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val));
3778     CHECK_FOR_ERROR
3779   ;}
3780     break;
3781
3782   case 152:
3783 #line 1481 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3784     {            // integral constants
3785     if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val)))
3786       GEN_ERROR("Constant value doesn't fit in type!");
3787     (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val));
3788     CHECK_FOR_ERROR
3789   ;}
3790     break;
3791
3792   case 153:
3793 #line 1487 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3794     {                      // Boolean constants
3795     (yyval.ConstVal) = ConstantBool::getTrue();
3796     CHECK_FOR_ERROR
3797   ;}
3798     break;
3799
3800   case 154:
3801 #line 1491 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3802     {                     // Boolean constants
3803     (yyval.ConstVal) = ConstantBool::getFalse();
3804     CHECK_FOR_ERROR
3805   ;}
3806     break;
3807
3808   case 155:
3809 #line 1495 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3810     {                   // Float & Double constants
3811     if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal)))
3812       GEN_ERROR("Floating point constant invalid for type!!");
3813     (yyval.ConstVal) = ConstantFP::get((yyvsp[-1].PrimType), (yyvsp[0].FPVal));
3814     CHECK_FOR_ERROR
3815   ;}
3816     break;
3817
3818   case 156:
3819 #line 1503 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3820     {
3821     Constant *Val = (yyvsp[-3].ConstVal);
3822     const Type *Ty = (yyvsp[-1].TypeVal)->get();
3823     if (!Val->getType()->isFirstClassType())
3824       GEN_ERROR("cast constant expression from a non-primitive type: '" +
3825                      Val->getType()->getDescription() + "'!");
3826     if (!Ty->isFirstClassType())
3827       GEN_ERROR("cast constant expression to a non-primitive type: '" +
3828                 Ty->getDescription() + "'!");
3829     (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].TypeVal)->get());
3830     delete (yyvsp[-1].TypeVal);
3831   ;}
3832     break;
3833
3834   case 157:
3835 #line 1515 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3836     {
3837     if (!isa<PointerType>((yyvsp[-2].ConstVal)->getType()))
3838       GEN_ERROR("GetElementPtr requires a pointer operand!");
3839
3840     const Type *IdxTy =
3841       GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal)->getType(), *(yyvsp[-1].ValueList), true);
3842     if (!IdxTy)
3843       GEN_ERROR("Index list invalid for constant getelementptr!");
3844
3845     std::vector<Constant*> IdxVec;
3846     for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i != e; ++i)
3847       if (Constant *C = dyn_cast<Constant>((*(yyvsp[-1].ValueList))[i]))
3848         IdxVec.push_back(C);
3849       else
3850         GEN_ERROR("Indices to constant getelementptr must be constants!");
3851
3852     delete (yyvsp[-1].ValueList);
3853
3854     (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[-2].ConstVal), IdxVec);
3855     CHECK_FOR_ERROR
3856   ;}
3857     break;
3858
3859   case 158:
3860 #line 1536 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3861     {
3862     if ((yyvsp[-5].ConstVal)->getType() != Type::BoolTy)
3863       GEN_ERROR("Select condition must be of boolean type!");
3864     if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
3865       GEN_ERROR("Select operand types must match!");
3866     (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
3867     CHECK_FOR_ERROR
3868   ;}
3869     break;
3870
3871   case 159:
3872 #line 1544 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3873     {
3874     if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
3875       GEN_ERROR("Binary operator types must match!");
3876     CHECK_FOR_ERROR;
3877     (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
3878   ;}
3879     break;
3880
3881   case 160:
3882 #line 1550 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3883     {
3884     if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
3885       GEN_ERROR("Logical operator types must match!");
3886     if (!(yyvsp[-3].ConstVal)->getType()->isIntegral()) {
3887       if (!isa<PackedType>((yyvsp[-3].ConstVal)->getType()) || 
3888           !cast<PackedType>((yyvsp[-3].ConstVal)->getType())->getElementType()->isIntegral())
3889         GEN_ERROR("Logical operator requires integral operands!");
3890     }
3891     (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
3892     CHECK_FOR_ERROR
3893   ;}
3894     break;
3895
3896   case 161:
3897 #line 1561 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3898     {
3899     if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
3900       GEN_ERROR("setcc operand types must match!");
3901     (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
3902     CHECK_FOR_ERROR
3903   ;}
3904     break;
3905
3906   case 162:
3907 #line 1567 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3908     {
3909     if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
3910       GEN_ERROR("icmp operand types must match!");
3911     (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[-5].IPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
3912   ;}
3913     break;
3914
3915   case 163:
3916 #line 1572 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3917     {
3918     if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
3919       GEN_ERROR("fcmp operand types must match!");
3920     (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[-5].FPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
3921   ;}
3922     break;
3923
3924   case 164:
3925 #line 1577 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3926     {
3927     if ((yyvsp[-1].ConstVal)->getType() != Type::UByteTy)
3928       GEN_ERROR("Shift count for shift constant must be unsigned byte!");
3929     if (!(yyvsp[-3].ConstVal)->getType()->isInteger())
3930       GEN_ERROR("Shift constant expression requires integer operand!");
3931     CHECK_FOR_ERROR;
3932     (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].OtherOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
3933     CHECK_FOR_ERROR
3934   ;}
3935     break;
3936
3937   case 165:
3938 #line 1586 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3939     {
3940     if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)))
3941       GEN_ERROR("Invalid extractelement operands!");
3942     (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
3943     CHECK_FOR_ERROR
3944   ;}
3945     break;
3946
3947   case 166:
3948 #line 1592 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3949     {
3950     if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)))
3951       GEN_ERROR("Invalid insertelement operands!");
3952     (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
3953     CHECK_FOR_ERROR
3954   ;}
3955     break;
3956
3957   case 167:
3958 #line 1598 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3959     {
3960     if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)))
3961       GEN_ERROR("Invalid shufflevector operands!");
3962     (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
3963     CHECK_FOR_ERROR
3964   ;}
3965     break;
3966
3967   case 168:
3968 #line 1607 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3969     {
3970     ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal));
3971     CHECK_FOR_ERROR
3972   ;}
3973     break;
3974
3975   case 169:
3976 #line 1611 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3977     {
3978     (yyval.ConstVector) = new std::vector<Constant*>();
3979     (yyval.ConstVector)->push_back((yyvsp[0].ConstVal));
3980     CHECK_FOR_ERROR
3981   ;}
3982     break;
3983
3984   case 170:
3985 #line 1619 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3986     { (yyval.BoolVal) = false; ;}
3987     break;
3988
3989   case 171:
3990 #line 1619 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3991     { (yyval.BoolVal) = true; ;}
3992     break;
3993
3994   case 172:
3995 #line 1629 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3996     {
3997   (yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal);
3998   CurModule.ModuleDone();
3999   CHECK_FOR_ERROR;
4000 ;}
4001     break;
4002
4003   case 173:
4004 #line 1637 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4005     {
4006     (yyval.ModuleVal) = (yyvsp[-1].ModuleVal);
4007     CurFun.FunctionDone();
4008     CHECK_FOR_ERROR
4009   ;}
4010     break;
4011
4012   case 174:
4013 #line 1642 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4014     {
4015     (yyval.ModuleVal) = (yyvsp[-1].ModuleVal);
4016     CHECK_FOR_ERROR
4017   ;}
4018     break;
4019
4020   case 175:
4021 #line 1646 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4022     {
4023     (yyval.ModuleVal) = (yyvsp[-3].ModuleVal);
4024     CHECK_FOR_ERROR
4025   ;}
4026     break;
4027
4028   case 176:
4029 #line 1650 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4030     {
4031     (yyval.ModuleVal) = (yyvsp[-1].ModuleVal);
4032     CHECK_FOR_ERROR
4033   ;}
4034     break;
4035
4036   case 177:
4037 #line 1654 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4038     {
4039     (yyval.ModuleVal) = CurModule.CurrentModule;
4040     // Emit an error if there are any unresolved types left.
4041     if (!CurModule.LateResolveTypes.empty()) {
4042       const ValID &DID = CurModule.LateResolveTypes.begin()->first;
4043       if (DID.Type == ValID::NameVal) {
4044         GEN_ERROR("Reference to an undefined type: '"+DID.getName() + "'");
4045       } else {
4046         GEN_ERROR("Reference to an undefined type: #" + itostr(DID.Num));
4047       }
4048     }
4049     CHECK_FOR_ERROR
4050   ;}
4051     break;
4052
4053   case 178:
4054 #line 1669 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4055     {
4056     // Eagerly resolve types.  This is not an optimization, this is a
4057     // requirement that is due to the fact that we could have this:
4058     //
4059     // %list = type { %list * }
4060     // %list = type { %list * }    ; repeated type decl
4061     //
4062     // If types are not resolved eagerly, then the two types will not be
4063     // determined to be the same type!
4064     //
4065     ResolveTypeTo((yyvsp[-2].StrVal), *(yyvsp[0].TypeVal));
4066
4067     if (!setTypeName(*(yyvsp[0].TypeVal), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) {
4068       CHECK_FOR_ERROR
4069       // If this is a named type that is not a redefinition, add it to the slot
4070       // table.
4071       CurModule.Types.push_back(*(yyvsp[0].TypeVal));
4072     }
4073
4074     delete (yyvsp[0].TypeVal);
4075     CHECK_FOR_ERROR
4076   ;}
4077     break;
4078
4079   case 179:
4080 #line 1691 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4081     {       // Function prototypes can be in const pool
4082     CHECK_FOR_ERROR
4083   ;}
4084     break;
4085
4086   case 180:
4087 #line 1694 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4088     {  // Asm blocks can be in the const pool
4089     CHECK_FOR_ERROR
4090   ;}
4091     break;
4092
4093   case 181:
4094 #line 1697 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4095     {
4096     if ((yyvsp[0].ConstVal) == 0) 
4097       GEN_ERROR("Global value initializer is not a constant!");
4098     CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), (yyvsp[-2].Linkage), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal));
4099     CHECK_FOR_ERROR
4100   ;}
4101     break;
4102
4103   case 182:
4104 #line 1702 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4105     {
4106     CurGV = 0;
4107   ;}
4108     break;
4109
4110   case 183:
4111 #line 1705 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4112     {
4113     CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0);
4114     CHECK_FOR_ERROR
4115     delete (yyvsp[0].TypeVal);
4116   ;}
4117     break;
4118
4119   case 184:
4120 #line 1709 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4121     {
4122     CurGV = 0;
4123     CHECK_FOR_ERROR
4124   ;}
4125     break;
4126
4127   case 185:
4128 #line 1713 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4129     {
4130     CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0);
4131     CHECK_FOR_ERROR
4132     delete (yyvsp[0].TypeVal);
4133   ;}
4134     break;
4135
4136   case 186:
4137 #line 1717 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4138     {
4139     CurGV = 0;
4140     CHECK_FOR_ERROR
4141   ;}
4142     break;
4143
4144   case 187:
4145 #line 1721 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4146     {
4147     CurGV = 
4148       ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalWeakLinkage, (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0);
4149     CHECK_FOR_ERROR
4150     delete (yyvsp[0].TypeVal);
4151   ;}
4152     break;
4153
4154   case 188:
4155 #line 1726 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4156     {
4157     CurGV = 0;
4158     CHECK_FOR_ERROR
4159   ;}
4160     break;
4161
4162   case 189:
4163 #line 1730 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4164     { 
4165     CHECK_FOR_ERROR
4166   ;}
4167     break;
4168
4169   case 190:
4170 #line 1733 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4171     {
4172     CHECK_FOR_ERROR
4173   ;}
4174     break;
4175
4176   case 191:
4177 #line 1736 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4178     { 
4179   ;}
4180     break;
4181
4182   case 192:
4183 #line 1740 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4184     {
4185   const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
4186   char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true);
4187   std::string NewAsm((yyvsp[0].StrVal), EndStr);
4188   free((yyvsp[0].StrVal));
4189
4190   if (AsmSoFar.empty())
4191     CurModule.CurrentModule->setModuleInlineAsm(NewAsm);
4192   else
4193     CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm);
4194   CHECK_FOR_ERROR
4195 ;}
4196     break;
4197
4198   case 193:
4199 #line 1753 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4200     { (yyval.Endianness) = Module::BigEndian; ;}
4201     break;
4202
4203   case 194:
4204 #line 1754 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4205     { (yyval.Endianness) = Module::LittleEndian; ;}
4206     break;
4207
4208   case 195:
4209 #line 1756 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4210     {
4211     CurModule.CurrentModule->setEndianness((yyvsp[0].Endianness));
4212     CHECK_FOR_ERROR
4213   ;}
4214     break;
4215
4216   case 196:
4217 #line 1760 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4218     {
4219     if ((yyvsp[0].UInt64Val) == 32)
4220       CurModule.CurrentModule->setPointerSize(Module::Pointer32);
4221     else if ((yyvsp[0].UInt64Val) == 64)
4222       CurModule.CurrentModule->setPointerSize(Module::Pointer64);
4223     else
4224       GEN_ERROR("Invalid pointer size: '" + utostr((yyvsp[0].UInt64Val)) + "'!");
4225     CHECK_FOR_ERROR
4226   ;}
4227     break;
4228
4229   case 197:
4230 #line 1769 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4231     {
4232     CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal));
4233     free((yyvsp[0].StrVal));
4234   ;}
4235     break;
4236
4237   case 198:
4238 #line 1773 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4239     {
4240     CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal));
4241     free((yyvsp[0].StrVal));
4242   ;}
4243     break;
4244
4245   case 200:
4246 #line 1780 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4247     {
4248           CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal));
4249           free((yyvsp[0].StrVal));
4250           CHECK_FOR_ERROR
4251         ;}
4252     break;
4253
4254   case 201:
4255 #line 1785 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4256     {
4257           CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal));
4258           free((yyvsp[0].StrVal));
4259           CHECK_FOR_ERROR
4260         ;}
4261     break;
4262
4263   case 202:
4264 #line 1790 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4265     {
4266           CHECK_FOR_ERROR
4267         ;}
4268     break;
4269
4270   case 206:
4271 #line 1800 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4272     { (yyval.StrVal) = 0; ;}
4273     break;
4274
4275   case 207:
4276 #line 1802 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4277     {
4278   if (*(yyvsp[-1].TypeVal) == Type::VoidTy)
4279     GEN_ERROR("void typed arguments are invalid!");
4280   (yyval.ArgVal) = new std::pair<PATypeHolder*, char*>((yyvsp[-1].TypeVal), (yyvsp[0].StrVal));
4281   CHECK_FOR_ERROR
4282 ;}
4283     break;
4284
4285   case 208:
4286 #line 1809 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4287     {
4288     (yyval.ArgList) = (yyvsp[-2].ArgList);
4289     (yyvsp[-2].ArgList)->push_back(*(yyvsp[0].ArgVal));
4290     delete (yyvsp[0].ArgVal);
4291     CHECK_FOR_ERROR
4292   ;}
4293     break;
4294
4295   case 209:
4296 #line 1815 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4297     {
4298     (yyval.ArgList) = new std::vector<std::pair<PATypeHolder*,char*> >();
4299     (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal));
4300     delete (yyvsp[0].ArgVal);
4301     CHECK_FOR_ERROR
4302   ;}
4303     break;
4304
4305   case 210:
4306 #line 1822 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4307     {
4308     (yyval.ArgList) = (yyvsp[0].ArgList);
4309     CHECK_FOR_ERROR
4310   ;}
4311     break;
4312
4313   case 211:
4314 #line 1826 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4315     {
4316     (yyval.ArgList) = (yyvsp[-2].ArgList);
4317     (yyval.ArgList)->push_back(std::pair<PATypeHolder*,
4318                             char*>(new PATypeHolder(Type::VoidTy), 0));
4319     CHECK_FOR_ERROR
4320   ;}
4321     break;
4322
4323   case 212:
4324 #line 1832 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4325     {
4326     (yyval.ArgList) = new std::vector<std::pair<PATypeHolder*,char*> >();
4327     (yyval.ArgList)->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0));
4328     CHECK_FOR_ERROR
4329   ;}
4330     break;
4331
4332   case 213:
4333 #line 1837 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4334     {
4335     (yyval.ArgList) = 0;
4336     CHECK_FOR_ERROR
4337   ;}
4338     break;
4339
4340   case 214:
4341 #line 1843 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4342     {
4343   UnEscapeLexed((yyvsp[-5].StrVal));
4344   std::string FunctionName((yyvsp[-5].StrVal));
4345   free((yyvsp[-5].StrVal));  // Free strdup'd memory!
4346   
4347   if (!(*(yyvsp[-6].TypeVal))->isFirstClassType() && *(yyvsp[-6].TypeVal) != Type::VoidTy)
4348     GEN_ERROR("LLVM functions cannot return aggregate types!");
4349
4350   std::vector<const Type*> ParamTypeList;
4351   if ((yyvsp[-3].ArgList)) {   // If there are arguments...
4352     for (std::vector<std::pair<PATypeHolder*,char*> >::iterator I = (yyvsp[-3].ArgList)->begin();
4353          I != (yyvsp[-3].ArgList)->end(); ++I)
4354       ParamTypeList.push_back(I->first->get());
4355   }
4356
4357   bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
4358   if (isVarArg) ParamTypeList.pop_back();
4359
4360   const FunctionType *FT = FunctionType::get(*(yyvsp[-6].TypeVal), ParamTypeList, isVarArg);
4361   const PointerType *PFT = PointerType::get(FT);
4362   delete (yyvsp[-6].TypeVal);
4363
4364   ValID ID;
4365   if (!FunctionName.empty()) {
4366     ID = ValID::create((char*)FunctionName.c_str());
4367   } else {
4368     ID = ValID::create((int)CurModule.Values[PFT].size());
4369   }
4370
4371   Function *Fn = 0;
4372   // See if this function was forward referenced.  If so, recycle the object.
4373   if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
4374     // Move the function to the end of the list, from whereever it was 
4375     // previously inserted.
4376     Fn = cast<Function>(FWRef);
4377     CurModule.CurrentModule->getFunctionList().remove(Fn);
4378     CurModule.CurrentModule->getFunctionList().push_back(Fn);
4379   } else if (!FunctionName.empty() &&     // Merge with an earlier prototype?
4380              (Fn = CurModule.CurrentModule->getFunction(FunctionName, FT))) {
4381     // If this is the case, either we need to be a forward decl, or it needs 
4382     // to be.
4383     if (!CurFun.isDeclare && !Fn->isExternal())
4384       GEN_ERROR("Redefinition of function '" + FunctionName + "'!");
4385     
4386     // Make sure to strip off any argument names so we can't get conflicts.
4387     if (Fn->isExternal())
4388       for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
4389            AI != AE; ++AI)
4390         AI->setName("");
4391   } else  {  // Not already defined?
4392     Fn = new Function(FT, GlobalValue::ExternalLinkage, FunctionName,
4393                       CurModule.CurrentModule);
4394
4395     InsertValue(Fn, CurModule.Values);
4396   }
4397
4398   CurFun.FunctionStart(Fn);
4399
4400   if (CurFun.isDeclare) {
4401     // If we have declaration, always overwrite linkage.  This will allow us to
4402     // correctly handle cases, when pointer to function is passed as argument to
4403     // another function.
4404     Fn->setLinkage(CurFun.Linkage);
4405   }
4406   Fn->setCallingConv((yyvsp[-7].UIntVal));
4407   Fn->setAlignment((yyvsp[0].UIntVal));
4408   if ((yyvsp[-1].StrVal)) {
4409     Fn->setSection((yyvsp[-1].StrVal));
4410     free((yyvsp[-1].StrVal));
4411   }
4412
4413   // Add all of the arguments we parsed to the function...
4414   if ((yyvsp[-3].ArgList)) {                     // Is null if empty...
4415     if (isVarArg) {  // Nuke the last entry
4416       assert((yyvsp[-3].ArgList)->back().first->get() == Type::VoidTy && (yyvsp[-3].ArgList)->back().second == 0&&
4417              "Not a varargs marker!");
4418       delete (yyvsp[-3].ArgList)->back().first;
4419       (yyvsp[-3].ArgList)->pop_back();  // Delete the last entry
4420     }
4421     Function::arg_iterator ArgIt = Fn->arg_begin();
4422     for (std::vector<std::pair<PATypeHolder*,char*> >::iterator I = (yyvsp[-3].ArgList)->begin();
4423          I != (yyvsp[-3].ArgList)->end(); ++I, ++ArgIt) {
4424       delete I->first;                          // Delete the typeholder...
4425
4426       setValueName(ArgIt, I->second);           // Insert arg into symtab...
4427       CHECK_FOR_ERROR
4428       InsertValue(ArgIt);
4429     }
4430
4431     delete (yyvsp[-3].ArgList);                     // We're now done with the argument list
4432   }
4433   CHECK_FOR_ERROR
4434 ;}
4435     break;
4436
4437   case 217:
4438 #line 1939 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4439     {
4440   (yyval.FunctionVal) = CurFun.CurrentFunction;
4441
4442   // Make sure that we keep track of the linkage type even if there was a
4443   // previous "declare".
4444   (yyval.FunctionVal)->setLinkage((yyvsp[-2].Linkage));
4445 ;}
4446     break;
4447
4448   case 220:
4449 #line 1949 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4450     {
4451   (yyval.FunctionVal) = (yyvsp[-1].FunctionVal);
4452   CHECK_FOR_ERROR
4453 ;}
4454     break;
4455
4456   case 222:
4457 #line 1955 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4458     { CurFun.Linkage = GlobalValue::DLLImportLinkage; ;}
4459     break;
4460
4461   case 223:
4462 #line 1956 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4463     { CurFun.Linkage = GlobalValue::ExternalWeakLinkage; ;}
4464     break;
4465
4466   case 224:
4467 #line 1958 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4468     { CurFun.isDeclare = true; ;}
4469     break;
4470
4471   case 225:
4472 #line 1958 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4473     {
4474     (yyval.FunctionVal) = CurFun.CurrentFunction;
4475     CurFun.FunctionDone();
4476     CHECK_FOR_ERROR
4477   ;}
4478     break;
4479
4480   case 226:
4481 #line 1968 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4482     {
4483     (yyval.BoolVal) = false;
4484     CHECK_FOR_ERROR
4485   ;}
4486     break;
4487
4488   case 227:
4489 #line 1972 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4490     {
4491     (yyval.BoolVal) = true;
4492     CHECK_FOR_ERROR
4493   ;}
4494     break;
4495
4496   case 228:
4497 #line 1977 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4498     {    // A reference to a direct constant
4499     (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val));
4500     CHECK_FOR_ERROR
4501   ;}
4502     break;
4503
4504   case 229:
4505 #line 1981 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4506     {
4507     (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val));
4508     CHECK_FOR_ERROR
4509   ;}
4510     break;
4511
4512   case 230:
4513 #line 1985 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4514     {                     // Perhaps it's an FP constant?
4515     (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal));
4516     CHECK_FOR_ERROR
4517   ;}
4518     break;
4519
4520   case 231:
4521 #line 1989 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4522     {
4523     (yyval.ValIDVal) = ValID::create(ConstantBool::getTrue());
4524     CHECK_FOR_ERROR
4525   ;}
4526     break;
4527
4528   case 232:
4529 #line 1993 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4530     {
4531     (yyval.ValIDVal) = ValID::create(ConstantBool::getFalse());
4532     CHECK_FOR_ERROR
4533   ;}
4534     break;
4535
4536   case 233:
4537 #line 1997 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4538     {
4539     (yyval.ValIDVal) = ValID::createNull();
4540     CHECK_FOR_ERROR
4541   ;}
4542     break;
4543
4544   case 234:
4545 #line 2001 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4546     {
4547     (yyval.ValIDVal) = ValID::createUndef();
4548     CHECK_FOR_ERROR
4549   ;}
4550     break;
4551
4552   case 235:
4553 #line 2005 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4554     {     // A vector zero constant.
4555     (yyval.ValIDVal) = ValID::createZeroInit();
4556     CHECK_FOR_ERROR
4557   ;}
4558     break;
4559
4560   case 236:
4561 #line 2009 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4562     { // Nonempty unsized packed vector
4563     const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType();
4564     int NumElements = (yyvsp[-1].ConstVector)->size(); 
4565     
4566     PackedType* pt = PackedType::get(ETy, NumElements);
4567     PATypeHolder* PTy = new PATypeHolder(
4568                                          HandleUpRefs(
4569                                             PackedType::get(
4570                                                 ETy, 
4571                                                 NumElements)
4572                                             )
4573                                          );
4574     
4575     // Verify all elements are correct type!
4576     for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) {
4577       if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType())
4578         GEN_ERROR("Element #" + utostr(i) + " is not of type '" + 
4579                      ETy->getDescription() +"' as required!\nIt is of type '" +
4580                      (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'.");
4581     }
4582
4583     (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, *(yyvsp[-1].ConstVector)));
4584     delete PTy; delete (yyvsp[-1].ConstVector);
4585     CHECK_FOR_ERROR
4586   ;}
4587     break;
4588
4589   case 237:
4590 #line 2034 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4591     {
4592     (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal));
4593     CHECK_FOR_ERROR
4594   ;}
4595     break;
4596
4597   case 238:
4598 #line 2038 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4599     {
4600     char *End = UnEscapeLexed((yyvsp[-2].StrVal), true);
4601     std::string AsmStr = std::string((yyvsp[-2].StrVal), End);
4602     End = UnEscapeLexed((yyvsp[0].StrVal), true);
4603     std::string Constraints = std::string((yyvsp[0].StrVal), End);
4604     (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[-3].BoolVal));
4605     free((yyvsp[-2].StrVal));
4606     free((yyvsp[0].StrVal));
4607     CHECK_FOR_ERROR
4608   ;}
4609     break;
4610
4611   case 239:
4612 #line 2052 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4613     {  // Is it an integer reference...?
4614     (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal));
4615     CHECK_FOR_ERROR
4616   ;}
4617     break;
4618
4619   case 240:
4620 #line 2056 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4621     {                   // Is it a named reference...?
4622     (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal));
4623     CHECK_FOR_ERROR
4624   ;}
4625     break;
4626
4627   case 243:
4628 #line 2068 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4629     {
4630     (yyval.ValueVal) = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); delete (yyvsp[-1].TypeVal);
4631     CHECK_FOR_ERROR
4632   ;}
4633     break;
4634
4635   case 244:
4636 #line 2073 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4637     {
4638     (yyval.FunctionVal) = (yyvsp[-1].FunctionVal);
4639     CHECK_FOR_ERROR
4640   ;}
4641     break;
4642
4643   case 245:
4644 #line 2077 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4645     { // Do not allow functions with 0 basic blocks   
4646     (yyval.FunctionVal) = (yyvsp[-1].FunctionVal);
4647     CHECK_FOR_ERROR
4648   ;}
4649     break;
4650
4651   case 246:
4652 #line 2086 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4653     {
4654     setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal));
4655     CHECK_FOR_ERROR
4656     InsertValue((yyvsp[0].TermInstVal));
4657
4658     (yyvsp[-2].BasicBlockVal)->getInstList().push_back((yyvsp[0].TermInstVal));
4659     InsertValue((yyvsp[-2].BasicBlockVal));
4660     (yyval.BasicBlockVal) = (yyvsp[-2].BasicBlockVal);
4661     CHECK_FOR_ERROR
4662   ;}
4663     break;
4664
4665   case 247:
4666 #line 2097 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4667     {
4668     if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[0].InstVal)))
4669       if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
4670         if (CI2->getParent() == 0)
4671           (yyvsp[-1].BasicBlockVal)->getInstList().push_back(CI2);
4672     (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal));
4673     (yyval.BasicBlockVal) = (yyvsp[-1].BasicBlockVal);
4674     CHECK_FOR_ERROR
4675   ;}
4676     break;
4677
4678   case 248:
4679 #line 2106 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4680     {
4681     (yyval.BasicBlockVal) = getBBVal(ValID::create((int)CurFun.NextBBNum++), true);
4682     CHECK_FOR_ERROR
4683
4684     // Make sure to move the basic block to the correct location in the
4685     // function, instead of leaving it inserted wherever it was first
4686     // referenced.
4687     Function::BasicBlockListType &BBL = 
4688       CurFun.CurrentFunction->getBasicBlockList();
4689     BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal));
4690     CHECK_FOR_ERROR
4691   ;}
4692     break;
4693
4694   case 249:
4695 #line 2118 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4696     {
4697     (yyval.BasicBlockVal) = getBBVal(ValID::create((yyvsp[0].StrVal)), true);
4698     CHECK_FOR_ERROR
4699
4700     // Make sure to move the basic block to the correct location in the
4701     // function, instead of leaving it inserted wherever it was first
4702     // referenced.
4703     Function::BasicBlockListType &BBL = 
4704       CurFun.CurrentFunction->getBasicBlockList();
4705     BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal));
4706     CHECK_FOR_ERROR
4707   ;}
4708     break;
4709
4710   case 250:
4711 #line 2131 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4712     {              // Return with a result...
4713     (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal));
4714     CHECK_FOR_ERROR
4715   ;}
4716     break;
4717
4718   case 251:
4719 #line 2135 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4720     {                                       // Return with no result...
4721     (yyval.TermInstVal) = new ReturnInst();
4722     CHECK_FOR_ERROR
4723   ;}
4724     break;
4725
4726   case 252:
4727 #line 2139 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4728     {                         // Unconditional Branch...
4729     BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal));
4730     CHECK_FOR_ERROR
4731     (yyval.TermInstVal) = new BranchInst(tmpBB);
4732   ;}
4733     break;
4734
4735   case 253:
4736 #line 2144 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4737     {  
4738     BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal));
4739     CHECK_FOR_ERROR
4740     BasicBlock* tmpBBB = getBBVal((yyvsp[0].ValIDVal));
4741     CHECK_FOR_ERROR
4742     Value* tmpVal = getVal(Type::BoolTy, (yyvsp[-6].ValIDVal));
4743     CHECK_FOR_ERROR
4744     (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal);
4745   ;}
4746     break;
4747
4748   case 254:
4749 #line 2153 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4750     {
4751     Value* tmpVal = getVal((yyvsp[-7].PrimType), (yyvsp[-6].ValIDVal));
4752     CHECK_FOR_ERROR
4753     BasicBlock* tmpBB = getBBVal((yyvsp[-3].ValIDVal));
4754     CHECK_FOR_ERROR
4755     SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[-1].JumpTable)->size());
4756     (yyval.TermInstVal) = S;
4757
4758     std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[-1].JumpTable)->begin(),
4759       E = (yyvsp[-1].JumpTable)->end();
4760     for (; I != E; ++I) {
4761       if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
4762           S->addCase(CI, I->second);
4763       else
4764         GEN_ERROR("Switch case is constant, but not a simple integer!");
4765     }
4766     delete (yyvsp[-1].JumpTable);
4767     CHECK_FOR_ERROR
4768   ;}
4769     break;
4770
4771   case 255:
4772 #line 2172 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4773     {
4774     Value* tmpVal = getVal((yyvsp[-6].PrimType), (yyvsp[-5].ValIDVal));
4775     CHECK_FOR_ERROR
4776     BasicBlock* tmpBB = getBBVal((yyvsp[-2].ValIDVal));
4777     CHECK_FOR_ERROR
4778     SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0);
4779     (yyval.TermInstVal) = S;
4780     CHECK_FOR_ERROR
4781   ;}
4782     break;
4783
4784   case 256:
4785 #line 2182 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4786     {
4787     const PointerType *PFTy;
4788     const FunctionType *Ty;
4789
4790     if (!(PFTy = dyn_cast<PointerType>((yyvsp[-10].TypeVal)->get())) ||
4791         !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
4792       // Pull out the types of all of the arguments...
4793       std::vector<const Type*> ParamTypes;
4794       if ((yyvsp[-7].ValueList)) {
4795         for (std::vector<Value*>::iterator I = (yyvsp[-7].ValueList)->begin(), E = (yyvsp[-7].ValueList)->end();
4796              I != E; ++I)
4797           ParamTypes.push_back((*I)->getType());
4798       }
4799
4800       bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy;
4801       if (isVarArg) ParamTypes.pop_back();
4802
4803       Ty = FunctionType::get((yyvsp[-10].TypeVal)->get(), ParamTypes, isVarArg);
4804       PFTy = PointerType::get(Ty);
4805     }
4806
4807     Value *V = getVal(PFTy, (yyvsp[-9].ValIDVal));   // Get the function we're calling...
4808     CHECK_FOR_ERROR
4809     BasicBlock *Normal = getBBVal((yyvsp[-3].ValIDVal));
4810     CHECK_FOR_ERROR
4811     BasicBlock *Except = getBBVal((yyvsp[0].ValIDVal));
4812     CHECK_FOR_ERROR
4813
4814     // Create the call node...
4815     if (!(yyvsp[-7].ValueList)) {                                   // Has no arguments?
4816       (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, std::vector<Value*>());
4817     } else {                                     // Has arguments?
4818       // Loop through FunctionType's arguments and ensure they are specified
4819       // correctly!
4820       //
4821       FunctionType::param_iterator I = Ty->param_begin();
4822       FunctionType::param_iterator E = Ty->param_end();
4823       std::vector<Value*>::iterator ArgI = (yyvsp[-7].ValueList)->begin(), ArgE = (yyvsp[-7].ValueList)->end();
4824
4825       for (; ArgI != ArgE && I != E; ++ArgI, ++I)
4826         if ((*ArgI)->getType() != *I)
4827           GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" +
4828                          (*I)->getDescription() + "'!");
4829
4830       if (I != E || (ArgI != ArgE && !Ty->isVarArg()))
4831         GEN_ERROR("Invalid number of parameters detected!");
4832
4833       (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, *(yyvsp[-7].ValueList));
4834     }
4835     cast<InvokeInst>((yyval.TermInstVal))->setCallingConv((yyvsp[-11].UIntVal));
4836   
4837     delete (yyvsp[-10].TypeVal);
4838     delete (yyvsp[-7].ValueList);
4839     CHECK_FOR_ERROR
4840   ;}
4841     break;
4842
4843   case 257:
4844 #line 2237 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4845     {
4846     (yyval.TermInstVal) = new UnwindInst();
4847     CHECK_FOR_ERROR
4848   ;}
4849     break;
4850
4851   case 258:
4852 #line 2241 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4853     {
4854     (yyval.TermInstVal) = new UnreachableInst();
4855     CHECK_FOR_ERROR
4856   ;}
4857     break;
4858
4859   case 259:
4860 #line 2248 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4861     {
4862     (yyval.JumpTable) = (yyvsp[-5].JumpTable);
4863     Constant *V = cast<Constant>(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal)));
4864     CHECK_FOR_ERROR
4865     if (V == 0)
4866       GEN_ERROR("May only switch on a constant pool value!");
4867
4868     BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal));
4869     CHECK_FOR_ERROR
4870     (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
4871   ;}
4872     break;
4873
4874   case 260:
4875 #line 2259 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4876     {
4877     (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
4878     Constant *V = cast<Constant>(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal)));
4879     CHECK_FOR_ERROR
4880
4881     if (V == 0)
4882       GEN_ERROR("May only switch on a constant pool value!");
4883
4884     BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal));
4885     CHECK_FOR_ERROR
4886     (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); 
4887   ;}
4888     break;
4889
4890   case 261:
4891 #line 2272 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4892     {
4893   // Is this definition named?? if so, assign the name...
4894   setValueName((yyvsp[0].InstVal), (yyvsp[-1].StrVal));
4895   CHECK_FOR_ERROR
4896   InsertValue((yyvsp[0].InstVal));
4897   (yyval.InstVal) = (yyvsp[0].InstVal);
4898   CHECK_FOR_ERROR
4899 ;}
4900     break;
4901
4902   case 262:
4903 #line 2281 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4904     {    // Used for PHI nodes
4905     (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
4906     Value* tmpVal = getVal(*(yyvsp[-5].TypeVal), (yyvsp[-3].ValIDVal));
4907     CHECK_FOR_ERROR
4908     BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal));
4909     CHECK_FOR_ERROR
4910     (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
4911     delete (yyvsp[-5].TypeVal);
4912   ;}
4913     break;
4914
4915   case 263:
4916 #line 2290 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4917     {
4918     (yyval.PHIList) = (yyvsp[-6].PHIList);
4919     Value* tmpVal = getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal));
4920     CHECK_FOR_ERROR
4921     BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal));
4922     CHECK_FOR_ERROR
4923     (yyvsp[-6].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
4924   ;}
4925     break;
4926
4927   case 264:
4928 #line 2300 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4929     {    // Used for call statements, and memory insts...
4930     (yyval.ValueList) = new std::vector<Value*>();
4931     (yyval.ValueList)->push_back((yyvsp[0].ValueVal));
4932   ;}
4933     break;
4934
4935   case 265:
4936 #line 2304 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4937     {
4938     (yyval.ValueList) = (yyvsp[-2].ValueList);
4939     (yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal));
4940     CHECK_FOR_ERROR
4941   ;}
4942     break;
4943
4944   case 267:
4945 #line 2311 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4946     { (yyval.ValueList) = 0; ;}
4947     break;
4948
4949   case 268:
4950 #line 2313 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4951     {
4952     (yyval.BoolVal) = true;
4953     CHECK_FOR_ERROR
4954   ;}
4955     break;
4956
4957   case 269:
4958 #line 2317 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4959     {
4960     (yyval.BoolVal) = false;
4961     CHECK_FOR_ERROR
4962   ;}
4963     break;
4964
4965   case 270:
4966 #line 2322 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4967     {
4968     if (!(*(yyvsp[-3].TypeVal))->isInteger() && !(*(yyvsp[-3].TypeVal))->isFloatingPoint() && 
4969         !isa<PackedType>((*(yyvsp[-3].TypeVal)).get()))
4970       GEN_ERROR(
4971         "Arithmetic operator requires integer, FP, or packed operands!");
4972     if (isa<PackedType>((*(yyvsp[-3].TypeVal)).get()) && 
4973         ((yyvsp[-4].BinaryOpVal) == Instruction::URem || 
4974          (yyvsp[-4].BinaryOpVal) == Instruction::SRem ||
4975          (yyvsp[-4].BinaryOpVal) == Instruction::FRem))
4976       GEN_ERROR("U/S/FRem not supported on packed types!");
4977     Value* val1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); 
4978     CHECK_FOR_ERROR
4979     Value* val2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal));
4980     CHECK_FOR_ERROR
4981     (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), val1, val2);
4982     if ((yyval.InstVal) == 0)
4983       GEN_ERROR("binary operator returned null!");
4984     delete (yyvsp[-3].TypeVal);
4985   ;}
4986     break;
4987
4988   case 271:
4989 #line 2341 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4990     {
4991     if (!(*(yyvsp[-3].TypeVal))->isIntegral()) {
4992       if (!isa<PackedType>((yyvsp[-3].TypeVal)->get()) ||
4993           !cast<PackedType>((yyvsp[-3].TypeVal)->get())->getElementType()->isIntegral())
4994         GEN_ERROR("Logical operator requires integral operands!");
4995     }
4996     Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal));
4997     CHECK_FOR_ERROR
4998     Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal));
4999     CHECK_FOR_ERROR
5000     (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), tmpVal1, tmpVal2);
5001     if ((yyval.InstVal) == 0)
5002       GEN_ERROR("binary operator returned null!");
5003     delete (yyvsp[-3].TypeVal);
5004   ;}
5005     break;
5006
5007   case 272:
5008 #line 2356 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5009     {
5010     if(isa<PackedType>((*(yyvsp[-3].TypeVal)).get())) {
5011       GEN_ERROR(
5012         "PackedTypes currently not supported in setcc instructions!");
5013     }
5014     Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal));
5015     CHECK_FOR_ERROR
5016     Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal));
5017     CHECK_FOR_ERROR
5018     (yyval.InstVal) = new SetCondInst((yyvsp[-4].BinaryOpVal), tmpVal1, tmpVal2);
5019     if ((yyval.InstVal) == 0)
5020       GEN_ERROR("binary operator returned null!");
5021     delete (yyvsp[-3].TypeVal);
5022   ;}
5023     break;
5024
5025   case 273:
5026 #line 2370 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5027     {
5028     if (isa<PackedType>((*(yyvsp[-3].TypeVal)).get()))
5029       GEN_ERROR("Packed types not supported by icmp instruction");
5030     Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal));
5031     CHECK_FOR_ERROR
5032     Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal));
5033     CHECK_FOR_ERROR
5034     (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].IPredicate), tmpVal1, tmpVal2);
5035     if ((yyval.InstVal) == 0)
5036       GEN_ERROR("icmp operator returned null!");
5037   ;}
5038     break;
5039
5040   case 274:
5041 #line 2381 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5042     {
5043     if (isa<PackedType>((*(yyvsp[-3].TypeVal)).get()))
5044       GEN_ERROR("Packed types not supported by fcmp instruction");
5045     Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal));
5046     CHECK_FOR_ERROR
5047     Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal));
5048     CHECK_FOR_ERROR
5049     (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].FPredicate), tmpVal1, tmpVal2);
5050     if ((yyval.InstVal) == 0)
5051       GEN_ERROR("fcmp operator returned null!");
5052   ;}
5053     break;
5054
5055   case 275:
5056 #line 2392 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5057     {
5058     llvm_cerr << "WARNING: Use of eliminated 'not' instruction:"
5059               << " Replacing with 'xor'.\n";
5060
5061     Value *Ones = ConstantIntegral::getAllOnesValue((yyvsp[0].ValueVal)->getType());
5062     if (Ones == 0)
5063       GEN_ERROR("Expected integral type for not instruction!");
5064
5065     (yyval.InstVal) = BinaryOperator::create(Instruction::Xor, (yyvsp[0].ValueVal), Ones);
5066     if ((yyval.InstVal) == 0)
5067       GEN_ERROR("Could not create a xor instruction!");
5068     CHECK_FOR_ERROR
5069   ;}
5070     break;
5071
5072   case 276:
5073 #line 2405 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5074     {
5075     if ((yyvsp[0].ValueVal)->getType() != Type::UByteTy)
5076       GEN_ERROR("Shift amount must be ubyte!");
5077     if (!(yyvsp[-2].ValueVal)->getType()->isInteger())
5078       GEN_ERROR("Shift constant expression requires integer operand!");
5079     CHECK_FOR_ERROR;
5080     (yyval.InstVal) = new ShiftInst((yyvsp[-3].OtherOpVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal));
5081     CHECK_FOR_ERROR
5082   ;}
5083     break;
5084
5085   case 277:
5086 #line 2414 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5087     {
5088     Value* Val = (yyvsp[-2].ValueVal);
5089     const Type* Ty = (yyvsp[0].TypeVal)->get();
5090     if (!Val->getType()->isFirstClassType())
5091       GEN_ERROR("cast from a non-primitive type: '" +
5092                 Val->getType()->getDescription() + "'!");
5093     if (!Ty->isFirstClassType())
5094       GEN_ERROR("cast to a non-primitive type: '" + Ty->getDescription() +"'!");
5095     (yyval.InstVal) = CastInst::create((yyvsp[-3].CastOpVal), (yyvsp[-2].ValueVal), (yyvsp[0].TypeVal)->get());
5096     delete (yyvsp[0].TypeVal);
5097   ;}
5098     break;
5099
5100   case 278:
5101 #line 2425 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5102     {
5103     if ((yyvsp[-4].ValueVal)->getType() != Type::BoolTy)
5104       GEN_ERROR("select condition must be boolean!");
5105     if ((yyvsp[-2].ValueVal)->getType() != (yyvsp[0].ValueVal)->getType())
5106       GEN_ERROR("select value types should match!");
5107     (yyval.InstVal) = new SelectInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal));
5108     CHECK_FOR_ERROR
5109   ;}
5110     break;
5111
5112   case 279:
5113 #line 2433 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5114     {
5115     (yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal), *(yyvsp[0].TypeVal));
5116     delete (yyvsp[0].TypeVal);
5117     CHECK_FOR_ERROR
5118   ;}
5119     break;
5120
5121   case 280:
5122 #line 2438 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5123     {
5124     if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)))
5125       GEN_ERROR("Invalid extractelement operands!");
5126     (yyval.InstVal) = new ExtractElementInst((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal));
5127     CHECK_FOR_ERROR
5128   ;}
5129     break;
5130
5131   case 281:
5132 #line 2444 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5133     {
5134     if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)))
5135       GEN_ERROR("Invalid insertelement operands!");
5136     (yyval.InstVal) = new InsertElementInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal));
5137     CHECK_FOR_ERROR
5138   ;}
5139     break;
5140
5141   case 282:
5142 #line 2450 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5143     {
5144     if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)))
5145       GEN_ERROR("Invalid shufflevector operands!");
5146     (yyval.InstVal) = new ShuffleVectorInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal));
5147     CHECK_FOR_ERROR
5148   ;}
5149     break;
5150
5151   case 283:
5152 #line 2456 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5153     {
5154     const Type *Ty = (yyvsp[0].PHIList)->front().first->getType();
5155     if (!Ty->isFirstClassType())
5156       GEN_ERROR("PHI node operands must be of first class type!");
5157     (yyval.InstVal) = new PHINode(Ty);
5158     ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[0].PHIList)->size());
5159     while ((yyvsp[0].PHIList)->begin() != (yyvsp[0].PHIList)->end()) {
5160       if ((yyvsp[0].PHIList)->front().first->getType() != Ty) 
5161         GEN_ERROR("All elements of a PHI node must be of the same type!");
5162       cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[0].PHIList)->front().first, (yyvsp[0].PHIList)->front().second);
5163       (yyvsp[0].PHIList)->pop_front();
5164     }
5165     delete (yyvsp[0].PHIList);  // Free the list...
5166     CHECK_FOR_ERROR
5167   ;}
5168     break;
5169
5170   case 284:
5171 #line 2471 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5172     {
5173     const PointerType *PFTy = 0;
5174     const FunctionType *Ty = 0;
5175
5176     if (!(PFTy = dyn_cast<PointerType>((yyvsp[-4].TypeVal)->get())) ||
5177         !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
5178       // Pull out the types of all of the arguments...
5179       std::vector<const Type*> ParamTypes;
5180       if ((yyvsp[-1].ValueList)) {
5181         for (std::vector<Value*>::iterator I = (yyvsp[-1].ValueList)->begin(), E = (yyvsp[-1].ValueList)->end();
5182              I != E; ++I)
5183           ParamTypes.push_back((*I)->getType());
5184       }
5185
5186       bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy;
5187       if (isVarArg) ParamTypes.pop_back();
5188
5189       if (!(*(yyvsp[-4].TypeVal))->isFirstClassType() && *(yyvsp[-4].TypeVal) != Type::VoidTy)
5190         GEN_ERROR("LLVM functions cannot return aggregate types!");
5191
5192       Ty = FunctionType::get((yyvsp[-4].TypeVal)->get(), ParamTypes, isVarArg);
5193       PFTy = PointerType::get(Ty);
5194     }
5195
5196     Value *V = getVal(PFTy, (yyvsp[-3].ValIDVal));   // Get the function we're calling...
5197     CHECK_FOR_ERROR
5198
5199     // Create the call node...
5200     if (!(yyvsp[-1].ValueList)) {                                   // Has no arguments?
5201       // Make sure no arguments is a good thing!
5202       if (Ty->getNumParams() != 0)
5203         GEN_ERROR("No arguments passed to a function that "
5204                        "expects arguments!");
5205
5206       (yyval.InstVal) = new CallInst(V, std::vector<Value*>());
5207     } else {                                     // Has arguments?
5208       // Loop through FunctionType's arguments and ensure they are specified
5209       // correctly!
5210       //
5211       FunctionType::param_iterator I = Ty->param_begin();
5212       FunctionType::param_iterator E = Ty->param_end();
5213       std::vector<Value*>::iterator ArgI = (yyvsp[-1].ValueList)->begin(), ArgE = (yyvsp[-1].ValueList)->end();
5214
5215       for (; ArgI != ArgE && I != E; ++ArgI, ++I)
5216         if ((*ArgI)->getType() != *I)
5217           GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" +
5218                          (*I)->getDescription() + "'!");
5219
5220       if (I != E || (ArgI != ArgE && !Ty->isVarArg()))
5221         GEN_ERROR("Invalid number of parameters detected!");
5222
5223       (yyval.InstVal) = new CallInst(V, *(yyvsp[-1].ValueList));
5224     }
5225     cast<CallInst>((yyval.InstVal))->setTailCall((yyvsp[-6].BoolVal));
5226     cast<CallInst>((yyval.InstVal))->setCallingConv((yyvsp[-5].UIntVal));
5227     delete (yyvsp[-4].TypeVal);
5228     delete (yyvsp[-1].ValueList);
5229     CHECK_FOR_ERROR
5230   ;}
5231     break;
5232
5233   case 285:
5234 #line 2530 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5235     {
5236     (yyval.InstVal) = (yyvsp[0].InstVal);
5237     CHECK_FOR_ERROR
5238   ;}
5239     break;
5240
5241   case 286:
5242 #line 2537 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5243     { 
5244     (yyval.ValueList) = (yyvsp[0].ValueList); 
5245     CHECK_FOR_ERROR
5246   ;}
5247     break;
5248
5249   case 287:
5250 #line 2540 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5251     { 
5252     (yyval.ValueList) = new std::vector<Value*>(); 
5253     CHECK_FOR_ERROR
5254   ;}
5255     break;
5256
5257   case 288:
5258 #line 2545 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5259     {
5260     (yyval.BoolVal) = true;
5261     CHECK_FOR_ERROR
5262   ;}
5263     break;
5264
5265   case 289:
5266 #line 2549 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5267     {
5268     (yyval.BoolVal) = false;
5269     CHECK_FOR_ERROR
5270   ;}
5271     break;
5272
5273   case 290:
5274 #line 2556 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5275     {
5276     (yyval.InstVal) = new MallocInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal));
5277     delete (yyvsp[-1].TypeVal);
5278     CHECK_FOR_ERROR
5279   ;}
5280     break;
5281
5282   case 291:
5283 #line 2561 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5284     {
5285     Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal));
5286     CHECK_FOR_ERROR
5287     (yyval.InstVal) = new MallocInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal));
5288     delete (yyvsp[-4].TypeVal);
5289   ;}
5290     break;
5291
5292   case 292:
5293 #line 2567 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5294     {
5295     (yyval.InstVal) = new AllocaInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal));
5296     delete (yyvsp[-1].TypeVal);
5297     CHECK_FOR_ERROR
5298   ;}
5299     break;
5300
5301   case 293:
5302 #line 2572 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5303     {
5304     Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal));
5305     CHECK_FOR_ERROR
5306     (yyval.InstVal) = new AllocaInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal));
5307     delete (yyvsp[-4].TypeVal);
5308   ;}
5309     break;
5310
5311   case 294:
5312 #line 2578 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5313     {
5314     if (!isa<PointerType>((yyvsp[0].ValueVal)->getType()))
5315       GEN_ERROR("Trying to free nonpointer type " + 
5316                      (yyvsp[0].ValueVal)->getType()->getDescription() + "!");
5317     (yyval.InstVal) = new FreeInst((yyvsp[0].ValueVal));
5318     CHECK_FOR_ERROR
5319   ;}
5320     break;
5321
5322   case 295:
5323 #line 2586 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5324     {
5325     if (!isa<PointerType>((yyvsp[-1].TypeVal)->get()))
5326       GEN_ERROR("Can't load from nonpointer type: " +
5327                      (*(yyvsp[-1].TypeVal))->getDescription());
5328     if (!cast<PointerType>((yyvsp[-1].TypeVal)->get())->getElementType()->isFirstClassType())
5329       GEN_ERROR("Can't load from pointer of non-first-class type: " +
5330                      (*(yyvsp[-1].TypeVal))->getDescription());
5331     Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal));
5332     CHECK_FOR_ERROR
5333     (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[-3].BoolVal));
5334     delete (yyvsp[-1].TypeVal);
5335   ;}
5336     break;
5337
5338   case 296:
5339 #line 2598 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5340     {
5341     const PointerType *PT = dyn_cast<PointerType>((yyvsp[-1].TypeVal)->get());
5342     if (!PT)
5343       GEN_ERROR("Can't store to a nonpointer type: " +
5344                      (*(yyvsp[-1].TypeVal))->getDescription());
5345     const Type *ElTy = PT->getElementType();
5346     if (ElTy != (yyvsp[-3].ValueVal)->getType())
5347       GEN_ERROR("Can't store '" + (yyvsp[-3].ValueVal)->getType()->getDescription() +
5348                      "' into space of type '" + ElTy->getDescription() + "'!");
5349
5350     Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal));
5351     CHECK_FOR_ERROR
5352     (yyval.InstVal) = new StoreInst((yyvsp[-3].ValueVal), tmpVal, (yyvsp[-5].BoolVal));
5353     delete (yyvsp[-1].TypeVal);
5354   ;}
5355     break;
5356
5357   case 297:
5358 #line 2613 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5359     {
5360     if (!isa<PointerType>((yyvsp[-2].TypeVal)->get()))
5361       GEN_ERROR("getelementptr insn requires pointer operand!");
5362
5363     if (!GetElementPtrInst::getIndexedType(*(yyvsp[-2].TypeVal), *(yyvsp[0].ValueList), true))
5364       GEN_ERROR("Invalid getelementptr indices for type '" +
5365                      (*(yyvsp[-2].TypeVal))->getDescription()+ "'!");
5366     Value* tmpVal = getVal(*(yyvsp[-2].TypeVal), (yyvsp[-1].ValIDVal));
5367     CHECK_FOR_ERROR
5368     (yyval.InstVal) = new GetElementPtrInst(tmpVal, *(yyvsp[0].ValueList));
5369     delete (yyvsp[-2].TypeVal); 
5370     delete (yyvsp[0].ValueList);
5371   ;}
5372     break;
5373
5374
5375       default: break;
5376     }
5377
5378 /* Line 1126 of yacc.c.  */
5379 #line 5380 "llvmAsmParser.tab.c"
5380 \f
5381   yyvsp -= yylen;
5382   yyssp -= yylen;
5383
5384
5385   YY_STACK_PRINT (yyss, yyssp);
5386
5387   *++yyvsp = yyval;
5388
5389
5390   /* Now `shift' the result of the reduction.  Determine what state
5391      that goes to, based on the state we popped back to and the rule
5392      number reduced by.  */
5393
5394   yyn = yyr1[yyn];
5395
5396   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
5397   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
5398     yystate = yytable[yystate];
5399   else
5400     yystate = yydefgoto[yyn - YYNTOKENS];
5401
5402   goto yynewstate;
5403
5404
5405 /*------------------------------------.
5406 | yyerrlab -- here on detecting error |
5407 `------------------------------------*/
5408 yyerrlab:
5409   /* If not already recovering from an error, report this error.  */
5410   if (!yyerrstatus)
5411     {
5412       ++yynerrs;
5413 #if YYERROR_VERBOSE
5414       yyn = yypact[yystate];
5415
5416       if (YYPACT_NINF < yyn && yyn < YYLAST)
5417         {
5418           int yytype = YYTRANSLATE (yychar);
5419           YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
5420           YYSIZE_T yysize = yysize0;
5421           YYSIZE_T yysize1;
5422           int yysize_overflow = 0;
5423           char *yymsg = 0;
5424 #         define YYERROR_VERBOSE_ARGS_MAXIMUM 5
5425           char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
5426           int yyx;
5427
5428 #if 0
5429           /* This is so xgettext sees the translatable formats that are
5430              constructed on the fly.  */
5431           YY_("syntax error, unexpected %s");
5432           YY_("syntax error, unexpected %s, expecting %s");
5433           YY_("syntax error, unexpected %s, expecting %s or %s");
5434           YY_("syntax error, unexpected %s, expecting %s or %s or %s");
5435           YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
5436 #endif
5437           char *yyfmt;
5438           char const *yyf;
5439           static char const yyunexpected[] = "syntax error, unexpected %s";
5440           static char const yyexpecting[] = ", expecting %s";
5441           static char const yyor[] = " or %s";
5442           char yyformat[sizeof yyunexpected
5443                         + sizeof yyexpecting - 1
5444                         + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
5445                            * (sizeof yyor - 1))];
5446           char const *yyprefix = yyexpecting;
5447
5448           /* Start YYX at -YYN if negative to avoid negative indexes in
5449              YYCHECK.  */
5450           int yyxbegin = yyn < 0 ? -yyn : 0;
5451
5452           /* Stay within bounds of both yycheck and yytname.  */
5453           int yychecklim = YYLAST - yyn;
5454           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
5455           int yycount = 1;
5456
5457           yyarg[0] = yytname[yytype];
5458           yyfmt = yystpcpy (yyformat, yyunexpected);
5459
5460           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
5461             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
5462               {
5463                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
5464                   {
5465                     yycount = 1;
5466                     yysize = yysize0;
5467                     yyformat[sizeof yyunexpected - 1] = '\0';
5468                     break;
5469                   }
5470                 yyarg[yycount++] = yytname[yyx];
5471                 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
5472                 yysize_overflow |= yysize1 < yysize;
5473                 yysize = yysize1;
5474                 yyfmt = yystpcpy (yyfmt, yyprefix);
5475                 yyprefix = yyor;
5476               }
5477
5478           yyf = YY_(yyformat);
5479           yysize1 = yysize + yystrlen (yyf);
5480           yysize_overflow |= yysize1 < yysize;
5481           yysize = yysize1;
5482
5483           if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
5484             yymsg = (char *) YYSTACK_ALLOC (yysize);
5485           if (yymsg)
5486             {
5487               /* Avoid sprintf, as that infringes on the user's name space.
5488                  Don't have undefined behavior even if the translation
5489                  produced a string with the wrong number of "%s"s.  */
5490               char *yyp = yymsg;
5491               int yyi = 0;
5492               while ((*yyp = *yyf))
5493                 {
5494                   if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
5495                     {
5496                       yyp += yytnamerr (yyp, yyarg[yyi++]);
5497                       yyf += 2;
5498                     }
5499                   else
5500                     {
5501                       yyp++;
5502                       yyf++;
5503                     }
5504                 }
5505               yyerror (yymsg);
5506               YYSTACK_FREE (yymsg);
5507             }
5508           else
5509             {
5510               yyerror (YY_("syntax error"));
5511               goto yyexhaustedlab;
5512             }
5513         }
5514       else
5515 #endif /* YYERROR_VERBOSE */
5516         yyerror (YY_("syntax error"));
5517     }
5518
5519
5520
5521   if (yyerrstatus == 3)
5522     {
5523       /* If just tried and failed to reuse look-ahead token after an
5524          error, discard it.  */
5525
5526       if (yychar <= YYEOF)
5527         {
5528           /* Return failure if at end of input.  */
5529           if (yychar == YYEOF)
5530             YYABORT;
5531         }
5532       else
5533         {
5534           yydestruct ("Error: discarding", yytoken, &yylval);
5535           yychar = YYEMPTY;
5536         }
5537     }
5538
5539   /* Else will try to reuse look-ahead token after shifting the error
5540      token.  */
5541   goto yyerrlab1;
5542
5543
5544 /*---------------------------------------------------.
5545 | yyerrorlab -- error raised explicitly by YYERROR.  |
5546 `---------------------------------------------------*/
5547 yyerrorlab:
5548
5549   /* Pacify compilers like GCC when the user code never invokes
5550      YYERROR and the label yyerrorlab therefore never appears in user
5551      code.  */
5552   if (0)
5553      goto yyerrorlab;
5554
5555 yyvsp -= yylen;
5556   yyssp -= yylen;
5557   yystate = *yyssp;
5558   goto yyerrlab1;
5559
5560
5561 /*-------------------------------------------------------------.
5562 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
5563 `-------------------------------------------------------------*/
5564 yyerrlab1:
5565   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
5566
5567   for (;;)
5568     {
5569       yyn = yypact[yystate];
5570       if (yyn != YYPACT_NINF)
5571         {
5572           yyn += YYTERROR;
5573           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5574             {
5575               yyn = yytable[yyn];
5576               if (0 < yyn)
5577                 break;
5578             }
5579         }
5580
5581       /* Pop the current state because it cannot handle the error token.  */
5582       if (yyssp == yyss)
5583         YYABORT;
5584
5585
5586       yydestruct ("Error: popping", yystos[yystate], yyvsp);
5587       YYPOPSTACK;
5588       yystate = *yyssp;
5589       YY_STACK_PRINT (yyss, yyssp);
5590     }
5591
5592   if (yyn == YYFINAL)
5593     YYACCEPT;
5594
5595   *++yyvsp = yylval;
5596
5597
5598   /* Shift the error token. */
5599   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5600
5601   yystate = yyn;
5602   goto yynewstate;
5603
5604
5605 /*-------------------------------------.
5606 | yyacceptlab -- YYACCEPT comes here.  |
5607 `-------------------------------------*/
5608 yyacceptlab:
5609   yyresult = 0;
5610   goto yyreturn;
5611
5612 /*-----------------------------------.
5613 | yyabortlab -- YYABORT comes here.  |
5614 `-----------------------------------*/
5615 yyabortlab:
5616   yyresult = 1;
5617   goto yyreturn;
5618
5619 #ifndef yyoverflow
5620 /*-------------------------------------------------.
5621 | yyexhaustedlab -- memory exhaustion comes here.  |
5622 `-------------------------------------------------*/
5623 yyexhaustedlab:
5624   yyerror (YY_("memory exhausted"));
5625   yyresult = 2;
5626   /* Fall through.  */
5627 #endif
5628
5629 yyreturn:
5630   if (yychar != YYEOF && yychar != YYEMPTY)
5631      yydestruct ("Cleanup: discarding lookahead",
5632                  yytoken, &yylval);
5633   while (yyssp != yyss)
5634     {
5635       yydestruct ("Cleanup: popping",
5636                   yystos[*yyssp], yyvsp);
5637       YYPOPSTACK;
5638     }
5639 #ifndef yyoverflow
5640   if (yyss != yyssa)
5641     YYSTACK_FREE (yyss);
5642 #endif
5643   return yyresult;
5644 }
5645
5646
5647 #line 2628 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
5648
5649
5650 void llvm::GenerateError(const std::string &message, int LineNo) {
5651   if (LineNo == -1) LineNo = llvmAsmlineno;
5652   // TODO: column number in exception
5653   if (TheParseError)
5654     TheParseError->setError(CurFilename, message, LineNo);
5655   TriggerError = 1;
5656 }
5657
5658 int yyerror(const char *ErrorMsg) {
5659   std::string where 
5660     = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
5661                   + ":" + utostr((unsigned) llvmAsmlineno) + ": ";
5662   std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
5663   if (yychar == YYEMPTY || yychar == 0)
5664     errMsg += "end-of-file.";
5665   else
5666     errMsg += "token: '" + std::string(llvmAsmtext, llvmAsmleng) + "'";
5667   GenerateError(errMsg);
5668   return 0;
5669 }
5670