1 /* A Bison parser, made by GNU Bison 1.875c. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
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)
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.
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., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
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. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
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. */
36 /* Identify Bison output. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
48 /* If NAME_PREFIX is specified substitute the variables and functions
50 #define yyparse Fileparse
52 #define yyerror Fileerror
53 #define yylval Filelval
54 #define yychar Filechar
55 #define yydebug Filedebug
56 #define yynerrs Filenerrs
62 /* Put the tokens into the symbol table, so that GDB and other debuggers
106 #define CODEFRAGMENT 277
111 /* Copy the first part of user declarations. */
112 #line 14 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
115 #include "llvm/ADT/StringExtras.h"
118 #define YYERROR_VERBOSE 1
120 int yyerror(const char *ErrorMsg);
125 extern int Filelineno;
126 static Record *CurRec = 0;
127 static bool ParsingTemplateArgs = false;
129 typedef std::pair<Record*, std::vector<Init*>*> SubClassRefTy;
133 std::vector<unsigned> Bits;
136 LetRecord(const std::string &N, std::vector<unsigned> *B, Init *V)
137 : Name(N), Value(V), HasBits(B != 0) {
138 if (HasBits) Bits = *B;
142 static std::vector<std::vector<LetRecord> > LetStack;
145 extern std::ostream &err();
147 static void addValue(const RecordVal &RV) {
148 if (RecordVal *ERV = CurRec->getValue(RV.getName())) {
149 // The value already exists in the class, treat this as a set...
150 if (ERV->setValue(RV.getValue())) {
151 err() << "New definition of '" << RV.getName() << "' of type '"
152 << *RV.getType() << "' is incompatible with previous "
153 << "definition of type '" << *ERV->getType() << "'!\n";
157 CurRec->addValue(RV);
161 static void addSuperClass(Record *SC) {
162 if (CurRec->isSubClassOf(SC)) {
163 err() << "Already subclass of '" << SC->getName() << "'!\n";
166 CurRec->addSuperClass(SC);
169 static void setValue(const std::string &ValName,
170 std::vector<unsigned> *BitList, Init *V) {
173 RecordVal *RV = CurRec->getValue(ValName);
175 err() << "Value '" << ValName << "' unknown!\n";
179 // Do not allow assignments like 'X = X'. This will just cause infinite loops
180 // in the resolution machinery.
182 if (VarInit *VI = dynamic_cast<VarInit*>(V))
183 if (VI->getName() == ValName)
186 // If we are assigning to a subset of the bits in the value... then we must be
187 // assigning to a field of BitsRecTy, which must have a BitsInit
191 BitsInit *CurVal = dynamic_cast<BitsInit*>(RV->getValue());
193 err() << "Value '" << ValName << "' is not a bits type!\n";
197 // Convert the incoming value to a bits type of the appropriate size...
198 Init *BI = V->convertInitializerTo(new BitsRecTy(BitList->size()));
200 V->convertInitializerTo(new BitsRecTy(BitList->size()));
201 err() << "Initializer '" << *V << "' not compatible with bit range!\n";
205 // We should have a BitsInit type now...
206 assert(dynamic_cast<BitsInit*>(BI) != 0 || &(std::cerr << *BI) == 0);
207 BitsInit *BInit = (BitsInit*)BI;
209 BitsInit *NewVal = new BitsInit(CurVal->getNumBits());
211 // Loop over bits, assigning values as appropriate...
212 for (unsigned i = 0, e = BitList->size(); i != e; ++i) {
213 unsigned Bit = (*BitList)[i];
214 if (NewVal->getBit(Bit)) {
215 err() << "Cannot set bit #" << Bit << " of value '" << ValName
216 << "' more than once!\n";
219 NewVal->setBit(Bit, BInit->getBit(i));
222 for (unsigned i = 0, e = CurVal->getNumBits(); i != e; ++i)
223 if (NewVal->getBit(i) == 0)
224 NewVal->setBit(i, CurVal->getBit(i));
229 if (RV->setValue(V)) {
230 err() << "Value '" << ValName << "' of type '" << *RV->getType()
231 << "' is incompatible with initializer '" << *V << "'!\n";
236 // addSubClass - Add SC as a subclass to CurRec, resolving TemplateArgs as SC's
237 // template arguments.
238 static void addSubClass(Record *SC, const std::vector<Init*> &TemplateArgs) {
239 // Add all of the values in the subclass into the current class...
240 const std::vector<RecordVal> &Vals = SC->getValues();
241 for (unsigned i = 0, e = Vals.size(); i != e; ++i)
244 const std::vector<std::string> &TArgs = SC->getTemplateArgs();
246 // Ensure that an appropriate number of template arguments are specified...
247 if (TArgs.size() < TemplateArgs.size()) {
248 err() << "ERROR: More template args specified than expected!\n";
250 } else { // This class expects template arguments...
251 // Loop over all of the template arguments, setting them to the specified
252 // value or leaving them as the default if necessary.
253 for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
254 if (i < TemplateArgs.size()) { // A value is specified for this temp-arg?
256 setValue(TArgs[i], 0, TemplateArgs[i]);
259 CurRec->resolveReferencesTo(CurRec->getValue(TArgs[i]));
263 CurRec->removeValue(TArgs[i]);
265 } else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
266 err() << "ERROR: Value not specified for template argument #"
267 << i << " (" << TArgs[i] << ") of subclass '" << SC->getName()
274 // Since everything went well, we can now set the "superclass" list for the
276 const std::vector<Record*> &SCs = SC->getSuperClasses();
277 for (unsigned i = 0, e = SCs.size(); i != e; ++i)
278 addSuperClass(SCs[i]);
282 } // End llvm namespace
284 using namespace llvm;
288 /* Enabling traces. */
293 /* Enabling verbose error messages. */
294 #ifdef YYERROR_VERBOSE
295 # undef YYERROR_VERBOSE
296 # define YYERROR_VERBOSE 1
298 # define YYERROR_VERBOSE 0
301 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
302 #line 189 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
303 typedef union YYSTYPE {
307 llvm::Init* Initializer;
308 std::vector<llvm::Init*>* FieldList;
309 std::vector<unsigned>* BitList;
311 SubClassRefTy* SubClassRef;
312 std::vector<SubClassRefTy>* SubClassList;
313 std::vector<std::pair<llvm::Init*, std::string> >* DagValueList;
315 /* Line 191 of yacc.c. */
316 #line 317 "FileParser.tab.c"
317 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
318 # define YYSTYPE_IS_DECLARED 1
319 # define YYSTYPE_IS_TRIVIAL 1
324 /* Copy the second part of user declarations. */
327 /* Line 214 of yacc.c. */
328 #line 329 "FileParser.tab.c"
330 #if ! defined (yyoverflow) || YYERROR_VERBOSE
336 # define YYMALLOC malloc
339 /* The parser invokes alloca or malloc; define the necessary symbols. */
341 # ifdef YYSTACK_USE_ALLOCA
342 # if YYSTACK_USE_ALLOCA
343 # define YYSTACK_ALLOC alloca
346 # if defined (alloca) || defined (_ALLOCA_H)
347 # define YYSTACK_ALLOC alloca
350 # define YYSTACK_ALLOC __builtin_alloca
355 # ifdef YYSTACK_ALLOC
356 /* Pacify GCC's `empty if-body' warning. */
357 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
359 # if defined (__STDC__) || defined (__cplusplus)
360 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
361 # define YYSIZE_T size_t
363 # define YYSTACK_ALLOC YYMALLOC
364 # define YYSTACK_FREE YYFREE
366 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
369 #if (! defined (yyoverflow) \
370 && (! defined (__cplusplus) \
371 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
373 /* A type that is properly aligned for any stack member. */
380 /* The size of the maximum gap between one aligned stack and the next. */
381 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
383 /* The size of an array large to enough to hold all stacks, each with
385 # define YYSTACK_BYTES(N) \
386 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
387 + YYSTACK_GAP_MAXIMUM)
389 /* Copy COUNT objects from FROM to TO. The source and destination do
392 # if defined (__GNUC__) && 1 < __GNUC__
393 # define YYCOPY(To, From, Count) \
394 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
396 # define YYCOPY(To, From, Count) \
399 register YYSIZE_T yyi; \
400 for (yyi = 0; yyi < (Count); yyi++) \
401 (To)[yyi] = (From)[yyi]; \
407 /* Relocate STACK from its old location to the new one. The
408 local variables YYSIZE and YYSTACKSIZE give the old and new number of
409 elements in the stack, and YYPTR gives the new location of the
410 stack. Advance YYPTR to a properly aligned location for the next
412 # define YYSTACK_RELOCATE(Stack) \
415 YYSIZE_T yynewbytes; \
416 YYCOPY (&yyptr->Stack, Stack, yysize); \
417 Stack = &yyptr->Stack; \
418 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
419 yyptr += yynewbytes / sizeof (*yyptr); \
425 #if defined (__STDC__) || defined (__cplusplus)
426 typedef signed char yysigned_char;
428 typedef short yysigned_char;
431 /* YYFINAL -- State number of the termination state. */
433 /* YYLAST -- Last index in YYTABLE. */
436 /* YYNTOKENS -- Number of terminals. */
438 /* YYNNTS -- Number of nonterminals. */
440 /* YYNRULES -- Number of rules. */
442 /* YYNRULES -- Number of states. */
443 #define YYNSTATES 152
445 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
447 #define YYMAXUTOK 277
449 #define YYTRANSLATE(YYX) \
450 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
452 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
453 static const unsigned char yytranslate[] =
455 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 32, 33, 2, 2, 34, 36, 31, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 35, 37,
461 23, 25, 24, 26, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 29, 2, 30, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 27, 2, 28, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
481 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
482 15, 16, 17, 18, 19, 20, 21, 22
486 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
488 static const unsigned char yyprhs[] =
490 0, 0, 3, 5, 7, 9, 14, 16, 21, 23,
491 25, 27, 28, 30, 31, 34, 36, 38, 40, 42,
492 46, 48, 53, 57, 61, 66, 71, 78, 85, 92,
493 93, 96, 99, 104, 105, 107, 109, 113, 116, 120,
494 126, 131, 133, 134, 138, 139, 141, 143, 147, 152,
495 155, 162, 163, 166, 168, 172, 174, 179, 181, 185,
496 186, 189, 191, 195, 199, 200, 202, 204, 205, 206,
497 207, 214, 217, 220, 222, 224, 229, 231, 235, 236,
498 241, 246, 249, 251, 254
501 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
502 static const yysigned_char yyrhs[] =
504 74, 0, -1, 19, -1, 5, -1, 4, -1, 6,
505 23, 18, 24, -1, 3, -1, 7, 23, 40, 24,
506 -1, 8, -1, 9, -1, 39, -1, -1, 12, -1,
507 -1, 25, 43, -1, 18, -1, 21, -1, 22, -1,
508 26, -1, 27, 50, 28, -1, 19, -1, 43, 27,
509 48, 28, -1, 29, 50, 30, -1, 43, 31, 19,
510 -1, 32, 19, 46, 33, -1, 43, 29, 48, 30,
511 -1, 15, 32, 43, 34, 43, 33, -1, 16, 32,
512 43, 34, 43, 33, -1, 17, 32, 43, 34, 43,
513 33, -1, -1, 35, 20, -1, 43, 44, -1, 45,
514 34, 43, 44, -1, -1, 45, -1, 18, -1, 18,
515 36, 18, -1, 18, 18, -1, 47, 34, 18, -1,
516 47, 34, 18, 36, 18, -1, 47, 34, 18, 18,
517 -1, 47, -1, -1, 27, 48, 28, -1, -1, 51,
518 -1, 43, -1, 51, 34, 43, -1, 41, 40, 19,
519 42, -1, 52, 37, -1, 13, 19, 49, 25, 43,
520 37, -1, -1, 54, 53, -1, 37, -1, 27, 54,
521 28, -1, 39, -1, 39, 23, 51, 24, -1, 56,
522 -1, 57, 34, 56, -1, -1, 35, 57, -1, 52,
523 -1, 59, 34, 52, -1, 23, 59, 24, -1, -1,
524 60, -1, 19, -1, -1, -1, -1, 62, 64, 61,
525 58, 65, 55, -1, 10, 63, -1, 11, 63, -1,
526 66, -1, 67, -1, 19, 49, 25, 43, -1, 69,
527 -1, 70, 34, 69, -1, -1, 13, 72, 70, 14,
528 -1, 71, 27, 73, 28, -1, 71, 68, -1, 68,
529 -1, 73, 68, -1, 73, -1
532 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
533 static const unsigned short yyrline[] =
535 0, 223, 223, 234, 236, 238, 240, 242, 244, 246,
536 248, 252, 252, 254, 254, 256, 258, 261, 264, 266,
537 279, 294, 301, 304, 311, 319, 327, 333, 339, 347,
538 350, 354, 359, 365, 368, 371, 374, 387, 401, 403,
539 416, 432, 434, 434, 438, 440, 444, 447, 451, 461,
540 463, 469, 469, 470, 470, 472, 474, 478, 483, 488,
541 491, 495, 498, 503, 504, 504, 506, 506, 508, 515,
542 508, 535, 543, 560, 560, 562, 567, 567, 570, 570,
543 573, 576, 580, 580, 582
547 #if YYDEBUG || YYERROR_VERBOSE
548 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
549 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
550 static const char *const yytname[] =
552 "$end", "error", "$undefined", "INT", "BIT", "STRING", "BITS", "LIST",
553 "CODE", "DAG", "CLASS", "DEF", "FIELD", "LET", "IN", "SHLTOK", "SRATOK",
554 "SRLTOK", "INTVAL", "ID", "VARNAME", "STRVAL", "CODEFRAGMENT", "'<'",
555 "'>'", "'='", "'?'", "'{'", "'}'", "'['", "']'", "'.'", "'('", "')'",
556 "','", "':'", "'-'", "';'", "$accept", "ClassID", "Type", "OptPrefix",
557 "OptValue", "Value", "OptVarName", "DagArgListNE", "DagArgList",
558 "RBitList", "BitList", "OptBitList", "ValueList", "ValueListNE",
559 "Declaration", "BodyItem", "BodyList", "Body", "SubClassRef",
560 "ClassListNE", "ClassList", "DeclListNE", "TemplateArgList",
561 "OptTemplateArgList", "OptID", "ObjectBody", "@1", "@2", "ClassInst",
562 "DefInst", "Object", "LETItem", "LETList", "LETCommand", "@3",
563 "ObjectList", "File", 0
568 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
570 static const unsigned short yytoknum[] =
572 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
573 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
574 275, 276, 277, 60, 62, 61, 63, 123, 125, 91,
575 93, 46, 40, 41, 44, 58, 45, 59
579 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
580 static const unsigned char yyr1[] =
582 0, 38, 39, 40, 40, 40, 40, 40, 40, 40,
583 40, 41, 41, 42, 42, 43, 43, 43, 43, 43,
584 43, 43, 43, 43, 43, 43, 43, 43, 43, 44,
585 44, 45, 45, 46, 46, 47, 47, 47, 47, 47,
586 47, 48, 49, 49, 50, 50, 51, 51, 52, 53,
587 53, 54, 54, 55, 55, 56, 56, 57, 57, 58,
588 58, 59, 59, 60, 61, 61, 62, 62, 64, 65,
589 63, 66, 67, 68, 68, 69, 70, 70, 72, 71,
593 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
594 static const unsigned char yyr2[] =
596 0, 2, 1, 1, 1, 4, 1, 4, 1, 1,
597 1, 0, 1, 0, 2, 1, 1, 1, 1, 3,
598 1, 4, 3, 3, 4, 4, 6, 6, 6, 0,
599 2, 2, 4, 0, 1, 1, 3, 2, 3, 5,
600 4, 1, 0, 3, 0, 1, 1, 3, 4, 2,
601 6, 0, 2, 1, 3, 1, 4, 1, 3, 0,
602 2, 1, 3, 3, 0, 1, 1, 0, 0, 0,
603 6, 2, 2, 1, 1, 4, 1, 3, 0, 4,
607 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
608 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
609 means the default is an error. */
610 static const unsigned char yydefact[] =
612 0, 67, 67, 78, 73, 74, 82, 0, 84, 0,
613 66, 68, 71, 72, 0, 0, 81, 83, 1, 64,
614 42, 76, 0, 0, 11, 65, 59, 0, 0, 79,
615 0, 80, 12, 0, 61, 0, 0, 69, 35, 41,
616 0, 0, 77, 6, 4, 3, 0, 0, 8, 9,
617 2, 10, 0, 63, 11, 55, 57, 60, 0, 37,
618 0, 0, 43, 0, 0, 0, 15, 20, 16, 17,
619 18, 44, 44, 0, 75, 0, 0, 13, 62, 0,
620 0, 51, 53, 70, 36, 38, 0, 0, 0, 46,
621 0, 45, 0, 33, 0, 0, 0, 0, 0, 0,
622 48, 0, 58, 11, 40, 0, 0, 0, 0, 19,
623 0, 22, 29, 34, 0, 0, 0, 23, 5, 7,
624 14, 56, 0, 54, 0, 52, 39, 0, 0, 0,
625 47, 0, 31, 0, 24, 21, 25, 42, 49, 0,
626 0, 0, 30, 29, 0, 26, 27, 28, 32, 0,
630 /* YYDEFGOTO[NTERM-NUM]. */
631 static const short yydefgoto[] =
633 -1, 51, 52, 33, 100, 89, 132, 113, 114, 39,
634 40, 28, 90, 91, 34, 125, 103, 83, 56, 57,
635 37, 35, 25, 26, 11, 12, 19, 58, 4, 5,
636 6, 21, 22, 7, 14, 8, 9
639 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
641 #define YYPACT_NINF -54
642 static const yysigned_char yypact[] =
644 61, -7, -7, -54, -54, -54, -54, 4, 61, 24,
645 -54, -54, -54, -54, 23, 61, -54, -54, -54, 18,
646 29, -54, -12, -5, 55, -54, 38, 65, 69, -54,
647 23, -54, -54, 56, -54, -14, 71, -54, -15, 64,
648 72, 11, -54, -54, -54, -54, 81, 83, -54, -54,
649 -54, -54, 91, -54, 55, 89, -54, 80, 12, -54,
650 100, 101, -54, 88, 90, 92, -54, -54, -54, -54,
651 -54, 11, 11, 102, 26, 105, 56, 103, -54, 11,
652 71, -54, -54, -54, -54, -11, 11, 11, 11, 26,
653 97, 93, 96, 11, 65, 65, 110, 106, 107, 11,
654 -54, 20, -54, 6, -54, 114, -18, 62, 68, -54,
655 11, -54, 50, 99, 104, 108, 109, -54, -54, -54,
656 26, -54, 115, -54, 98, -54, -54, 11, 11, 11,
657 26, 118, -54, 11, -54, -54, -54, 29, -54, 51,
658 74, 82, -54, 50, 116, -54, -54, -54, -54, 11,
662 /* YYPGOTO[NTERM-NUM]. */
663 static const short yypgoto[] =
665 -54, -32, 66, -54, -54, -41, -3, -54, -54, -54,
666 22, 7, 73, 67, -53, -54, -54, -54, 63, -54,
667 -54, -54, -54, -54, -54, 145, -54, -54, -54, -54,
668 28, 119, -54, -54, -54, 133, -54
671 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
672 positive, shift that token. If negative, reduce the rule which
673 number is the opposite. If zero, do what YYDEFACT says.
674 If YYTABLE_NINF, syntax error. */
675 #define YYTABLE_NINF -1
676 static const unsigned char yytable[] =
678 74, 78, 29, 59, 55, 1, 2, 104, 3, 94,
679 53, 95, 10, 96, 1, 2, 127, 3, 32, 122,
680 54, 60, 30, 31, 18, 105, 63, 64, 65, 66,
681 67, 15, 68, 69, 123, 16, 17, 70, 71, 81,
682 72, 24, 20, 73, 121, 106, 107, 108, 55, 82,
683 124, 17, 112, 94, 110, 95, 27, 96, 120, 43,
684 44, 45, 46, 47, 48, 49, 94, 32, 95, 130,
685 96, 1, 2, 36, 3, 50, 151, 94, 94, 95,
686 95, 96, 96, 38, 145, 131, 139, 140, 141, 94,
687 50, 95, 143, 96, 41, 94, 128, 95, 61, 96,
688 62, 94, 129, 95, 75, 96, 76, 146, 150, 94,
689 77, 95, 79, 96, 80, 147, 115, 116, 84, 85,
690 86, 93, 87, 97, 88, 109, 111, 110, 99, 117,
691 118, 119, 126, 133, 137, 138, 135, 134, 142, 136,
692 148, 149, 98, 102, 144, 92, 101, 13, 23, 42
695 static const unsigned char yycheck[] =
697 41, 54, 14, 18, 36, 10, 11, 18, 13, 27,
698 24, 29, 19, 31, 10, 11, 34, 13, 12, 13,
699 34, 36, 34, 28, 0, 36, 15, 16, 17, 18,
700 19, 27, 21, 22, 28, 7, 8, 26, 27, 27,
701 29, 23, 19, 32, 24, 86, 87, 88, 80, 37,
702 103, 23, 93, 27, 34, 29, 27, 31, 99, 3,
703 4, 5, 6, 7, 8, 9, 27, 12, 29, 110,
704 31, 10, 11, 35, 13, 19, 37, 27, 27, 29,
705 29, 31, 31, 18, 33, 35, 127, 128, 129, 27,
706 19, 29, 133, 31, 25, 27, 34, 29, 34, 31,
707 28, 27, 34, 29, 23, 31, 23, 33, 149, 27,
708 19, 29, 23, 31, 34, 33, 94, 95, 18, 18,
709 32, 19, 32, 18, 32, 28, 30, 34, 25, 19,
710 24, 24, 18, 34, 19, 37, 28, 33, 20, 30,
711 143, 25, 76, 80, 137, 72, 79, 2, 15, 30
714 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
715 symbol of state STATE-NUM. */
716 static const unsigned char yystos[] =
718 0, 10, 11, 13, 66, 67, 68, 71, 73, 74,
719 19, 62, 63, 63, 72, 27, 68, 68, 0, 64,
720 19, 69, 70, 73, 23, 60, 61, 27, 49, 14,
721 34, 28, 12, 41, 52, 59, 35, 58, 18, 47,
722 48, 25, 69, 3, 4, 5, 6, 7, 8, 9,
723 19, 39, 40, 24, 34, 39, 56, 57, 65, 18,
724 36, 34, 28, 15, 16, 17, 18, 19, 21, 22,
725 26, 27, 29, 32, 43, 23, 23, 19, 52, 23,
726 34, 27, 37, 55, 18, 18, 32, 32, 32, 43,
727 50, 51, 50, 19, 27, 29, 31, 18, 40, 25,
728 42, 51, 56, 54, 18, 36, 43, 43, 43, 28,
729 34, 30, 43, 45, 46, 48, 48, 19, 24, 24,
730 43, 24, 13, 28, 52, 53, 18, 34, 34, 34,
731 43, 35, 44, 34, 33, 28, 30, 19, 37, 43,
732 43, 43, 20, 43, 49, 33, 33, 33, 44, 25,
736 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
737 # define YYSIZE_T __SIZE_TYPE__
739 #if ! defined (YYSIZE_T) && defined (size_t)
740 # define YYSIZE_T size_t
742 #if ! defined (YYSIZE_T)
743 # if defined (__STDC__) || defined (__cplusplus)
744 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
745 # define YYSIZE_T size_t
748 #if ! defined (YYSIZE_T)
749 # define YYSIZE_T unsigned int
752 #define yyerrok (yyerrstatus = 0)
753 #define yyclearin (yychar = YYEMPTY)
757 #define YYACCEPT goto yyacceptlab
758 #define YYABORT goto yyabortlab
759 #define YYERROR goto yyerrorlab
762 /* Like YYERROR except do call yyerror. This remains here temporarily
763 to ease the transition to the new meaning of YYERROR, for GCC.
764 Once GCC version 2 has supplanted version 1, this can go. */
766 #define YYFAIL goto yyerrlab
768 #define YYRECOVERING() (!!yyerrstatus)
770 #define YYBACKUP(Token, Value) \
772 if (yychar == YYEMPTY && yylen == 1) \
776 yytoken = YYTRANSLATE (yychar); \
782 yyerror ("syntax error: cannot back up");\
788 #define YYERRCODE 256
790 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
793 #ifndef YYLLOC_DEFAULT
794 # define YYLLOC_DEFAULT(Current, Rhs, N) \
795 ((Current).first_line = (Rhs)[1].first_line, \
796 (Current).first_column = (Rhs)[1].first_column, \
797 (Current).last_line = (Rhs)[N].last_line, \
798 (Current).last_column = (Rhs)[N].last_column)
801 /* YYLEX -- calling `yylex' with the right arguments. */
804 # define YYLEX yylex (YYLEX_PARAM)
806 # define YYLEX yylex ()
809 /* Enable debugging if requested. */
813 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
814 # define YYFPRINTF fprintf
817 # define YYDPRINTF(Args) \
823 # define YYDSYMPRINT(Args) \
829 # define YYDSYMPRINTF(Title, Token, Value, Location) \
833 YYFPRINTF (stderr, "%s ", Title); \
834 yysymprint (stderr, \
836 YYFPRINTF (stderr, "\n"); \
840 /*------------------------------------------------------------------.
841 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
843 `------------------------------------------------------------------*/
845 #if defined (__STDC__) || defined (__cplusplus)
847 yy_stack_print (short *bottom, short *top)
850 yy_stack_print (bottom, top)
855 YYFPRINTF (stderr, "Stack now");
856 for (/* Nothing. */; bottom <= top; ++bottom)
857 YYFPRINTF (stderr, " %d", *bottom);
858 YYFPRINTF (stderr, "\n");
861 # define YY_STACK_PRINT(Bottom, Top) \
864 yy_stack_print ((Bottom), (Top)); \
868 /*------------------------------------------------.
869 | Report that the YYRULE is going to be reduced. |
870 `------------------------------------------------*/
872 #if defined (__STDC__) || defined (__cplusplus)
874 yy_reduce_print (int yyrule)
877 yy_reduce_print (yyrule)
882 unsigned int yylno = yyrline[yyrule];
883 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
885 /* Print the symbols being reduced, and their result. */
886 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
887 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
888 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
891 # define YY_REDUCE_PRINT(Rule) \
894 yy_reduce_print (Rule); \
897 /* Nonzero means print parse trace. It is left uninitialized so that
898 multiple parsers can coexist. */
901 # define YYDPRINTF(Args)
902 # define YYDSYMPRINT(Args)
903 # define YYDSYMPRINTF(Title, Token, Value, Location)
904 # define YY_STACK_PRINT(Bottom, Top)
905 # define YY_REDUCE_PRINT(Rule)
906 #endif /* !YYDEBUG */
909 /* YYINITDEPTH -- initial size of the parser's stacks. */
911 # define YYINITDEPTH 200
914 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
915 if the built-in stack extension method is used).
917 Do not make this value too large; the results are undefined if
918 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
919 evaluated with infinite-precision integer arithmetic. */
921 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
926 # define YYMAXDEPTH 10000
934 # if defined (__GLIBC__) && defined (_STRING_H)
935 # define yystrlen strlen
937 /* Return the length of YYSTR. */
939 # if defined (__STDC__) || defined (__cplusplus)
940 yystrlen (const char *yystr)
946 register const char *yys = yystr;
948 while (*yys++ != '\0')
951 return yys - yystr - 1;
957 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
958 # define yystpcpy stpcpy
960 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
963 # if defined (__STDC__) || defined (__cplusplus)
964 yystpcpy (char *yydest, const char *yysrc)
966 yystpcpy (yydest, yysrc)
971 register char *yyd = yydest;
972 register const char *yys = yysrc;
974 while ((*yyd++ = *yys++) != '\0')
982 #endif /* !YYERROR_VERBOSE */
987 /*--------------------------------.
988 | Print this symbol on YYOUTPUT. |
989 `--------------------------------*/
991 #if defined (__STDC__) || defined (__cplusplus)
993 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
996 yysymprint (yyoutput, yytype, yyvaluep)
1002 /* Pacify ``unused variable'' warnings. */
1005 if (yytype < YYNTOKENS)
1007 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1009 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1013 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1020 YYFPRINTF (yyoutput, ")");
1023 #endif /* ! YYDEBUG */
1024 /*-----------------------------------------------.
1025 | Release the memory associated to this symbol. |
1026 `-----------------------------------------------*/
1028 #if defined (__STDC__) || defined (__cplusplus)
1030 yydestruct (int yytype, YYSTYPE *yyvaluep)
1033 yydestruct (yytype, yyvaluep)
1038 /* Pacify ``unused variable'' warnings. */
1050 /* Prevent warnings from -Wmissing-prototypes. */
1052 #ifdef YYPARSE_PARAM
1053 # if defined (__STDC__) || defined (__cplusplus)
1054 int yyparse (void *YYPARSE_PARAM);
1058 #else /* ! YYPARSE_PARAM */
1059 #if defined (__STDC__) || defined (__cplusplus)
1064 #endif /* ! YYPARSE_PARAM */
1068 /* The lookahead symbol. */
1071 /* The semantic value of the lookahead symbol. */
1074 /* Number of syntax errors so far. */
1083 #ifdef YYPARSE_PARAM
1084 # if defined (__STDC__) || defined (__cplusplus)
1085 int yyparse (void *YYPARSE_PARAM)
1087 int yyparse (YYPARSE_PARAM)
1088 void *YYPARSE_PARAM;
1090 #else /* ! YYPARSE_PARAM */
1091 #if defined (__STDC__) || defined (__cplusplus)
1102 register int yystate;
1105 /* Number of tokens to shift before error messages enabled. */
1107 /* Lookahead token as an internal (translated) token number. */
1110 /* Three stacks and their tools:
1111 `yyss': related to states,
1112 `yyvs': related to semantic values,
1113 `yyls': related to locations.
1115 Refer to the stacks thru separate pointers, to allow yyoverflow
1116 to reallocate them elsewhere. */
1118 /* The state stack. */
1119 short yyssa[YYINITDEPTH];
1120 short *yyss = yyssa;
1121 register short *yyssp;
1123 /* The semantic value stack. */
1124 YYSTYPE yyvsa[YYINITDEPTH];
1125 YYSTYPE *yyvs = yyvsa;
1126 register YYSTYPE *yyvsp;
1130 #define YYPOPSTACK (yyvsp--, yyssp--)
1132 YYSIZE_T yystacksize = YYINITDEPTH;
1134 /* The variables used to return semantic value and location from the
1139 /* When reducing, the number of symbols on the RHS of the reduced
1143 YYDPRINTF ((stderr, "Starting parse\n"));
1148 yychar = YYEMPTY; /* Cause a token to be read. */
1150 /* Initialize stack pointers.
1151 Waste one element of value and location stack
1152 so that they stay on the same level as the state stack.
1153 The wasted elements are never initialized. */
1160 /*------------------------------------------------------------.
1161 | yynewstate -- Push a new state, which is found in yystate. |
1162 `------------------------------------------------------------*/
1164 /* In all cases, when you get here, the value and location stacks
1165 have just been pushed. so pushing a state here evens the stacks.
1172 if (yyss + yystacksize - 1 <= yyssp)
1174 /* Get the current used size of the three stacks, in elements. */
1175 YYSIZE_T yysize = yyssp - yyss + 1;
1179 /* Give user a chance to reallocate the stack. Use copies of
1180 these so that the &'s don't force the real ones into
1182 YYSTYPE *yyvs1 = yyvs;
1183 short *yyss1 = yyss;
1186 /* Each stack pointer address is followed by the size of the
1187 data in use in that stack, in bytes. This used to be a
1188 conditional around just the two extra args, but that might
1189 be undefined if yyoverflow is a macro. */
1190 yyoverflow ("parser stack overflow",
1191 &yyss1, yysize * sizeof (*yyssp),
1192 &yyvs1, yysize * sizeof (*yyvsp),
1199 #else /* no yyoverflow */
1200 # ifndef YYSTACK_RELOCATE
1203 /* Extend the stack our own way. */
1204 if (YYMAXDEPTH <= yystacksize)
1207 if (YYMAXDEPTH < yystacksize)
1208 yystacksize = YYMAXDEPTH;
1211 short *yyss1 = yyss;
1212 union yyalloc *yyptr =
1213 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1216 YYSTACK_RELOCATE (yyss);
1217 YYSTACK_RELOCATE (yyvs);
1219 # undef YYSTACK_RELOCATE
1221 YYSTACK_FREE (yyss1);
1224 #endif /* no yyoverflow */
1226 yyssp = yyss + yysize - 1;
1227 yyvsp = yyvs + yysize - 1;
1230 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1231 (unsigned long int) yystacksize));
1233 if (yyss + yystacksize - 1 <= yyssp)
1237 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1246 /* Do appropriate processing given the current state. */
1247 /* Read a lookahead token if we need one and don't already have one. */
1250 /* First try to decide what to do without reference to lookahead token. */
1252 yyn = yypact[yystate];
1253 if (yyn == YYPACT_NINF)
1256 /* Not known => get a lookahead token if don't already have one. */
1258 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1259 if (yychar == YYEMPTY)
1261 YYDPRINTF ((stderr, "Reading a token: "));
1265 if (yychar <= YYEOF)
1267 yychar = yytoken = YYEOF;
1268 YYDPRINTF ((stderr, "Now at end of input.\n"));
1272 yytoken = YYTRANSLATE (yychar);
1273 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1276 /* If the proper action on seeing token YYTOKEN is to reduce or to
1277 detect an error, take that action. */
1279 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1284 if (yyn == 0 || yyn == YYTABLE_NINF)
1293 /* Shift the lookahead token. */
1294 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1296 /* Discard the token being shifted unless it is eof. */
1297 if (yychar != YYEOF)
1303 /* Count tokens shifted since error; after three, turn off error
1312 /*-----------------------------------------------------------.
1313 | yydefault -- do the default action for the current state. |
1314 `-----------------------------------------------------------*/
1316 yyn = yydefact[yystate];
1322 /*-----------------------------.
1323 | yyreduce -- Do a reduction. |
1324 `-----------------------------*/
1326 /* yyn is the number of a rule to reduce with. */
1329 /* If YYLEN is nonzero, implement the default value of the action:
1332 Otherwise, the following line sets YYVAL to garbage.
1333 This behavior is undocumented and Bison
1334 users should not rely upon it. Assigning to YYVAL
1335 unconditionally makes the parser a bit smaller, and it avoids a
1336 GCC warning that YYVAL may be used uninitialized. */
1337 yyval = yyvsp[1-yylen];
1340 YY_REDUCE_PRINT (yyn);
1344 #line 223 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1346 yyval.Rec = Records.getClass(*yyvsp[0].StrVal);
1347 if (yyval.Rec == 0) {
1348 err() << "Couldn't find class '" << *yyvsp[0].StrVal << "'!\n";
1351 delete yyvsp[0].StrVal;
1356 #line 234 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1358 yyval.Ty = new StringRecTy();
1363 #line 236 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1365 yyval.Ty = new BitRecTy();
1370 #line 238 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1372 yyval.Ty = new BitsRecTy(yyvsp[-1].IntVal);
1377 #line 240 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1379 yyval.Ty = new IntRecTy();
1384 #line 242 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1386 yyval.Ty = new ListRecTy(yyvsp[-1].Ty);
1391 #line 244 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1393 yyval.Ty = new CodeRecTy();
1398 #line 246 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1400 yyval.Ty = new DagRecTy();
1405 #line 248 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1407 yyval.Ty = new RecordRecTy(yyvsp[0].Rec);
1412 #line 252 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1413 { yyval.IntVal = 0; ;}
1417 #line 252 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1418 { yyval.IntVal = 1; ;}
1422 #line 254 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1423 { yyval.Initializer = 0; ;}
1427 #line 254 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1428 { yyval.Initializer = yyvsp[0].Initializer; ;}
1432 #line 256 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1434 yyval.Initializer = new IntInit(yyvsp[0].IntVal);
1439 #line 258 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1441 yyval.Initializer = new StringInit(*yyvsp[0].StrVal);
1442 delete yyvsp[0].StrVal;
1447 #line 261 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1449 yyval.Initializer = new CodeInit(*yyvsp[0].StrVal);
1450 delete yyvsp[0].StrVal;
1455 #line 264 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1457 yyval.Initializer = new UnsetInit();
1462 #line 266 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1464 BitsInit *Init = new BitsInit(yyvsp[-1].FieldList->size());
1465 for (unsigned i = 0, e = yyvsp[-1].FieldList->size(); i != e; ++i) {
1466 struct Init *Bit = (*yyvsp[-1].FieldList)[i]->convertInitializerTo(new BitRecTy());
1468 err() << "Element #" << i << " (" << *(*yyvsp[-1].FieldList)[i]
1469 << ") is not convertable to a bit!\n";
1472 Init->setBit(yyvsp[-1].FieldList->size()-i-1, Bit);
1474 yyval.Initializer = Init;
1475 delete yyvsp[-1].FieldList;
1480 #line 279 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1482 if (const RecordVal *RV = (CurRec ? CurRec->getValue(*yyvsp[0].StrVal) : 0)) {
1483 yyval.Initializer = new VarInit(*yyvsp[0].StrVal, RV->getType());
1484 } else if (CurRec && CurRec->isTemplateArg(CurRec->getName()+":"+*yyvsp[0].StrVal)) {
1485 const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*yyvsp[0].StrVal);
1486 assert(RV && "Template arg doesn't exist??");
1487 yyval.Initializer = new VarInit(CurRec->getName()+":"+*yyvsp[0].StrVal, RV->getType());
1488 } else if (Record *D = Records.getDef(*yyvsp[0].StrVal)) {
1489 yyval.Initializer = new DefInit(D);
1491 err() << "Variable not defined: '" << *yyvsp[0].StrVal << "'!\n";
1495 delete yyvsp[0].StrVal;
1500 #line 294 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1502 yyval.Initializer = yyvsp[-3].Initializer->convertInitializerBitRange(*yyvsp[-1].BitList);
1503 if (yyval.Initializer == 0) {
1504 err() << "Invalid bit range for value '" << *yyvsp[-3].Initializer << "'!\n";
1507 delete yyvsp[-1].BitList;
1512 #line 301 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1514 yyval.Initializer = new ListInit(*yyvsp[-1].FieldList);
1515 delete yyvsp[-1].FieldList;
1520 #line 304 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1522 if (!yyvsp[-2].Initializer->getFieldType(*yyvsp[0].StrVal)) {
1523 err() << "Cannot access field '" << *yyvsp[0].StrVal << "' of value '" << *yyvsp[-2].Initializer << "!\n";
1526 yyval.Initializer = new FieldInit(yyvsp[-2].Initializer, *yyvsp[0].StrVal);
1527 delete yyvsp[0].StrVal;
1532 #line 311 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1534 Record *D = Records.getDef(*yyvsp[-2].StrVal);
1536 err() << "Invalid def '" << *yyvsp[-2].StrVal << "'!\n";
1539 yyval.Initializer = new DagInit(D, *yyvsp[-1].DagValueList);
1540 delete yyvsp[-2].StrVal; delete yyvsp[-1].DagValueList;
1545 #line 319 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1547 std::reverse(yyvsp[-1].BitList->begin(), yyvsp[-1].BitList->end());
1548 yyval.Initializer = yyvsp[-3].Initializer->convertInitListSlice(*yyvsp[-1].BitList);
1549 if (yyval.Initializer == 0) {
1550 err() << "Invalid list slice for value '" << *yyvsp[-3].Initializer << "'!\n";
1553 delete yyvsp[-1].BitList;
1558 #line 327 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1560 yyval.Initializer = yyvsp[-3].Initializer->getBinaryOp(Init::SHL, yyvsp[-1].Initializer);
1561 if (yyval.Initializer == 0) {
1562 err() << "Cannot shift values '" << *yyvsp[-3].Initializer << "' and '" << *yyvsp[-1].Initializer << "'!\n";
1569 #line 333 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1571 yyval.Initializer = yyvsp[-3].Initializer->getBinaryOp(Init::SRA, yyvsp[-1].Initializer);
1572 if (yyval.Initializer == 0) {
1573 err() << "Cannot shift values '" << *yyvsp[-3].Initializer << "' and '" << *yyvsp[-1].Initializer << "'!\n";
1580 #line 339 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1582 yyval.Initializer = yyvsp[-3].Initializer->getBinaryOp(Init::SRL, yyvsp[-1].Initializer);
1583 if (yyval.Initializer == 0) {
1584 err() << "Cannot shift values '" << *yyvsp[-3].Initializer << "' and '" << *yyvsp[-1].Initializer << "'!\n";
1591 #line 347 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1593 yyval.StrVal = new std::string();
1598 #line 350 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1600 yyval.StrVal = yyvsp[0].StrVal;
1605 #line 354 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1607 yyval.DagValueList = new std::vector<std::pair<Init*, std::string> >();
1608 yyval.DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
1609 delete yyvsp[0].StrVal;
1614 #line 359 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1616 yyvsp[-3].DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
1617 delete yyvsp[0].StrVal;
1618 yyval.DagValueList = yyvsp[-3].DagValueList;
1623 #line 365 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1625 yyval.DagValueList = new std::vector<std::pair<Init*, std::string> >();
1630 #line 368 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1631 { yyval.DagValueList = yyvsp[0].DagValueList; ;}
1635 #line 371 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1637 yyval.BitList = new std::vector<unsigned>();
1638 yyval.BitList->push_back(yyvsp[0].IntVal);
1643 #line 374 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1645 if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
1646 err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
1649 yyval.BitList = new std::vector<unsigned>();
1650 if (yyvsp[-2].IntVal < yyvsp[0].IntVal) {
1651 for (int i = yyvsp[-2].IntVal; i <= yyvsp[0].IntVal; ++i)
1652 yyval.BitList->push_back(i);
1654 for (int i = yyvsp[-2].IntVal; i >= yyvsp[0].IntVal; --i)
1655 yyval.BitList->push_back(i);
1661 #line 387 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1663 yyvsp[0].IntVal = -yyvsp[0].IntVal;
1664 if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
1665 err() << "Invalid range: " << yyvsp[-1].IntVal << "-" << yyvsp[0].IntVal << "!\n";
1668 yyval.BitList = new std::vector<unsigned>();
1669 if (yyvsp[-1].IntVal < yyvsp[0].IntVal) {
1670 for (int i = yyvsp[-1].IntVal; i <= yyvsp[0].IntVal; ++i)
1671 yyval.BitList->push_back(i);
1673 for (int i = yyvsp[-1].IntVal; i >= yyvsp[0].IntVal; --i)
1674 yyval.BitList->push_back(i);
1680 #line 401 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1682 (yyval.BitList=yyvsp[-2].BitList)->push_back(yyvsp[0].IntVal);
1687 #line 403 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1689 if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
1690 err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
1693 yyval.BitList = yyvsp[-4].BitList;
1694 if (yyvsp[-2].IntVal < yyvsp[0].IntVal) {
1695 for (int i = yyvsp[-2].IntVal; i <= yyvsp[0].IntVal; ++i)
1696 yyval.BitList->push_back(i);
1698 for (int i = yyvsp[-2].IntVal; i >= yyvsp[0].IntVal; --i)
1699 yyval.BitList->push_back(i);
1705 #line 416 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1707 yyvsp[0].IntVal = -yyvsp[0].IntVal;
1708 if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
1709 err() << "Invalid range: " << yyvsp[-1].IntVal << "-" << yyvsp[0].IntVal << "!\n";
1712 yyval.BitList = yyvsp[-3].BitList;
1713 if (yyvsp[-1].IntVal < yyvsp[0].IntVal) {
1714 for (int i = yyvsp[-1].IntVal; i <= yyvsp[0].IntVal; ++i)
1715 yyval.BitList->push_back(i);
1717 for (int i = yyvsp[-1].IntVal; i >= yyvsp[0].IntVal; --i)
1718 yyval.BitList->push_back(i);
1724 #line 432 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1725 { yyval.BitList = yyvsp[0].BitList; std::reverse(yyvsp[0].BitList->begin(), yyvsp[0].BitList->end()); ;}
1729 #line 434 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1730 { yyval.BitList = 0; ;}
1734 #line 434 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1735 { yyval.BitList = yyvsp[-1].BitList; ;}
1739 #line 438 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1741 yyval.FieldList = new std::vector<Init*>();
1746 #line 440 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1748 yyval.FieldList = yyvsp[0].FieldList;
1753 #line 444 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1755 yyval.FieldList = new std::vector<Init*>();
1756 yyval.FieldList->push_back(yyvsp[0].Initializer);
1761 #line 447 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1763 (yyval.FieldList = yyvsp[-2].FieldList)->push_back(yyvsp[0].Initializer);
1768 #line 451 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1770 std::string DecName = *yyvsp[-1].StrVal;
1771 if (ParsingTemplateArgs)
1772 DecName = CurRec->getName() + ":" + DecName;
1774 addValue(RecordVal(DecName, yyvsp[-2].Ty, yyvsp[-3].IntVal));
1775 setValue(DecName, 0, yyvsp[0].Initializer);
1776 yyval.StrVal = new std::string(DecName);
1781 #line 461 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1783 delete yyvsp[-1].StrVal;
1788 #line 463 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1790 setValue(*yyvsp[-4].StrVal, yyvsp[-3].BitList, yyvsp[-1].Initializer);
1791 delete yyvsp[-4].StrVal;
1792 delete yyvsp[-3].BitList;
1797 #line 472 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1799 yyval.SubClassRef = new SubClassRefTy(yyvsp[0].Rec, new std::vector<Init*>());
1804 #line 474 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1806 yyval.SubClassRef = new SubClassRefTy(yyvsp[-3].Rec, yyvsp[-1].FieldList);
1811 #line 478 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1813 yyval.SubClassList = new std::vector<SubClassRefTy>();
1814 yyval.SubClassList->push_back(*yyvsp[0].SubClassRef);
1815 delete yyvsp[0].SubClassRef;
1820 #line 483 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1822 (yyval.SubClassList=yyvsp[-2].SubClassList)->push_back(*yyvsp[0].SubClassRef);
1823 delete yyvsp[0].SubClassRef;
1828 #line 488 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1830 yyval.SubClassList = new std::vector<SubClassRefTy>();
1835 #line 491 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1837 yyval.SubClassList = yyvsp[0].SubClassList;
1842 #line 495 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1844 CurRec->addTemplateArg(*yyvsp[0].StrVal);
1845 delete yyvsp[0].StrVal;
1850 #line 498 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1852 CurRec->addTemplateArg(*yyvsp[0].StrVal);
1853 delete yyvsp[0].StrVal;
1858 #line 503 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1863 #line 506 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1864 { yyval.StrVal = yyvsp[0].StrVal; ;}
1868 #line 506 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1869 { yyval.StrVal = new std::string(); ;}
1873 #line 508 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1875 static unsigned AnonCounter = 0;
1876 if (yyvsp[0].StrVal->empty())
1877 *yyvsp[0].StrVal = "anonymous."+utostr(AnonCounter++);
1878 CurRec = new Record(*yyvsp[0].StrVal);
1879 delete yyvsp[0].StrVal;
1880 ParsingTemplateArgs = true;
1885 #line 515 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1887 ParsingTemplateArgs = false;
1888 for (unsigned i = 0, e = yyvsp[0].SubClassList->size(); i != e; ++i) {
1889 addSubClass((*yyvsp[0].SubClassList)[i].first, *(*yyvsp[0].SubClassList)[i].second);
1890 // Delete the template arg values for the class
1891 delete (*yyvsp[0].SubClassList)[i].second;
1893 delete yyvsp[0].SubClassList; // Delete the class list...
1895 // Process any variables on the set stack...
1896 for (unsigned i = 0, e = LetStack.size(); i != e; ++i)
1897 for (unsigned j = 0, e = LetStack[i].size(); j != e; ++j)
1898 setValue(LetStack[i][j].Name,
1899 LetStack[i][j].HasBits ? &LetStack[i][j].Bits : 0,
1900 LetStack[i][j].Value);
1905 #line 530 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1913 #line 535 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1915 if (Records.getClass(yyvsp[0].Rec->getName())) {
1916 err() << "Class '" << yyvsp[0].Rec->getName() << "' already defined!\n";
1919 Records.addClass(yyval.Rec = yyvsp[0].Rec);
1924 #line 543 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1926 yyvsp[0].Rec->resolveReferences();
1928 if (!yyvsp[0].Rec->getTemplateArgs().empty()) {
1929 err() << "Def '" << yyvsp[0].Rec->getName()
1930 << "' is not permitted to have template arguments!\n";
1933 // If ObjectBody has template arguments, it's an error.
1934 if (Records.getDef(yyvsp[0].Rec->getName())) {
1935 err() << "Def '" << yyvsp[0].Rec->getName() << "' already defined!\n";
1938 Records.addDef(yyval.Rec = yyvsp[0].Rec);
1943 #line 562 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1945 LetStack.back().push_back(LetRecord(*yyvsp[-3].StrVal, yyvsp[-2].BitList, yyvsp[0].Initializer));
1946 delete yyvsp[-3].StrVal; delete yyvsp[-2].BitList;
1951 #line 570 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1952 { LetStack.push_back(std::vector<LetRecord>()); ;}
1956 #line 573 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1958 LetStack.pop_back();
1963 #line 576 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1965 LetStack.pop_back();
1970 #line 580 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1975 #line 580 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1980 #line 582 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
1987 /* Line 1000 of yacc.c. */
1988 #line 1989 "FileParser.tab.c"
1994 YY_STACK_PRINT (yyss, yyssp);
1999 /* Now `shift' the result of the reduction. Determine what state
2000 that goes to, based on the state we popped back to and the rule
2001 number reduced by. */
2005 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2006 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2007 yystate = yytable[yystate];
2009 yystate = yydefgoto[yyn - YYNTOKENS];
2014 /*------------------------------------.
2015 | yyerrlab -- here on detecting error |
2016 `------------------------------------*/
2018 /* If not already recovering from an error, report this error. */
2023 yyn = yypact[yystate];
2025 if (YYPACT_NINF < yyn && yyn < YYLAST)
2027 YYSIZE_T yysize = 0;
2028 int yytype = YYTRANSLATE (yychar);
2029 const char* yyprefix;
2033 /* Start YYX at -YYN if negative to avoid negative indexes in
2035 int yyxbegin = yyn < 0 ? -yyn : 0;
2037 /* Stay within bounds of both yycheck and yytname. */
2038 int yychecklim = YYLAST - yyn;
2039 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2042 yyprefix = ", expecting ";
2043 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2044 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2046 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
2054 yysize += (sizeof ("syntax error, unexpected ")
2055 + yystrlen (yytname[yytype]));
2056 yymsg = (char *) YYSTACK_ALLOC (yysize);
2059 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2060 yyp = yystpcpy (yyp, yytname[yytype]);
2064 yyprefix = ", expecting ";
2065 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2066 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2068 yyp = yystpcpy (yyp, yyprefix);
2069 yyp = yystpcpy (yyp, yytname[yyx]);
2074 YYSTACK_FREE (yymsg);
2077 yyerror ("syntax error; also virtual memory exhausted");
2080 #endif /* YYERROR_VERBOSE */
2081 yyerror ("syntax error");
2086 if (yyerrstatus == 3)
2088 /* If just tried and failed to reuse lookahead token after an
2089 error, discard it. */
2091 if (yychar <= YYEOF)
2093 /* If at end of input, pop the error token,
2094 then the rest of the stack, then return failure. */
2095 if (yychar == YYEOF)
2101 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2102 yydestruct (yystos[*yyssp], yyvsp);
2107 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2108 yydestruct (yytoken, &yylval);
2114 /* Else will try to reuse lookahead token after shifting the error
2119 /*---------------------------------------------------.
2120 | yyerrorlab -- error raised explicitly by YYERROR. |
2121 `---------------------------------------------------*/
2125 /* Pacify GCC when the user code never invokes YYERROR and the label
2126 yyerrorlab therefore never appears in user code. */
2137 /*-------------------------------------------------------------.
2138 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2139 `-------------------------------------------------------------*/
2141 yyerrstatus = 3; /* Each real token shifted decrements this. */
2145 yyn = yypact[yystate];
2146 if (yyn != YYPACT_NINF)
2149 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2157 /* Pop the current state because it cannot handle the error token. */
2161 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2162 yydestruct (yystos[yystate], yyvsp);
2165 YY_STACK_PRINT (yyss, yyssp);
2171 YYDPRINTF ((stderr, "Shifting error token, "));
2180 /*-------------------------------------.
2181 | yyacceptlab -- YYACCEPT comes here. |
2182 `-------------------------------------*/
2187 /*-----------------------------------.
2188 | yyabortlab -- YYABORT comes here. |
2189 `-----------------------------------*/
2195 /*----------------------------------------------.
2196 | yyoverflowlab -- parser overflow comes here. |
2197 `----------------------------------------------*/
2199 yyerror ("parser stack overflow");
2207 YYSTACK_FREE (yyss);
2213 #line 584 "/proj/llvm/build/../llvm/utils/TableGen/FileParser.y"
2216 int yyerror(const char *ErrorMsg) {
2217 err() << "Error parsing: " << ErrorMsg << "\n";