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