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