llvm.org GIT mirror llvm / 1480e25
Merge from mainline. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_21@42085 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 13 years ago
3 changed file(s) with 1650 addition(s) and 2487 deletion(s). Raw diff Collapse all Expand all
2020 /* A lexical scanner generated by flex */
2121
2222 /* Scanner skeleton version:
23 * $Header$
23 * $Header: /cvs/root/flex/flex/skel.c,v 1.2 2004/05/07 00:28:17 jkh Exp $
2424 */
2525
2626 #define FLEX_SCANNER
501501 #define YY_MORE_ADJ 0
502502 #define YY_RESTORE_YY_MORE_OFFSET
503503 char *yytext;
504 #line 1 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
504 #line 1 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
505505 #define INITIAL 0
506506 /*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
507507 //
519519 #define YY_NEVER_INTERACTIVE 1
520520 #define comment 1
521521
522 #line 30 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
522 #line 30 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
523523 #include "llvm/Config/config.h"
524524 #include "llvm/Support/Streams.h"
525525 #include "Record.h"
816816 register char *yy_cp, *yy_bp;
817817 register int yy_act;
818818
819 #line 185 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
819 #line 185 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
820820
821821
822822 #line 824 "Lexer.cpp"
912912 { /* beginning of action switch */
913913 case 1:
914914 YY_RULE_SETUP
915 #line 187 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
915 #line 187 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
916916 { /* Ignore comments */ }
917917 YY_BREAK
918918 case 2:
919919 YY_RULE_SETUP
920 #line 189 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
920 #line 189 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
921921 { HandleInclude(yytext); }
922922 YY_BREAK
923923 case 3:
924924 YY_RULE_SETUP
925 #line 190 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
925 #line 190 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
926926 { Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
927927 return CODEFRAGMENT; }
928928 YY_BREAK
929929 case 4:
930930 YY_RULE_SETUP
931 #line 193 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
931 #line 193 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
932932 { return INT; }
933933 YY_BREAK
934934 case 5:
935935 YY_RULE_SETUP
936 #line 194 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
936 #line 194 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
937937 { return BIT; }
938938 YY_BREAK
939939 case 6:
940940 YY_RULE_SETUP
941 #line 195 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
941 #line 195 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
942942 { return BITS; }
943943 YY_BREAK
944944 case 7:
945945 YY_RULE_SETUP
946 #line 196 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
946 #line 196 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
947947 { return STRING; }
948948 YY_BREAK
949949 case 8:
950950 YY_RULE_SETUP
951 #line 197 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
951 #line 197 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
952952 { return LIST; }
953953 YY_BREAK
954954 case 9:
955955 YY_RULE_SETUP
956 #line 198 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
956 #line 198 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
957957 { return CODE; }
958958 YY_BREAK
959959 case 10:
960960 YY_RULE_SETUP
961 #line 199 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
961 #line 199 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
962962 { return DAG; }
963963 YY_BREAK
964964 case 11:
965965 YY_RULE_SETUP
966 #line 201 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
966 #line 201 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
967967 { return CLASS; }
968968 YY_BREAK
969969 case 12:
970970 YY_RULE_SETUP
971 #line 202 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
971 #line 202 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
972972 { return DEF; }
973973 YY_BREAK
974974 case 13:
975975 YY_RULE_SETUP
976 #line 203 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
976 #line 203 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
977977 { return DEFM; }
978978 YY_BREAK
979979 case 14:
980980 YY_RULE_SETUP
981 #line 204 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
981 #line 204 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
982982 { return MULTICLASS; }
983983 YY_BREAK
984984 case 15:
985985 YY_RULE_SETUP
986 #line 205 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
986 #line 205 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
987987 { return FIELD; }
988988 YY_BREAK
989989 case 16:
990990 YY_RULE_SETUP
991 #line 206 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
991 #line 206 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
992992 { return LET; }
993993 YY_BREAK
994994 case 17:
995995 YY_RULE_SETUP
996 #line 207 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
996 #line 207 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
997997 { return IN; }
998998 YY_BREAK
999999 case 18:
10001000 YY_RULE_SETUP
1001 #line 209 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1001 #line 209 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10021002 { return CONCATTOK; }
10031003 YY_BREAK
10041004 case 19:
10051005 YY_RULE_SETUP
1006 #line 210 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1006 #line 210 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10071007 { return SRATOK; }
10081008 YY_BREAK
10091009 case 20:
10101010 YY_RULE_SETUP
1011 #line 211 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1011 #line 211 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10121012 { return SRLTOK; }
10131013 YY_BREAK
10141014 case 21:
10151015 YY_RULE_SETUP
1016 #line 212 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1016 #line 212 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10171017 { return SHLTOK; }
10181018 YY_BREAK
10191019 case 22:
10201020 YY_RULE_SETUP
1021 #line 213 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1021 #line 213 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10221022 { return STRCONCATTOK; }
10231023 YY_BREAK
10241024 case 23:
10251025 YY_RULE_SETUP
1026 #line 216 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1026 #line 216 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10271027 { Filelval.StrVal = new std::string(yytext, yytext+yyleng);
10281028 return ID; }
10291029 YY_BREAK
10301030 case 24:
10311031 YY_RULE_SETUP
1032 #line 218 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1032 #line 218 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10331033 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
10341034 return VARNAME; }
10351035 YY_BREAK
10361036 case 25:
10371037 YY_RULE_SETUP
1038 #line 221 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1038 #line 221 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10391039 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
10401040 return STRVAL; }
10411041 YY_BREAK
10421042 case 26:
10431043 YY_RULE_SETUP
1044 #line 224 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1044 #line 224 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10451045 { Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
10461046 YY_BREAK
10471047 case 27:
10481048 YY_RULE_SETUP
1049 #line 226 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1049 #line 226 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10501050 { /* Ignore whitespace */ }
10511051 YY_BREAK
10521052 case 28:
10531053 YY_RULE_SETUP
1054 #line 229 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1054 #line 229 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10551055 { BEGIN(comment); CommentDepth++; }
10561056 YY_BREAK
10571057 case 29:
10581058 YY_RULE_SETUP
1059 #line 230 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1059 #line 230 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10601060 {} /* eat anything that's not a '*' or '/' */
10611061 YY_BREAK
10621062 case 30:
10631063 YY_RULE_SETUP
1064 #line 231 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1064 #line 231 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10651065 {} /* eat up '*'s not followed by '/'s */
10661066 YY_BREAK
10671067 case 31:
10681068 YY_RULE_SETUP
1069 #line 232 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1069 #line 232 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10701070 { ++CommentDepth; }
10711071 YY_BREAK
10721072 case 32:
10731073 YY_RULE_SETUP
1074 #line 233 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1074 #line 233 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10751075 {} /* eat up /'s not followed by *'s */
10761076 YY_BREAK
10771077 case 33:
10781078 YY_RULE_SETUP
1079 #line 234 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1079 #line 234 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10801080 { if (!--CommentDepth) { BEGIN(INITIAL); } }
10811081 YY_BREAK
10821082 case YY_STATE_EOF(comment):
1083 #line 235 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1083 #line 235 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10841084 { err() << "Unterminated comment!\n"; exit(1); }
10851085 YY_BREAK
10861086 case 34:
10871087 YY_RULE_SETUP
1088 #line 237 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1088 #line 237 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10891089 { return Filetext[0]; }
10901090 YY_BREAK
10911091 case 35:
10921092 YY_RULE_SETUP
1093 #line 239 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1093 #line 239 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
10941094 YY_FATAL_ERROR( "flex scanner jammed" );
10951095 YY_BREAK
10961096 #line 1098 "Lexer.cpp"
19771977 return 0;
19781978 }
19791979 #endif
1980 #line 239 "/Volumes/Wildlings/echeng/llvm/utils/TableGen/FileLexer.l"
1981
1982
1980 #line 239 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1981
1982
None /* A Bison parser, made by GNU Bison 2.3. */
1
2 /* Skeleton implementation for Bison's Yacc-like parsers in C
3
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
5 Free Software Foundation, Inc.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA. */
21
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
31
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
34
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
37
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
44
45 /* Identify Bison output. */
46 #define YYBISON 1
47
48 /* Bison version. */
49 #define YYBISON_VERSION "2.3"
50
51 /* Skeleton name. */
52 #define YYSKELETON_NAME "yacc.c"
53
54 /* Pure parsers. */
55 #define YYPURE 0
56
57 /* Using locations. */
58 #define YYLSP_NEEDED 0
59
60 /* Substitute the variable and function names. */
0
1 /* A Bison parser, made from /Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y
2 by GNU Bison version 1.28 */
3
4 #define YYBISON 1 /* Identify Bison output. */
5
616 #define yyparse Fileparse
62 #define yylex Filelex
7 #define yylex Filelex
638 #define yyerror Fileerror
64 #define yylval Filelval
65 #define yychar Filechar
9 #define yylval Filelval
10 #define yychar Filechar
6611 #define yydebug Filedebug
6712 #define yynerrs Filenerrs
68
69
70 /* Tokens. */
71 #ifndef YYTOKENTYPE
72 # define YYTOKENTYPE
73 /* Put the tokens into the symbol table, so that GDB and other debuggers
74 know about them. */
75 enum yytokentype {
76 INT = 258,
77 BIT = 259,
78 STRING = 260,
79 BITS = 261,
80 LIST = 262,
81 CODE = 263,
82 DAG = 264,
83 CLASS = 265,
84 DEF = 266,
85 MULTICLASS = 267,
86 DEFM = 268,
87 FIELD = 269,
88 LET = 270,
89 IN = 271,
90 SHLTOK = 272,
91 SRATOK = 273,
92 SRLTOK = 274,
93 STRCONCATTOK = 275,
94 INTVAL = 276,
95 ID = 277,
96 VARNAME = 278,
97 STRVAL = 279,
98 CODEFRAGMENT = 280
99 };
100 #endif
101 /* Tokens. */
102 #define INT 258
103 #define BIT 259
104 #define STRING 260
105 #define BITS 261
106 #define LIST 262
107 #define CODE 263
108 #define DAG 264
109 #define CLASS 265
110 #define DEF 266
111 #define MULTICLASS 267
112 #define DEFM 268
113 #define FIELD 269
114 #define LET 270
115 #define IN 271
116 #define SHLTOK 272
117 #define SRATOK 273
118 #define SRLTOK 274
119 #define STRCONCATTOK 275
120 #define INTVAL 276
121 #define ID 277
122 #define VARNAME 278
123 #define STRVAL 279
124 #define CODEFRAGMENT 280
125
126
127
128
129 /* Copy the first part of user declarations. */
130 #line 14 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
13 #define INT 257
14 #define BIT 258
15 #define STRING 259
16 #define BITS 260
17 #define LIST 261
18 #define CODE 262
19 #define DAG 263
20 #define CLASS 264
21 #define DEF 265
22 #define MULTICLASS 266
23 #define DEFM 267
24 #define FIELD 268
25 #define LET 269
26 #define IN 270
27 #define CONCATTOK 271
28 #define SHLTOK 272
29 #define SRATOK 273
30 #define SRLTOK 274
31 #define STRCONCATTOK 275
32 #define INTVAL 276
33 #define ID 277
34 #define VARNAME 278
35 #define STRVAL 279
36 #define CODEFRAGMENT 280
37
38 #line 14 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
13139
13240 #include "Record.h"
13341 #include "llvm/ADT/StringExtras.h"
323231 using namespace llvm;
324232
325233
326
327 /* Enabling traces. */
328 #ifndef YYDEBUG
329 # define YYDEBUG 0
330 #endif
331
332 /* Enabling verbose error messages. */
333 #ifdef YYERROR_VERBOSE
334 # undef YYERROR_VERBOSE
335 # define YYERROR_VERBOSE 1
336 #else
337 # define YYERROR_VERBOSE 0
338 #endif
339
340 /* Enabling the token table. */
341 #ifndef YYTOKEN_TABLE
342 # define YYTOKEN_TABLE 0
343 #endif
344
345 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
346 typedef union YYSTYPE
347 #line 210 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
348 {
234 #line 210 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
235 typedef union {
349236 std::string* StrVal;
350237 int IntVal;
351238 llvm::RecTy* Ty;
357244 SubClassRefTy* SubClassRef;
358245 std::vector* SubClassList;
359246 std::vector >* DagValueList;
360 }
361 /* Line 193 of yacc.c. */
362 #line 364 "FileParser.tab.c"
363 YYSTYPE;
364 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
365 # define YYSTYPE_IS_DECLARED 1
366 # define YYSTYPE_IS_TRIVIAL 1
367 #endif
368
369
370
371 /* Copy the second part of user declarations. */
372
373
374 /* Line 216 of yacc.c. */
375 #line 377 "FileParser.tab.c"
376
377 #ifdef short
378 # undef short
379 #endif
380
381 #ifdef YYTYPE_UINT8
382 typedef YYTYPE_UINT8 yytype_uint8;
247 } YYSTYPE;
248 #include
249
250 #ifndef __cplusplus
251 #ifndef __STDC__
252 #define const
253 #endif
254 #endif
255
256
257
258 #define YYFINAL 194
259 #define YYFLAG -32768
260 #define YYNTBASE 42
261
262 #define YYTRANSLATE(x) ((unsigned)(x) <= 280 ? yytranslate[x] : 91)
263
264 static const char yytranslate[] = { 0,
265 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
266 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
267 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
268 2, 2, 2, 2, 2, 2, 2, 2, 2, 36,
269 37, 2, 2, 38, 40, 35, 2, 2, 2, 2,
270 2, 2, 2, 2, 2, 2, 2, 39, 41, 27,
271 29, 28, 30, 2, 2, 2, 2, 2, 2, 2,
272 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
273 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
274 33, 2, 34, 2, 2, 2, 2, 2, 2, 2,
275 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
277 2, 2, 31, 2, 32, 2, 2, 2, 2, 2,
278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
282 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
286 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
287 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
288 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
289 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
290 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
291 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
292 17, 18, 19, 20, 21, 22, 23, 24, 25, 26
293 };
294
295 #if YYDEBUG != 0
296 static const short yyprhs[] = { 0,
297 0, 2, 4, 6, 11, 13, 18, 20, 22, 24,
298 25, 27, 28, 31, 33, 35, 37, 39, 41, 43,
299 47, 52, 57, 61, 65, 70, 75, 82, 89, 96,
300 103, 110, 111, 114, 117, 122, 123, 125, 127, 131,
301 134, 138, 144, 149, 151, 152, 156, 157, 159, 161,
302 165, 170, 173, 180, 181, 184, 186, 190, 192, 197,
303 199, 203, 204, 207, 209, 213, 217, 218, 220, 222,
304 223, 225, 227, 229, 230, 234, 235, 236, 243, 247,
305 249, 251, 254, 256, 257, 258, 267, 268, 275, 277,
306 279, 281, 283, 288, 290, 294, 295, 300, 305, 308,
307 310, 313
308 };
309
310 static const short yyrhs[] = { 23,
311 0, 5, 0, 4, 0, 6, 27, 22, 28, 0,
312 3, 0, 7, 27, 43, 28, 0, 8, 0, 9,
313 0, 42, 0, 0, 14, 0, 0, 29, 47, 0,
314 23, 0, 46, 0, 22, 0, 25, 0, 26, 0,
315 30, 0, 31, 54, 32, 0, 23, 27, 55, 28,
316 0, 47, 31, 52, 32, 0, 33, 54, 34, 0,
317 47, 35, 23, 0, 36, 46, 50, 37, 0, 47,
318 33, 52, 34, 0, 17, 36, 47, 38, 47, 37,
319 0, 18, 36, 47, 38, 47, 37, 0, 19, 36,
320 47, 38, 47, 37, 0, 20, 36, 47, 38, 47,
321 37, 0, 21, 36, 47, 38, 47, 37, 0, 0,
322 39, 24, 0, 47, 48, 0, 49, 38, 47, 48,
323 0, 0, 49, 0, 22, 0, 22, 40, 22, 0,
324 22, 22, 0, 51, 38, 22, 0, 51, 38, 22,
325 40, 22, 0, 51, 38, 22, 22, 0, 51, 0,
326 0, 31, 52, 32, 0, 0, 55, 0, 47, 0,
327 55, 38, 47, 0, 44, 43, 23, 45, 0, 56,
328 41, 0, 15, 23, 53, 29, 47, 41, 0, 0,
329 58, 57, 0, 41, 0, 31, 58, 32, 0, 42,
330 0, 42, 27, 55, 28, 0, 60, 0, 61, 38,
331 60, 0, 0, 39, 61, 0, 56, 0, 63, 38,
332 56, 0, 27, 63, 28, 0, 0, 64, 0, 23,
333 0, 0, 66, 0, 67, 0, 67, 0, 0, 62,
334 71, 59, 0, 0, 0, 10, 68, 73, 65, 74,
335 70, 0, 11, 69, 70, 0, 75, 0, 76, 0,
336 77, 76, 0, 23, 0, 0, 0, 12, 78, 80,
337 65, 81, 31, 77, 32, 0, 0, 13, 23, 83,
338 39, 60, 41, 0, 72, 0, 75, 0, 79, 0,
339 82, 0, 23, 53, 29, 47, 0, 85, 0, 86,
340 38, 85, 0, 0, 15, 88, 86, 16, 0, 87,
341 31, 89, 32, 0, 87, 84, 0, 84, 0, 89,
342 84, 0, 89, 0
343 };
344
345 #endif
346
347 #if YYDEBUG != 0
348 static const short yyrline[] = { 0,
349 246, 268, 270, 272, 274, 276, 278, 280, 282, 286,
350 286, 288, 288, 290, 313, 315, 317, 320, 323, 325,
351 338, 366, 373, 376, 383, 386, 394, 396, 398, 400,
352 402, 406, 409, 413, 418, 424, 427, 430, 433, 446,
353 460, 462, 475, 491, 493, 493, 497, 499, 503, 506,
354 510, 527, 529, 535, 535, 536, 536, 538, 540, 544,
355 549, 554, 557, 561, 564, 569, 570, 570, 572, 572,
356 574, 581, 599, 624, 638, 643, 645, 647, 651, 661,
357 675, 678, 682, 693, 695, 697, 702, 702, 776, 776,
358 777, 777, 779, 784, 784, 787, 787, 790, 793, 797,
359 797, 799
360 };
361 #endif
362
363
364 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
365
366 static const char * const yytname[] = { "$","error","$undefined.","INT","BIT",
367 "STRING","BITS","LIST","CODE","DAG","CLASS","DEF","MULTICLASS","DEFM","FIELD",
368 "LET","IN","CONCATTOK","SHLTOK","SRATOK","SRLTOK","STRCONCATTOK","INTVAL","ID",
369 "VARNAME","STRVAL","CODEFRAGMENT","'<'","'>'","'='","'?'","'{'","'}'","'['",
370 "']'","'.'","'('","')'","','","':'","'-'","';'","ClassID","Type","OptPrefix",
371 "OptValue","IDValue","Value","OptVarName","DagArgListNE","DagArgList","RBitList",
372 "BitList","OptBitList","ValueList","ValueListNE","Declaration","BodyItem","BodyList",
373 "Body","SubClassRef","ClassListNE","ClassList","DeclListNE","TemplateArgList",
374 "OptTemplateArgList","OptID","ObjectName","ClassName","DefName","ObjectBody",
375 "@1","ClassInst","@2","@3","DefInst","MultiClassDef","MultiClassBody","MultiClassName",
376 "MultiClassInst","@4","@5","DefMInst","@6","Object","LETItem","LETList","LETCommand",
377 "@7","ObjectList","File", NULL
378 };
379 #endif
380
381 static const short yyr1[] = { 0,
382 42, 43, 43, 43, 43, 43, 43, 43, 43, 44,
383 44, 45, 45, 46, 47, 47, 47, 47, 47, 47,
384 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
385 47, 48, 48, 49, 49, 50, 50, 51, 51, 51,
386 51, 51, 51, 52, 53, 53, 54, 54, 55, 55,
387 56, 57, 57, 58, 58, 59, 59, 60, 60, 61,
388 61, 62, 62, 63, 63, 64, 65, 65, 66, 66,
389 67, 68, 69, 71, 70, 73, 74, 72, 75, 76,
390 77, 77, 78, 80, 81, 79, 83, 82, 84, 84,
391 84, 84, 85, 86, 86, 88, 87, 84, 84, 89,
392 89, 90
393 };
394
395 static const short yyr2[] = { 0,
396 1, 1, 1, 4, 1, 4, 1, 1, 1, 0,
397 1, 0, 2, 1, 1, 1, 1, 1, 1, 3,
398 4, 4, 3, 3, 4, 4, 6, 6, 6, 6,
399 6, 0, 2, 2, 4, 0, 1, 1, 3, 2,
400 3, 5, 4, 1, 0, 3, 0, 1, 1, 3,
401 4, 2, 6, 0, 2, 1, 3, 1, 4, 1,
402 3, 0, 2, 1, 3, 3, 0, 1, 1, 0,
403 1, 1, 1, 0, 3, 0, 0, 6, 3, 1,
404 1, 2, 1, 0, 0, 8, 0, 6, 1, 1,
405 1, 1, 4, 1, 3, 0, 4, 4, 2, 1,
406 2, 1
407 };
408
409 static const short yydefact[] = { 0,
410 70, 70, 0, 0, 96, 89, 90, 91, 92, 100,
411 0, 102, 69, 71, 72, 76, 73, 62, 83, 84,
412 87, 0, 0, 99, 101, 67, 0, 74, 79, 67,
413 0, 45, 94, 0, 0, 10, 68, 77, 1, 58,
414 60, 63, 0, 85, 0, 0, 0, 97, 0, 98,
415 11, 0, 64, 0, 62, 0, 0, 54, 56, 75,
416 0, 0, 38, 44, 0, 0, 95, 5, 3, 2,
417 0, 0, 7, 8, 9, 0, 66, 10, 78, 0,
418 0, 0, 0, 0, 16, 14, 17, 18, 19, 47,
419 47, 0, 15, 49, 0, 61, 10, 0, 88, 40,
420 0, 0, 46, 93, 0, 0, 12, 65, 0, 0,
421 0, 0, 0, 0, 0, 48, 0, 14, 36, 0,
422 0, 0, 59, 0, 0, 57, 0, 55, 80, 81,
423 0, 39, 41, 0, 0, 0, 51, 0, 0, 0,
424 0, 0, 0, 20, 23, 32, 37, 0, 0, 0,
425 24, 50, 45, 52, 86, 82, 43, 0, 4, 6,
426 13, 0, 0, 0, 0, 0, 21, 0, 34, 0,
427 25, 22, 26, 0, 42, 0, 0, 0, 0, 0,
428 33, 32, 0, 27, 28, 29, 30, 31, 35, 0,
429 53, 0, 0, 0
430 };
431
432 static const short yydefgoto[] = { 40,
433 76, 52, 137, 93, 94, 169, 147, 148, 64, 65,
434 47, 115, 116, 53, 128, 97, 60, 41, 42, 28,
435 54, 37, 38, 14, 15, 16, 18, 29, 43, 6,
436 26, 55, 7, 130, 131, 20, 8, 30, 61, 9,
437 31, 10, 33, 34, 11, 22, 12, 192
438 };
439
440 static const short yypact[] = { 147,
441 -17, -17, 8, 12,-32768,-32768,-32768,-32768,-32768,-32768,
442 3, 147,-32768,-32768,-32768,-32768,-32768, -13,-32768,-32768,
443 -32768, 17, 147,-32768,-32768, 21, 58,-32768,-32768, 21,
444 45, 55,-32768, -5, -3, 77,-32768,-32768,-32768, 68,
445 -32768, 64, -4,-32768, 58, 84, 81,-32768, 17,-32768,
446 -32768, 16,-32768, 13, -13, 43, 58,-32768,-32768,-32768,
447 88, 74, 10, 83, 93, 43,-32768,-32768,-32768,-32768,
448 100, 104,-32768,-32768,-32768, 110,-32768, 77,-32768, 117,
449 125, 127, 128, 129,-32768, 139,-32768,-32768,-32768, 43,
450 43, 132,-32768, 59, 14,-32768, 40, 156,-32768,-32768,
451 146, 148,-32768, 59, 149, 16, 140,-32768, 43, 43,
452 43, 43, 43, 43, 141, 134, 142,-32768, 43, 84,
453 84, 151,-32768, 43, 152,-32768, 136,-32768,-32768,-32768,
454 6,-32768, 35, 150, 153, 43,-32768, 70, 76, 85,
455 91, 97, 39,-32768,-32768, 54, 144, 143, 154, 145,
456 -32768, 59, 55,-32768,-32768,-32768,-32768, 161,-32768,-32768,
457 59, 43, 43, 43, 43, 43,-32768, 160,-32768, 43,
458 -32768,-32768,-32768, 158,-32768, 103, 106, 111, 114, 119,
459 -32768, 54, 43,-32768,-32768,-32768,-32768,-32768,-32768, 47,
460 -32768, 185, 188,-32768
461 };
462
463 static const short yypgoto[] = { -50,
464 86,-32768,-32768, 98, -66, 7,-32768,-32768,-32768, -8,
465 38, 102, -55, -48,-32768,-32768,-32768, 26,-32768,-32768,
466 -32768,-32768, 164,-32768, 193,-32768,-32768, 155,-32768,-32768,
467 -32768,-32768, -95, 65,-32768,-32768,-32768,-32768,-32768,-32768,
468 -32768, -7, 157,-32768,-32768,-32768, 174,-32768
469 };
470
471
472 #define YYLAST 210
473
474
475 static const short yytable[] = { 104,
476 95, 75, 129, 24, 25, 13, 1, 2, 3, 4,
477 48, 5, 1, 2, 3, 4, 2, 5, 68, 69,
478 70, 71, 72, 73, 74, 27, 58, 25, 50, 108,
479 19, 100, 49, 23, 21, 129, 59, 155, 39, 32,
480 77, 123, 138, 139, 140, 141, 142, 36, 127, 101,
481 78, 124, 146, 51, 125, 75, 157, 152, 143, 80,
482 81, 82, 83, 84, 85, 86, 167, 87, 88, 161,
483 62, 126, 89, 90, 158, 91, 124, 120, 92, 121,
484 39, 122, 96, 45, 120, 46, 121, 191, 122, 120,
485 51, 121, 168, 122, 56, 176, 177, 178, 179, 180,
486 120, 57, 121, 182, 122, 63, 120, 162, 121, 66,
487 122, 149, 150, 163, 99, 120, 190, 121, 98, 122,
488 102, 120, 164, 121, 103, 122, 105, 120, 165, 121,
489 106, 122, 107, 120, 166, 121, 120, 122, 121, 184,
490 122, 120, 185, 121, 120, 122, 121, 186, 122, 120,
491 187, 121, 109, 122, 118, 188, 1, 2, 3, 4,
492 110, 5, 111, 112, 113, 114, 2, 132, 136, 133,
493 134, 124, 144, 151, 153, 145, 154, 159, 173, 171,
494 160, 170, 175, 181, 193, 172, 183, 194, 189, 119,
495 174, 135, 117, 44, 17, 156, 35, 0, 0, 0,
496 0, 0, 0, 0, 0, 67, 0, 0, 0, 79
497 };
498
499 static const short yycheck[] = { 66,
500 56, 52, 98, 11, 12, 23, 10, 11, 12, 13,
501 16, 15, 10, 11, 12, 13, 11, 15, 3, 4,
502 5, 6, 7, 8, 9, 39, 31, 35, 32, 78,
503 23, 22, 38, 31, 23, 131, 41, 32, 23, 23,
504 28, 28, 109, 110, 111, 112, 113, 27, 97, 40,
505 38, 38, 119, 14, 15, 106, 22, 124, 114, 17,
506 18, 19, 20, 21, 22, 23, 28, 25, 26, 136,
507 45, 32, 30, 31, 40, 33, 38, 31, 36, 33,
508 23, 35, 57, 39, 31, 31, 33, 41, 35, 31,
509 14, 33, 39, 35, 27, 162, 163, 164, 165, 166,
510 31, 38, 33, 170, 35, 22, 31, 38, 33, 29,
511 35, 120, 121, 38, 41, 31, 183, 33, 31, 35,
512 38, 31, 38, 33, 32, 35, 27, 31, 38, 33,
513 27, 35, 23, 31, 38, 33, 31, 35, 33, 37,
514 35, 31, 37, 33, 31, 35, 33, 37, 35, 31,
515 37, 33, 36, 35, 23, 37, 10, 11, 12, 13,
516 36, 15, 36, 36, 36, 27, 11, 22, 29, 22,
517 22, 38, 32, 23, 23, 34, 41, 28, 34, 37,
518 28, 38, 22, 24, 0, 32, 29, 0, 182, 92,
519 153, 106, 91, 30, 2, 131, 23, -1, -1, -1,
520 -1, -1, -1, -1, -1, 49, -1, -1, -1, 55
521 };
522 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
523 #line 3 "/usr/share/bison.simple"
524 /* This file comes from bison-1.28. */
525
526 /* Skeleton output parser for bison,
527 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
528
529 This program is free software; you can redistribute it and/or modify
530 it under the terms of the GNU General Public License as published by
531 the Free Software Foundation; either version 2, or (at your option)
532 any later version.
533
534 This program is distributed in the hope that it will be useful,
535 but WITHOUT ANY WARRANTY; without even the implied warranty of
536 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
537 GNU General Public License for more details.
538
539 You should have received a copy of the GNU General Public License
540 along with this program; if not, write to the Free Software
541 Foundation, Inc., 59 Temple Place - Suite 330,
542 Boston, MA 02111-1307, USA. */
543
544 /* As a special exception, when this file is copied by Bison into a
545 Bison output file, you may use that output file without restriction.
546 This special exception was added by the Free Software Foundation
547 in version 1.24 of Bison. */
548
549 /* This is the parser code that is written into each bison parser
550 when the %semantic_parser declaration is not specified in the grammar.
551 It was written by Richard Stallman by simplifying the hairy parser
552 used when %semantic_parser is specified. */
553
554 #ifndef YYSTACK_USE_ALLOCA
555 #ifdef alloca
556 #define YYSTACK_USE_ALLOCA
557 #else /* alloca not defined */
558 #ifdef __GNUC__
559 #define YYSTACK_USE_ALLOCA
560 #define alloca __builtin_alloca
561 #else /* not GNU C. */
562 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
563 #define YYSTACK_USE_ALLOCA
564 #include
565 #else /* not sparc */
566 /* We think this test detects Watcom and Microsoft C. */
567 /* This used to test MSDOS, but that is a bad idea
568 since that symbol is in the user namespace. */
569 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
570 #if 0 /* No need for malloc.h, which pollutes the namespace;
571 instead, just don't use alloca. */
572 #include
573 #endif
574 #else /* not MSDOS, or __TURBOC__ */
575 #if defined(_AIX)
576 /* I don't know what this was needed for, but it pollutes the namespace.
577 So I turned it off. rms, 2 May 1997. */
578 /* #include */
579 #pragma alloca
580 #define YYSTACK_USE_ALLOCA
581 #else /* not MSDOS, or __TURBOC__, or _AIX */
582 #if 0
583 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
584 and on HPUX 10. Eventually we can turn this on. */
585 #define YYSTACK_USE_ALLOCA
586 #define alloca __builtin_alloca
587 #endif /* __hpux */
588 #endif
589 #endif /* not _AIX */
590 #endif /* not MSDOS, or __TURBOC__ */
591 #endif /* not sparc */
592 #endif /* not GNU C */
593 #endif /* alloca not defined */
594 #endif /* YYSTACK_USE_ALLOCA not defined */
595
596 #ifdef YYSTACK_USE_ALLOCA
597 #define YYSTACK_ALLOC alloca
383598 #else
384 typedef unsigned char yytype_uint8;
385 #endif
386
387 #ifdef YYTYPE_INT8
388 typedef YYTYPE_INT8 yytype_int8;
389 #elif (defined __STDC__ || defined __C99__FUNC__ \
390 || defined __cplusplus || defined _MSC_VER)
391 typedef signed char yytype_int8;
392 #else
393 typedef short int yytype_int8;
394 #endif
395
396 #ifdef YYTYPE_UINT16
397 typedef YYTYPE_UINT16 yytype_uint16;
398 #else
399 typedef unsigned short int yytype_uint16;
400 #endif
401
402 #ifdef YYTYPE_INT16
403 typedef YYTYPE_INT16 yytype_int16;
404 #else
405 typedef short int yytype_int16;
406 #endif
407
408 #ifndef YYSIZE_T
409 # ifdef __SIZE_TYPE__
410 # define YYSIZE_T __SIZE_TYPE__
411 # elif defined size_t
412 # define YYSIZE_T size_t
413 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
414 || defined __cplusplus || defined _MSC_VER)
415 # include /* INFRINGES ON USER NAME SPACE */
416 # define YYSIZE_T size_t
417 # else
418 # define YYSIZE_T unsigned int
419 # endif
420 #endif
421
422 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
423
424 #ifndef YY_
425 # if YYENABLE_NLS
426 # if ENABLE_NLS
427 # include /* INFRINGES ON USER NAME SPACE */
428 # define YY_(msgid) dgettext ("bison-runtime", msgid)
429 # endif
430 # endif
431 # ifndef YY_
432 # define YY_(msgid) msgid
433 # endif
434 #endif
435
436 /* Suppress unused-variable warnings by "using" E. */
437 #if ! defined lint || defined __GNUC__
438 # define YYUSE(e) ((void) (e))
439 #else
440 # define YYUSE(e) /* empty */
441 #endif
442
443 /* Identity function, used to suppress warnings about constant conditions. */
444 #ifndef lint
445 # define YYID(n) (n)
446 #else
447 #if (defined __STDC__ || defined __C99__FUNC__ \
448 || defined __cplusplus || defined _MSC_VER)
449 static int
450 YYID (int i)
451 #else
452 static int
453 YYID (i)
454 int i;
455 #endif
456 {
457 return i;
458 }
459 #endif
460
461 #if ! defined yyoverflow || YYERROR_VERBOSE
462
463 /* The parser invokes alloca or malloc; define the necessary symbols. */
464
465 # ifdef YYSTACK_USE_ALLOCA
466 # if YYSTACK_USE_ALLOCA
467 # ifdef __GNUC__
468 # define YYSTACK_ALLOC __builtin_alloca
469 # elif defined __BUILTIN_VA_ARG_INCR
470 # include /* INFRINGES ON USER NAME SPACE */
471 # elif defined _AIX
472 # define YYSTACK_ALLOC __alloca
473 # elif defined _MSC_VER
474 # include /* INFRINGES ON USER NAME SPACE */
475 # define alloca _alloca
476 # else
477 # define YYSTACK_ALLOC alloca
478 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
479 || defined __cplusplus || defined _MSC_VER)
480 # include /* INFRINGES ON USER NAME SPACE */
481 # ifndef _STDLIB_H
482 # define _STDLIB_H 1
483 # endif
484 # endif
485 # endif
486 # endif
487 # endif
488
489 # ifdef YYSTACK_ALLOC
490 /* Pacify GCC's `empty if-body' warning. */
491 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
492 # ifndef YYSTACK_ALLOC_MAXIMUM
493 /* The OS might guarantee only one guard page at the bottom of the stack,
494 and a page size can be as small as 4096 bytes. So we cannot safely
495 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
496 to allow for a few compiler-allocated temporary stack slots. */
497 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
498 # endif
499 # else
500 # define YYSTACK_ALLOC YYMALLOC
501 # define YYSTACK_FREE YYFREE
502 # ifndef YYSTACK_ALLOC_MAXIMUM
503 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
504 # endif
505 # if (defined __cplusplus && ! defined _STDLIB_H \
506 && ! ((defined YYMALLOC || defined malloc) \
507 && (defined YYFREE || defined free)))
508 # include /* INFRINGES ON USER NAME SPACE */
509 # ifndef _STDLIB_H
510 # define _STDLIB_H 1
511 # endif
512 # endif
513 # ifndef YYMALLOC
514 # define YYMALLOC malloc
515 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
516 || defined __cplusplus || defined _MSC_VER)
517 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
518 # endif
519 # endif
520 # ifndef YYFREE
521 # define YYFREE free
522 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
523 || defined __cplusplus || defined _MSC_VER)
524 void free (void *); /* INFRINGES ON USER NAME SPACE */
525 # endif
526 # endif
527 # endif
528 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
529
530
531 #if (! defined yyoverflow \
532 && (! defined __cplusplus \
533 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
534
535 /* A type that is properly aligned for any stack member. */
536 union yyalloc
537 {
538 yytype_int16 yyss;
539 YYSTYPE yyvs;
540 };
541
542 /* The size of the maximum gap between one aligned stack and the next. */
543 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
544
545 /* The size of an array large to enough to hold all stacks, each with
546 N elements. */
547 # define YYSTACK_BYTES(N) \
548 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
549 + YYSTACK_GAP_MAXIMUM)
550
551 /* Copy COUNT objects from FROM to TO. The source and destination do
552 not overlap. */
553 # ifndef YYCOPY
554 # if defined __GNUC__ && 1 < __GNUC__
555 # define YYCOPY(To, From, Count) \
556 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
557 # else
558 # define YYCOPY(To, From, Count) \
559 do \
560 { \
561 YYSIZE_T yyi; \
562 for (yyi = 0; yyi < (Count); yyi++) \
563 (To)[yyi] = (From)[yyi]; \
564 } \
565 while (YYID (0))
566 # endif
567 # endif
568
569 /* Relocate STACK from its old location to the new one. The
570 local variables YYSIZE and YYSTACKSIZE give the old and new number of
571 elements in the stack, and YYPTR gives the new location of the
572 stack. Advance YYPTR to a properly aligned location for the next
573 stack. */
574 # define YYSTACK_RELOCATE(Stack) \
575 do \
576 { \
577 YYSIZE_T yynewbytes; \
578 YYCOPY (&yyptr->Stack, Stack, yysize); \
579 Stack = &yyptr->Stack; \
580 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
581 yyptr += yynewbytes / sizeof (*yyptr); \
582 } \
583 while (YYID (0))
584
585 #endif
586
587 /* YYFINAL -- State number of the termination state. */
588 #define YYFINAL 27
589 /* YYLAST -- Last index in YYTABLE. */
590 #define YYLAST 204
591
592 /* YYNTOKENS -- Number of terminals. */
593 #define YYNTOKENS 41
594 /* YYNNTS -- Number of nonterminals. */
595 #define YYNNTS 50
596 /* YYNRULES -- Number of rules. */
597 #define YYNRULES 102
598 /* YYNRULES -- Number of states. */
599 #define YYNSTATES 188
600
601 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
602 #define YYUNDEFTOK 2
603 #define YYMAXUTOK 280
604
605 #define YYTRANSLATE(YYX) \
606 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
607
608 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
609 static const yytype_uint8 yytranslate[] =
610 {
611 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 35, 36, 2, 2, 37, 39, 34, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 38, 40,
617 26, 28, 27, 29, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620 2, 32, 2, 33, 2, 2, 2, 2, 2, 2,
621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 30, 2, 31, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
637 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
638 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
639 25
640 };
641
642 #if YYDEBUG
643 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
644 YYRHS. */
645 static const yytype_uint16 yyprhs[] =
646 {
647 0, 0, 3, 5, 7, 9, 14, 16, 21, 23,
648 25, 27, 28, 30, 31, 34, 36, 38, 40, 42,
649 44, 46, 50, 55, 60, 64, 68, 73, 78, 85,
650 92, 99, 106, 107, 110, 113, 118, 119, 121, 123,
651 127, 130, 134, 140, 145, 147, 148, 152, 153, 155,
652 157, 161, 166, 169, 176, 177, 180, 182, 186, 188,
653 193, 195, 199, 200, 203, 205, 209, 213, 214, 216,
654 218, 219, 221, 223, 225, 226, 230, 231, 232, 239,
655 243, 245, 247, 250, 252, 253, 254, 263, 264, 271,
656 273, 275, 277, 279, 284, 286, 290, 291, 296, 301,
657 304, 306, 309
658 };
659
660 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
661 static const yytype_int8 yyrhs[] =
662 {
663 90, 0, -1, 22, -1, 5, -1, 4, -1, 6,
664 26, 21, 27, -1, 3, -1, 7, 26, 43, 27,
665 -1, 8, -1, 9, -1, 42, -1, -1, 14, -1,
666 -1, 28, 47, -1, 22, -1, 46, -1, 21, -1,
667 24, -1, 25, -1, 29, -1, 30, 54, 31, -1,
668 22, 26, 55, 27, -1, 47, 30, 52, 31, -1,
669 32, 54, 33, -1, 47, 34, 22, -1, 35, 46,
670 50, 36, -1, 47, 32, 52, 33, -1, 17, 35,
671 47, 37, 47, 36, -1, 18, 35, 47, 37, 47,
672 36, -1, 19, 35, 47, 37, 47, 36, -1, 20,
673 35, 47, 37, 47, 36, -1, -1, 38, 23, -1,
674 47, 48, -1, 49, 37, 47, 48, -1, -1, 49,
675 -1, 21, -1, 21, 39, 21, -1, 21, 21, -1,
676 51, 37, 21, -1, 51, 37, 21, 39, 21, -1,
677 51, 37, 21, 21, -1, 51, -1, -1, 30, 52,
678 31, -1, -1, 55, -1, 47, -1, 55, 37, 47,
679 -1, 44, 43, 22, 45, -1, 56, 40, -1, 15,
680 22, 53, 28, 47, 40, -1, -1, 58, 57, -1,
681 40, -1, 30, 58, 31, -1, 42, -1, 42, 26,
682 55, 27, -1, 60, -1, 61, 37, 60, -1, -1,
683 38, 61, -1, 56, -1, 63, 37, 56, -1, 26,
684 63, 27, -1, -1, 64, -1, 22, -1, -1, 66,
685 -1, 67, -1, 67, -1, -1, 62, 71, 59, -1,
686 -1, -1, 10, 68, 73, 65, 74, 70, -1, 11,
687 69, 70, -1, 75, -1, 76, -1, 77, 76, -1,
688 22, -1, -1, -1, 12, 78, 80, 65, 81, 30,
689 77, 31, -1, -1, 13, 22, 83, 38, 60, 40,
690 -1, 72, -1, 75, -1, 79, -1, 82, -1, 22,
691 53, 28, 47, -1, 85, -1, 86, 37, 85, -1,
692 -1, 15, 88, 86, 16, -1, 87, 30, 89, 31,
693 -1, 87, 84, -1, 84, -1, 89, 84, -1, 89,
694 -1
695 };
696
697 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
698 static const yytype_uint16 yyrline[] =
699 {
700 0, 246, 246, 268, 270, 272, 274, 276, 278, 280,
701 282, 286, 286, 288, 288, 290, 313, 315, 317, 320,
702 323, 325, 338, 366, 373, 376, 383, 386, 394, 396,
703 398, 400, 404, 407, 411, 416, 422, 425, 428, 431,
704 444, 458, 460, 473, 489, 491, 491, 495, 497, 501,
705 504, 508, 525, 527, 533, 533, 534, 534, 536, 538,
706 542, 547, 552, 555, 559, 562, 567, 568, 568, 570,
707 570, 572, 579, 597, 622, 622, 641, 643, 641, 649,
708 659, 673, 676, 680, 691, 693, 691, 700, 700, 774,
709 774, 775, 775, 777, 782, 782, 785, 785, 788, 791,
710 795, 795, 797
711 };
712 #endif
713
714 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
715 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
716 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
717 static const char *const yytname[] =
718 {
719 "$end", "error", "$undefined", "INT", "BIT", "STRING", "BITS", "LIST",
720 "CODE", "DAG", "CLASS", "DEF", "MULTICLASS", "DEFM", "FIELD", "LET",
721 "IN", "SHLTOK", "SRATOK", "SRLTOK", "STRCONCATTOK", "INTVAL", "ID",
722 "VARNAME", "STRVAL", "CODEFRAGMENT", "'<'", "'>'", "'='", "'?'", "'{'",
723 "'}'", "'['", "']'", "'.'", "'('", "')'", "','", "':'", "'-'", "';'",
724 "$accept", "ClassID", "Type", "OptPrefix", "OptValue", "IDValue",
725 "Value", "OptVarName", "DagArgListNE", "DagArgList", "RBitList",
726 "BitList", "OptBitList", "ValueList", "ValueListNE", "Declaration",
727 "BodyItem", "BodyList", "Body", "SubClassRef", "ClassListNE",
728 "ClassList", "DeclListNE", "TemplateArgList", "OptTemplateArgList",
729 "OptID", "ObjectName", "ClassName", "DefName", "ObjectBody", "@1",
730 "ClassInst", "@2", "@3", "DefInst", "MultiClassDef", "MultiClassBody",
731 "MultiClassName", "MultiClassInst", "@4", "@5", "DefMInst", "@6",
732 "Object", "LETItem", "LETList", "LETCommand", "@7", "ObjectList", "File", 0
733 };
734 #endif
735
736 # ifdef YYPRINT
737 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
738 token YYLEX-NUM. */
739 static const yytype_uint16 yytoknum[] =
740 {
741 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
742 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
743 275, 276, 277, 278, 279, 280, 60, 62, 61, 63,
744 123, 125, 91, 93, 46, 40, 41, 44, 58, 45,
745 59
746 };
747 # endif
748
749 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
750 static const yytype_uint8 yyr1[] =
751 {
752 0, 41, 42, 43, 43, 43, 43, 43, 43, 43,
753 43, 44, 44, 45, 45, 46, 47, 47, 47, 47,
754 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
755 47, 47, 48, 48, 49, 49, 50, 50, 51, 51,
756 51, 51, 51, 51, 52, 53, 53, 54, 54, 55,
757 55, 56, 57, 57, 58, 58, 59, 59, 60, 60,
758 61, 61, 62, 62, 63, 63, 64, 65, 65, 66,
759 66, 67, 68, 69, 71, 70, 73, 74, 72, 75,
760 76, 77, 77, 78, 80, 81, 79, 83, 82, 84,
761 84, 84, 84, 85, 86, 86, 88, 87, 84, 84,
762 89, 89, 90
763 };
764
765 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
766 static const yytype_uint8 yyr2[] =
767 {
768 0, 2, 1, 1, 1, 4, 1, 4, 1, 1,
769 1, 0, 1, 0, 2, 1, 1, 1, 1, 1,
770 1, 3, 4, 4, 3, 3, 4, 4, 6, 6,
771 6, 6, 0, 2, 2, 4, 0, 1, 1, 3,
772 2, 3, 5, 4, 1, 0, 3, 0, 1, 1,
773 3, 4, 2, 6, 0, 2, 1, 3, 1, 4,
774 1, 3, 0, 2, 1, 3, 3, 0, 1, 1,
775 0, 1, 1, 1, 0, 3, 0, 0, 6, 3,
776 1, 1, 2, 1, 0, 0, 8, 0, 6, 1,
777 1, 1, 1, 4, 1, 3, 0, 4, 4, 2,
778 1, 2, 1
779 };
780
781 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
782 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
783 means the default is an error. */
784 static const yytype_uint8 yydefact[] =
785 {
786 0, 70, 70, 0, 0, 96, 89, 90, 91, 92,
787 100, 0, 102, 0, 69, 71, 72, 76, 73, 62,
788 83, 84, 87, 0, 0, 99, 101, 1, 67, 0,
789 74, 79, 67, 0, 45, 94, 0, 0, 11, 68,
790 77, 2, 58, 60, 63, 0, 85, 0, 0, 0,
791 97, 0, 98, 12, 0, 64, 0, 62, 0, 0,
792 54, 56, 75, 0, 0, 38, 44, 0, 0, 95,
793 6, 4, 3, 0, 0, 8, 9, 10, 0, 66,
794 11, 78, 0, 0, 0, 0, 17, 15, 18, 19,
795 20, 47, 47, 0, 16, 49, 0, 61, 11, 0,
796 88, 40, 0, 0, 46, 93, 0, 0, 13, 65,
797 0, 0, 0, 0, 0, 0, 48, 0, 15, 36,
798 0, 0, 0, 59, 0, 0, 57, 0, 55, 80,
799 81, 0, 39, 41, 0, 0, 0, 51, 0, 0,
800 0, 0, 0, 21, 24, 32, 37, 0, 0, 0,
801 25, 50, 45, 52, 86, 82, 43, 0, 5, 7,
802 14, 0, 0, 0, 0, 22, 0, 34, 0, 26,
803 23, 27, 0, 42, 0, 0, 0, 0, 33, 32,
804 0, 28, 29, 30, 31, 35, 0, 53
805 };
806
807 /* YYDEFGOTO[NTERM-NUM]. */
808 static const yytype_int16 yydefgoto[] =
809 {
810 -1, 42, 78, 54, 137, 94, 95, 167, 146, 147,
811 66, 67, 49, 115, 116, 55, 128, 98, 62, 43,
812 44, 30, 56, 39, 40, 15, 16, 17, 19, 31,
813 45, 6, 28, 57, 7, 130, 131, 21, 8, 32,
814 63, 9, 33, 10, 35, 36, 11, 23, 12, 13
815 };
816
817 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
818 STATE-NUM. */
819 #define YYPACT_NINF -97
820 static const yytype_int16 yypact[] =
821 {
822 129, 3, 3, 11, 19, -97, -97, -97, -97, -97,
823 -97, 2, 129, 48, -97, -97, -97, -97, -97, 29,
824 -97, -97, -97, 31, 129, -97, -97, -97, 43, 56,
825 -97, -97, 43, 42, 53, -97, -6, -4, 71, -97,
826 -97, -97, 72, -97, 65, 9, -97, 56, 87, 78,
827 -97, 31, -97, -97, 15, -97, 13, 29, 41, 56,
828 -97, -97, -97, 84, 80, 7, 81, 106, 41, -97,
829 -97, -97, -97, 120, 122, -97, -97, -97, 127, -97,
830 71, -97, 115, 116, 117, 118, -97, 128, -97, -97,
831 -97, 41, 41, 133, -97, 113, 27, -97, 60, 145,
832 -97, -97, 136, 137, -97, 113, 138, 15, 132, -97,
833 41, 41, 41, 41, 41, 130, 125, 131, -97, 41,
834 87, 87, 141, -97, 41, 143, -97, 126, -97, -97,
835 -97, 5, -97, 8, 140, 142, 41, -97, 67, 73,
836 79, 85, 45, -97, -97, 54, 134, 139, 146, 135,
837 -97, 113, 53, -97, -97, -97, -97, 149, -97, -97,
838 113, 41, 41, 41, 41, -97, 150, -97, 41, -97,
839 -97, -97, 144, -97, 91, 94, 99, 102, -97, 54,
840 41, -97, -97, -97, -97, -97, 47, -97
841 };
842
843 /* YYPGOTO[NTERM-NUM]. */
844 static const yytype_int16 yypgoto[] =
845 {
846 -97, -52, 69, -97, -97, 86, -68, -5, -97, -97,
847 -97, -31, 26, 88, -57, -46, -97, -97, -97, -21,
848 -97, -97, -97, -97, 151, -97, 179, -97, -97, 147,
849 -97, -97, -97, -97, -96, 51, -97, -97, -97, -97,
850 -97, -97, -97, -7, 148, -97, -97, -97, 160, -97
851 };
852
853 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
854 positive, shift that token. If negative, reduce the rule which
855 number is the opposite. If zero, do what YYDEFACT says.
856 If YYTABLE_NINF, syntax error. */
857 #define YYTABLE_NINF -1
858 static const yytype_uint8 yytable[] =
859 {
860 105, 96, 77, 129, 25, 26, 1, 2, 3, 4,
861 50, 5, 1, 2, 3, 4, 2, 5, 70, 71,
862 72, 73, 74, 75, 76, 14, 64, 52, 101, 156,
863 26, 51, 24, 20, 109, 129, 154, 41, 97, 60,
864 79, 22, 138, 139, 140, 141, 102, 157, 27, 61,
865 80, 145, 127, 34, 123, 77, 151, 142, 82, 83,
866 84, 85, 86, 87, 124, 88, 89, 29, 160, 38,
867 90, 91, 165, 92, 53, 125, 93, 120, 41, 121,
868 47, 122, 124, 48, 120, 53, 121, 187, 122, 148,
869 149, 126, 166, 174, 175, 176, 177, 120, 58, 121,
870 179, 122, 59, 120, 161, 121, 68, 122, 65, 120,
871 162, 121, 186, 122, 99, 120, 163, 121, 103, 122,
872 100, 120, 164, 121, 120, 122, 121, 181, 122, 120,
873 182, 121, 120, 122, 121, 183, 122, 104, 184, 1,
874 2, 3, 4, 120, 5, 121, 106, 122, 107, 108,
875 110, 111, 112, 113, 114, 118, 2, 132, 133, 134,
876 136, 143, 124, 150, 144, 152, 153, 158, 171, 159,
877 173, 168, 180, 178, 185, 169, 135, 170, 172, 119,
878 117, 18, 155, 46, 37, 0, 0, 0, 0, 0,
879 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,
880 0, 0, 0, 0, 81
881 };
882
883 static const yytype_int16 yycheck[] =
884 {
885 68, 58, 54, 99, 11, 12, 10, 11, 12, 13,
886 16, 15, 10, 11, 12, 13, 11, 15, 3, 4,
887 5, 6, 7, 8, 9, 22, 47, 31, 21, 21,
888 37, 37, 30, 22, 80, 131, 31, 22, 59, 30,
889 27, 22, 110, 111, 112, 113, 39, 39, 0, 40,
890 37, 119, 98, 22, 27, 107, 124, 114, 17, 18,
891 19, 20, 21, 22, 37, 24, 25, 38, 136, 26,
892 29, 30, 27, 32, 14, 15, 35, 30, 22, 32,
893 38, 34, 37, 30, 30, 14, 32, 40, 34, 120,
894 121, 31, 38, 161, 162, 163, 164, 30, 26, 32,
895 168, 34, 37, 30, 37, 32, 28, 34, 21, 30,
896 37, 32, 180, 34, 30, 30, 37, 32, 37, 34,
897 40, 30, 37, 32, 30, 34, 32, 36, 34, 30,
898 36, 32, 30, 34, 32, 36, 34, 31, 36, 10,
899 11, 12, 13, 30, 15, 32, 26, 34, 26, 22,
900 35, 35, 35, 35, 26, 22, 11, 21, 21, 21,
901 28, 31, 37, 22, 33, 22, 40, 27, 33, 27,
902 21, 37, 28, 23, 179, 36, 107, 31, 152, 93,
903 92, 2, 131, 32, 24, -1, -1, -1, -1, -1,
904 -1, -1, -1, -1, -1, -1, -1, -1, -1, 51,
905 -1, -1, -1, -1, 57
906 };
907
908 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
909 symbol of state STATE-NUM. */
910 static const yytype_uint8 yystos[] =
911 {
912 0, 10, 11, 12, 13, 15, 72, 75, 79, 82,
913 84, 87, 89, 90, 22, 66, 67, 68, 67, 69,
914 22, 78, 22, 88, 30, 84, 84, 0, 73, 38,
915 62, 70, 80, 83, 22, 85, 86, 89, 26, 64,
916 65, 22, 42, 60, 61, 71, 65, 38, 30, 53,
917 16, 37, 31, 14, 44, 56, 63, 74, 26, 37,
918 30, 40, 59, 81, 60, 21, 51, 52, 28, 85,
919 3, 4, 5, 6, 7, 8, 9, 42, 43, 27,
920 37, 70, 17, 18, 19, 20, 21, 22, 24, 25,
921 29, 30, 32, 35, 46, 47, 55, 60, 58, 30,
922 40, 21, 39, 37, 31, 47, 26, 26, 22, 56,
923 35, 35, 35, 35, 26, 54, 55, 54, 22, 46,
924 30, 32, 34, 27, 37, 15, 31, 56, 57, 75,
925 76, 77, 21, 21, 21, 43, 28, 45, 47, 47,
926 47, 47, 55, 31, 33, 47, 49, 50, 52, 52,
927 22, 47, 22, 40, 31, 76, 21, 39, 27, 27,
928 47, 37, 37, 37, 37, 27, 38, 48, 37, 36,
929 31, 33, 53, 21, 47, 47, 47, 47, 23, 47,
930 28, 36, 36, 36, 36, 48, 47, 40
931 };
599 #define YYSTACK_ALLOC malloc
600 #endif
601
602 /* Note: there must be only one dollar sign in this file.
603 It is replaced by the list of actions, each action
604 as one case of the switch. */
932605
933606 #define yyerrok (yyerrstatus = 0)
934607 #define yyclearin (yychar = YYEMPTY)
935 #define YYEMPTY (-2)
608 #define YYEMPTY -2
936609 #define YYEOF 0
937
938610 #define YYACCEPT goto yyacceptlab
939 #define YYABORT goto yyabortlab
940 #define YYERROR goto yyerrorlab
941
942
943 /* Like YYERROR except do call yyerror. This remains here temporarily
944 to ease the transition to the new meaning of YYERROR, for GCC.
611 #define YYABORT goto yyabortlab
612 #define YYERROR goto yyerrlab1
613 /* Like YYERROR except do call yyerror.
614 This remains here temporarily to ease the
615 transition to the new meaning of YYERROR, for GCC.
945616 Once GCC version 2 has supplanted version 1, this can go. */
946
947617 #define YYFAIL goto yyerrlab
948
949618 #define YYRECOVERING() (!!yyerrstatus)
950
951 #define YYBACKUP(Token, Value) \
619 #define YYBACKUP(token, value) \
952620 do \
953621 if (yychar == YYEMPTY && yylen == 1) \
954 { \
955 yychar = (Token); \
956 yylval = (Value); \
957 yytoken = YYTRANSLATE (yychar); \
958 YYPOPSTACK (1); \
622 { yychar = (token), yylval = (value); \
623 yychar1 = YYTRANSLATE (yychar); \
624 YYPOPSTACK; \
959625 goto yybackup; \
960626 } \
961627 else \
962 { \
963 yyerror (YY_("syntax error: cannot back up")); \
964 YYERROR; \
965 } \
966 while (YYID (0))
967
628 { yyerror ("syntax error: cannot back up"); YYERROR; } \
629 while (0)
968630
969631 #define YYTERROR 1
970632 #define YYERRCODE 256
971633
972
973 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
974 If N is 0, then set CURRENT to the empty location which ends
975 the previous symbol: RHS[0] (always defined). */
976
977 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
978 #ifndef YYLLOC_DEFAULT
979 # define YYLLOC_DEFAULT(Current, Rhs, N) \
980 do \
981 if (YYID (N)) \
982 { \
983 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
984 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
985 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
986 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
987 } \
988 else \
989 { \
990 (Current).first_line = (Current).last_line = \
991 YYRHSLOC (Rhs, 0).last_line; \
992 (Current).first_column = (Current).last_column = \
993 YYRHSLOC (Rhs, 0).last_column; \
994 } \
995 while (YYID (0))
996 #endif
997
998
999 /* YY_LOCATION_PRINT -- Print the location on the stream.
1000 This macro was not mandated originally: define only if we know
1001 we won't break user code: when these are the locations we know. */
1002
1003 #ifndef YY_LOCATION_PRINT
1004 # if YYLTYPE_IS_TRIVIAL
1005 # define YY_LOCATION_PRINT(File, Loc) \
1006 fprintf (File, "%d.%d-%d.%d", \
1007 (Loc).first_line, (Loc).first_column, \
1008 (Loc).last_line, (Loc).last_column)
1009 # else
1010 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1011 # endif
1012 #endif
1013
1014
1015 /* YYLEX -- calling `yylex' with the right arguments. */
1016
634 #ifndef YYPURE
635 #define YYLEX yylex()
636 #endif
637
638 #ifdef YYPURE
639 #ifdef YYLSP_NEEDED
1017640 #ifdef YYLEX_PARAM
1018 # define YYLEX yylex (YYLEX_PARAM)
641 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
1019642 #else
1020 # define YYLEX yylex ()
1021 #endif
1022
1023 /* Enable debugging if requested. */
1024 #if YYDEBUG
1025
1026 # ifndef YYFPRINTF
1027 # include /* INFRINGES ON USER NAME SPACE */
1028 # define YYFPRINTF fprintf
1029 # endif
1030
1031 # define YYDPRINTF(Args) \
1032 do { \
1033 if (yydebug) \
1034 YYFPRINTF Args; \
1035 } while (YYID (0))
1036
1037 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1038 do { \
1039 if (yydebug) \
1040 { \
1041 YYFPRINTF (stderr, "%s ", Title); \
1042 yy_symbol_print (stderr, \
1043 Type, Value); \
1044 YYFPRINTF (stderr, "\n"); \
1045 } \
1046 } while (YYID (0))
1047
1048
1049 /*--------------------------------.
1050 | Print this symbol on YYOUTPUT. |
1051 `--------------------------------*/
1052
1053 /*ARGSUSED*/
1054 #if (defined __STDC__ || defined __C99__FUNC__ \
1055 || defined __cplusplus || defined _MSC_VER)
643 #define YYLEX yylex(&yylval, &yylloc)
644 #endif
645 #else /* not YYLSP_NEEDED */
646 #ifdef YYLEX_PARAM
647 #define YYLEX yylex(&yylval, YYLEX_PARAM)
648 #else
649 #define YYLEX yylex(&yylval)
650 #endif
651 #endif /* not YYLSP_NEEDED */
652 #endif
653
654 /* If nonreentrant, generate the variables here */
655
656 #ifndef YYPURE
657
658 int yychar; /* the lookahead symbol */
659 YYSTYPE yylval; /* the semantic value of the */
660 /* lookahead symbol */
661
662 #ifdef YYLSP_NEEDED
663 YYLTYPE yylloc; /* location data for the lookahead */
664 /* symbol */
665 #endif
666
667 int yynerrs; /* number of parse errors so far */
668 #endif /* not YYPURE */
669
670 #if YYDEBUG != 0
671 int yydebug; /* nonzero means print parse trace */
672 /* Since this is uninitialized, it does not stop multiple parsers
673 from coexisting. */
674 #endif
675
676 /* YYINITDEPTH indicates the initial size of the parser's stacks */
677
678 #ifndef YYINITDEPTH
679 #define YYINITDEPTH 200
680 #endif
681
682 /* YYMAXDEPTH is the maximum size the stacks can grow to
683 (effective only if the built-in stack extension method is used). */
684
685 #if YYMAXDEPTH == 0
686 #undef YYMAXDEPTH
687 #endif
688
689 #ifndef YYMAXDEPTH
690 #define YYMAXDEPTH 10000
691 #endif
692
693 /* Define __yy_memcpy. Note that the size argument
694 should be passed with type unsigned int, because that is what the non-GCC
695 definitions require. With GCC, __builtin_memcpy takes an arg
696 of type size_t, but it can handle unsigned int. */
697
698 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
699 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
700 #else /* not GNU C or C++ */
701 #ifndef __cplusplus
702
703 /* This is the most reliable way to avoid incompatibilities
704 in available built-in functions on various systems. */
1056705 static void
1057 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
706 __yy_memcpy (to, from, count)
707 char *to;
708 char *from;
709 unsigned int count;
710 {
711 register char *f = from;
712 register char *t = to;
713 register int i = count;
714
715 while (i-- > 0)
716 *t++ = *f++;
717 }
718
719 #else /* __cplusplus */
720
721 /* This is the most reliable way to avoid incompatibilities
722 in available built-in functions on various systems. */
723 static void
724 __yy_memcpy (char *to, char *from, unsigned int count)
725 {
726 register char *t = to;
727 register char *f = from;
728 register int i = count;
729
730 while (i-- > 0)
731 *t++ = *f++;
732 }
733
734 #endif
735 #endif
736
737 #line 217 "/usr/share/bison.simple"
738
739 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
740 into yyparse. The argument should have type void *.
741 It should actually point to an object.
742 Grammar actions can access the variable by casting it
743 to the proper pointer type. */
744
745 #ifdef YYPARSE_PARAM
746 #ifdef __cplusplus
747 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
748 #define YYPARSE_PARAM_DECL
749 #else /* not __cplusplus */
750 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
751 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
752 #endif /* not __cplusplus */
753 #else /* not YYPARSE_PARAM */
754 #define YYPARSE_PARAM_ARG
755 #define YYPARSE_PARAM_DECL
756 #endif /* not YYPARSE_PARAM */
757
758 /* Prevent warning if -Wstrict-prototypes. */
759 #ifdef __GNUC__
760 #ifdef YYPARSE_PARAM
761 int yyparse (void *);
1058762 #else
1059 static void
1060 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1061 FILE *yyoutput;
1062 int yytype;
1063 YYSTYPE const * const yyvaluep;
1064 #endif
1065 {
1066 if (!yyvaluep)
1067 return;
1068 # ifdef YYPRINT
1069 if (yytype < YYNTOKENS)
1070 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1071 # else
1072 YYUSE (yyoutput);
1073 # endif
1074 switch (yytype)
1075 {
1076 default:
1077 break;
1078 }
1079 }
1080
1081
1082 /*--------------------------------.
1083 | Print this symbol on YYOUTPUT. |
1084 `--------------------------------*/
1085
1086 #if (defined __STDC__ || defined __C99__FUNC__ \
1087 || defined __cplusplus || defined _MSC_VER)
1088 static void
1089 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
763 int yyparse (void);
764 #endif
765 #endif
766
767 int
768 yyparse(YYPARSE_PARAM_ARG)
769 YYPARSE_PARAM_DECL
770 {
771 register int yystate;
772 register int yyn;
773 register short *yyssp;
774 register YYSTYPE *yyvsp;
775 int yyerrstatus; /* number of tokens to shift before error messages enabled */
776 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
777
778 short yyssa[YYINITDEPTH]; /* the state stack */
779 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
780
781 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
782 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
783
784 #ifdef YYLSP_NEEDED
785 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
786 YYLTYPE *yyls = yylsa;
787 YYLTYPE *yylsp;
788
789 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1090790 #else
1091 static void
1092 yy_symbol_print (yyoutput, yytype, yyvaluep)
1093 FILE *yyoutput;
1094 int yytype;
1095 YYSTYPE const * const yyvaluep;
1096 #endif
1097 {
1098 if (yytype < YYNTOKENS)
1099 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1100 else
1101 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1102
1103 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1104 YYFPRINTF (yyoutput, ")");
1105 }
1106
1107 /*------------------------------------------------------------------.
1108 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1109 | TOP (included). |
1110 `------------------------------------------------------------------*/
1111
1112 #if (defined __STDC__ || defined __C99__FUNC__ \
1113 || defined __cplusplus || defined _MSC_VER)
1114 static void
1115 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1116 #else
1117 static void
1118 yy_stack_print (bottom, top)
1119 yytype_int16 *bottom;
1120 yytype_int16 *top;
1121 #endif
1122 {
1123 YYFPRINTF (stderr, "Stack now");
1124 for (; bottom <= top; ++bottom)
1125 YYFPRINTF (stderr, " %d", *bottom);
1126 YYFPRINTF (stderr, "\n");
1127 }
1128
1129 # define YY_STACK_PRINT(Bottom, Top) \
1130 do { \
1131 if (yydebug) \
1132 yy_stack_print ((Bottom), (Top)); \
1133 } while (YYID (0))
1134
1135
1136 /*------------------------------------------------.
1137 | Report that the YYRULE is going to be reduced. |
1138 `------------------------------------------------*/
1139
1140 #if (defined __STDC__ || defined __C99__FUNC__ \
1141 || defined __cplusplus || defined _MSC_VER)
1142 static void
1143 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1144 #else
1145 static void
1146 yy_reduce_print (yyvsp, yyrule)
1147 YYSTYPE *yyvsp;
1148 int yyrule;
1149 #endif
1150 {
1151 int yynrhs = yyr2[yyrule];
1152 int yyi;
1153 unsigned long int yylno = yyrline[yyrule];
1154 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1155 yyrule - 1, yylno);
1156 /* The symbols being reduced. */
1157 for (yyi = 0; yyi < yynrhs; yyi++)
1158 {
1159 fprintf (stderr, " $%d = ", yyi + 1);
1160 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1161 &(yyvsp[(yyi + 1) - (yynrhs)])
1162 );
1163 fprintf (stderr, "\n");
1164 }
1165 }
1166
1167 # define YY_REDUCE_PRINT(Rule) \
1168 do { \
1169 if (yydebug) \
1170 yy_reduce_print (yyvsp, Rule); \
1171 } while (YYID (0))
1172
1173 /* Nonzero means print parse trace. It is left uninitialized so that
1174 multiple parsers can coexist. */
1175 int yydebug;
1176 #else /* !YYDEBUG */
1177 # define YYDPRINTF(Args)
1178 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1179 # define YY_STACK_PRINT(Bottom, Top)
1180 # define YY_REDUCE_PRINT(Rule)
1181 #endif /* !YYDEBUG */
1182
1183
1184 /* YYINITDEPTH -- initial size of the parser's stacks. */
1185 #ifndef YYINITDEPTH
1186 # define YYINITDEPTH 200
1187 #endif
1188
1189 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1190 if the built-in stack extension method is used).
1191
1192 Do not make this value too large; the results are undefined if
1193 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1194 evaluated with infinite-precision integer arithmetic. */
1195
1196 #ifndef YYMAXDEPTH
1197 # define YYMAXDEPTH 10000
1198 #endif
1199
1200
1201
1202 #if YYERROR_VERBOSE
1203
1204 # ifndef yystrlen
1205 # if defined __GLIBC__ && defined _STRING_H
1206 # define yystrlen strlen
1207 # else
1208 /* Return the length of YYSTR. */
1209 #if (defined __STDC__ || defined __C99__FUNC__ \
1210 || defined __cplusplus || defined _MSC_VER)
1211 static YYSIZE_T
1212 yystrlen (const char *yystr)
1213 #else
1214 static YYSIZE_T
1215 yystrlen (yystr)
1216 const char *yystr;
1217 #endif
1218 {
1219 YYSIZE_T yylen;
1220 for (yylen = 0; yystr[yylen]; yylen++)
1221 continue;
1222 return yylen;
1223 }
1224 # endif
1225 # endif
1226
1227 # ifndef yystpcpy
1228 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1229 # define yystpcpy stpcpy
1230 # else
1231 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1232 YYDEST. */
1233 #if (defined __STDC__ || defined __C99__FUNC__ \
1234 || defined __cplusplus || defined _MSC_VER)
1235 static char *
1236 yystpcpy (char *yydest, const char *yysrc)
1237 #else
1238 static char *
1239 yystpcpy (yydest, yysrc)
1240 char *yydest;
1241 const char *yysrc;
1242 #endif
1243 {
1244 char *yyd = yydest;
1245 const char *yys = yysrc;
1246
1247 while ((*yyd++ = *yys++) != '\0')
1248 continue;
1249
1250 return yyd - 1;
1251 }
1252 # endif
1253 # endif
1254
1255 # ifndef yytnamerr
1256 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1257 quotes and backslashes, so that it's suitable for yyerror. The
1258 heuristic is that double-quoting is unnecessary unless the string
1259 contains an apostrophe, a comma, or backslash (other than
1260 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1261 null, do not copy; instead, return the length of what the result
1262 would have been. */
1263 static YYSIZE_T
1264 yytnamerr (char *yyres, const char *yystr)
1265 {
1266 if (*yystr == '"')
1267 {
1268 YYSIZE_T yyn = 0;
1269 char const *yyp = yystr;
1270
1271 for (;;)
1272 switch (*++yyp)
1273 {
1274 case '\'':
1275 case ',':
1276 goto do_not_strip_quotes;
1277
1278 case '\\':
1279 if (*++yyp != '\\')
1280 goto do_not_strip_quotes;
1281 /* Fall through. */
1282 default:
1283 if (yyres)
1284 yyres[yyn] = *yyp;
1285 yyn++;
1286 break;
1287
1288 case '"':
1289 if (yyres)
1290 yyres[yyn] = '\0';
1291 return yyn;
1292 }
1293 do_not_strip_quotes: ;
1294 }
1295
1296 if (! yyres)
1297 return yystrlen (yystr);
1298
1299 return yystpcpy (yyres, yystr) - yyres;
1300 }
1301 # endif
1302
1303 /* Copy into YYRESULT an error message about the unexpected token
1304 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1305 including the terminating null byte. If YYRESULT is null, do not
1306 copy anything; just return the number of bytes that would be
1307 copied. As a special case, return 0 if an ordinary "syntax error"
1308 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1309 size calculation. */
1310 static YYSIZE_T
1311 yysyntax_error (char *yyresult, int yystate, int yychar)
1312 {
1313 int yyn = yypact[yystate];
1314
1315 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1316 return 0;
1317 else
1318 {
1319 int yytype = YYTRANSLATE (yychar);
1320 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1321 YYSIZE_T yysize = yysize0;
1322 YYSIZE_T yysize1;
1323 int yysize_overflow = 0;
1324 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1325 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1326 int yyx;
1327
1328 # if 0
1329 /* This is so xgettext sees the translatable formats that are
1330 constructed on the fly. */
1331 YY_("syntax error, unexpected %s");
1332 YY_("syntax error, unexpected %s, expecting %s");
1333 YY_("syntax error, unexpected %s, expecting %s or %s");
1334 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1335 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1336 # endif
1337 char *yyfmt;
1338 char const *yyf;
1339 static char const yyunexpected[] = "syntax error, unexpected %s";
1340 static char const yyexpecting[] = ", expecting %s";
1341 static char const yyor[] = " or %s";
1342 char yyformat[sizeof yyunexpected
1343 + sizeof yyexpecting - 1
1344 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1345 * (sizeof yyor - 1))];
1346 char const *yyprefix = yyexpecting;
1347
1348 /* Start YYX at -YYN if negative to avoid negative indexes in
1349 YYCHECK. */
1350 int yyxbegin = yyn < 0 ? -yyn : 0;
1351
1352 /* Stay within bounds of both yycheck and yytname. */
1353 int yychecklim = YYLAST - yyn + 1;
1354 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1355 int yycount = 1;
1356
1357 yyarg[0] = yytname[yytype];
1358 yyfmt = yystpcpy (yyformat, yyunexpected);
1359
1360 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1361 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1362 {
1363 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1364 {
1365 yycount = 1;
1366 yysize = yysize0;
1367 yyformat[sizeof yyunexpected - 1] = '\0';
1368 break;
1369 }
1370 yyarg[yycount++] = yytname[yyx];
1371 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1372 yysize_overflow |= (yysize1 < yysize);
1373 yysize = yysize1;
1374 yyfmt = yystpcpy (yyfmt, yyprefix);
1375 yyprefix = yyor;
1376 }
1377
1378 yyf = YY_(yyformat);
1379 yysize1 = yysize + yystrlen (yyf);
1380 yysize_overflow |= (yysize1 < yysize);
1381 yysize = yysize1;
1382
1383 if (yysize_overflow)
1384 return YYSIZE_MAXIMUM;
1385
1386 if (yyresult)
1387 {
1388 /* Avoid sprintf, as that infringes on the user's name space.
1389 Don't have undefined behavior even if the translation
1390 produced a string with the wrong number of "%s"s. */
1391 char *yyp = yyresult;
1392 int yyi = 0;
1393 while ((*yyp = *yyf) != '\0')
1394 {
1395 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1396 {
1397 yyp += yytnamerr (yyp, yyarg[yyi++]);
1398 yyf += 2;
1399 }
1400 else
1401 {
1402 yyp++;
1403 yyf++;
1404 }
1405 }
1406 }
1407 return yysize;
1408 }
1409 }
1410 #endif /* YYERROR_VERBOSE */
1411
1412
1413 /*-----------------------------------------------.
1414 | Release the memory associated to this symbol. |
1415 `-----------------------------------------------*/
1416
1417 /*ARGSUSED*/
1418 #if (defined __STDC__ || defined __C99__FUNC__ \
1419 || defined __cplusplus || defined _MSC_VER)
1420 static void
1421 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1422 #else
1423 static void
1424 yydestruct (yymsg, yytype, yyvaluep)
1425 const char *yymsg;
1426 int yytype;
1427 YYSTYPE *yyvaluep;
1428 #endif
1429 {
1430 YYUSE (yyvaluep);
1431
1432 if (!yymsg)
1433 yymsg = "Deleting";
1434 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1435
1436 switch (yytype)
1437 {
1438
1439 default:
1440 break;
1441 }
1442 }
1443
1444
1445 /* Prevent warnings from -Wmissing-prototypes. */
1446
1447 #ifdef YYPARSE_PARAM
1448 #if defined __STDC__ || defined __cplusplus
1449 int yyparse (void *YYPARSE_PARAM);
1450 #else
1451 int yyparse ();
1452 #endif
1453 #else /* ! YYPARSE_PARAM */
1454 #if defined __STDC__ || defined __cplusplus
1455 int yyparse (void);
1456 #else
1457 int yyparse ();
1458 #endif
1459 #endif /* ! YYPARSE_PARAM */
1460
1461
1462
1463 /* The look-ahead symbol. */
1464 int yychar;
1465
1466 /* The semantic value of the look-ahead symbol. */
1467 YYSTYPE yylval;
1468
1469 /* Number of syntax errors so far. */
1470 int yynerrs;
1471
1472
1473
1474 /*----------.
1475 | yyparse. |
1476 `----------*/
1477
1478 #ifdef YYPARSE_PARAM
1479 #if (defined __STDC__ || defined __C99__FUNC__ \
1480 || defined __cplusplus || defined _MSC_VER)
1481 int
1482 yyparse (void *YYPARSE_PARAM)
1483 #else
1484 int
1485 yyparse (YYPARSE_PARAM)
1486 void *YYPARSE_PARAM;
1487 #endif
1488 #else /* ! YYPARSE_PARAM */
1489 #if (defined __STDC__ || defined __C99__FUNC__ \
1490 || defined __cplusplus || defined _MSC_VER)
1491 int
1492 yyparse (void)
1493 #else
1494 int
1495 yyparse ()
1496
1497 #endif
1498 #endif
1499 {
1500
1501 int yystate;
1502 int yyn;
1503 int yyresult;
1504 /* Number of tokens to shift before error messages enabled. */
1505 int yyerrstatus;
1506 /* Look-ahead token as an internal (translated) token number. */
1507 int yytoken = 0;
1508 #if YYERROR_VERBOSE
1509 /* Buffer for error messages, and its allocated size. */
1510 char yymsgbuf[128];
1511 char *yymsg = yymsgbuf;
1512 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1513 #endif
1514
1515 /* Three stacks and their tools:
1516 `yyss': related to states,
1517 `yyvs': related to semantic values,
1518 `yyls': related to locations.
1519
1520 Refer to the stacks thru separate pointers, to allow yyoverflow
1521 to reallocate them elsewhere. */
1522
1523 /* The state stack. */
1524 yytype_int16 yyssa[YYINITDEPTH];
1525 yytype_int16 *yyss = yyssa;
1526 yytype_int16 *yyssp;
1527
1528 /* The semantic value stack. */
1529 YYSTYPE yyvsa[YYINITDEPTH];
1530 YYSTYPE *yyvs = yyvsa;
1531 YYSTYPE *yyvsp;
1532
1533
1534
1535 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1536
1537 YYSIZE_T yystacksize = YYINITDEPTH;
1538
1539 /* The variables used to return semantic value and location from the
1540 action routines. */
1541 YYSTYPE yyval;
1542
1543
1544 /* The number of symbols on the RHS of the reduced rule.
1545 Keep to zero when no symbol should be popped. */
1546 int yylen = 0;
1547
1548 YYDPRINTF ((stderr, "Starting parse\n"));
791 #define YYPOPSTACK (yyvsp--, yyssp--)
792 #endif
793
794 int yystacksize = YYINITDEPTH;
795 int yyfree_stacks = 0;
796
797 #ifdef YYPURE
798 int yychar;
799 YYSTYPE yylval;
800 int yynerrs;
801 #ifdef YYLSP_NEEDED
802 YYLTYPE yylloc;
803 #endif
804 #endif
805
806 YYSTYPE yyval; /* the variable used to return */
807 /* semantic values from the action */
808 /* routines */
809
810 int yylen;
811
812 #if YYDEBUG != 0
813 if (yydebug)
814 fprintf(stderr, "Starting parse\n");
815 #endif
1549816
1550817 yystate = 0;
1551818 yyerrstatus = 0;
1557824 so that they stay on the same level as the state stack.
1558825 The wasted elements are never initialized. */
1559826
1560 yyssp = yyss;
827 yyssp = yyss - 1;
1561828 yyvsp = yyvs;
1562
1563 goto yysetstate;
1564
1565 /*------------------------------------------------------------.
1566 | yynewstate -- Push a new state, which is found in yystate. |
1567 `------------------------------------------------------------*/
1568 yynewstate:
1569 /* In all cases, when you get here, the value and location stacks
1570 have just been pushed. So pushing a state here evens the stacks. */
1571 yyssp++;
1572
1573 yysetstate:
1574 *yyssp = yystate;
1575
1576 if (yyss + yystacksize - 1 <= yyssp)
829 #ifdef YYLSP_NEEDED
830 yylsp = yyls;
831 #endif
832
833 /* Push a new state, which is found in yystate . */
834 /* In all cases, when you get here, the value and location stacks
835 have just been pushed. so pushing a state here evens the stacks. */
836 yynewstate:
837
838 *++yyssp = yystate;
839
840 if (yyssp >= yyss + yystacksize - 1)
1577841 {
842 /* Give user a chance to reallocate the stack */
843 /* Use copies of these so that the &'s don't force the real ones into memory. */
844 YYSTYPE *yyvs1 = yyvs;
845 short *yyss1 = yyss;
846 #ifdef YYLSP_NEEDED
847 YYLTYPE *yyls1 = yyls;
848 #endif
849
1578850 /* Get the current used size of the three stacks, in elements. */
1579 YYSIZE_T yysize = yyssp - yyss + 1;
851 int size = yyssp - yyss + 1;
1580852
1581853 #ifdef yyoverflow
1582 {
1583 /* Give user a chance to reallocate the stack. Use copies of
1584 these so that the &'s don't force the real ones into
1585 memory. */
1586 YYSTYPE *yyvs1 = yyvs;
1587 yytype_int16 *yyss1 = yyss;
1588
1589
1590 /* Each stack pointer address is followed by the size of the
1591 data in use in that stack, in bytes. This used to be a
1592 conditional around just the two extra args, but that might
1593 be undefined if yyoverflow is a macro. */
1594 yyoverflow (YY_("memory exhausted"),
1595 &yyss1, yysize * sizeof (*yyssp),
1596 &yyvs1, yysize * sizeof (*yyvsp),
1597
1598 &yystacksize);
1599
1600 yyss = yyss1;
1601 yyvs = yyvs1;
1602 }
854 /* Each stack pointer address is followed by the size of
855 the data in use in that stack, in bytes. */
856 #ifdef YYLSP_NEEDED
857 /* This used to be a conditional around just the two extra args,
858 but that might be undefined if yyoverflow is a macro. */
859 yyoverflow("parser stack overflow",
860 &yyss1, size * sizeof (*yyssp),
861 &yyvs1, size * sizeof (*yyvsp),
862 &yyls1, size * sizeof (*yylsp),
863 &yystacksize);
864 #else
865 yyoverflow("parser stack overflow",
866 &yyss1, size * sizeof (*yyssp),
867 &yyvs1, size * sizeof (*yyvsp),
868 &yystacksize);
869 #endif
870
871 yyss = yyss1; yyvs = yyvs1;
872 #ifdef YYLSP_NEEDED
873 yyls = yyls1;
874 #endif
1603875 #else /* no yyoverflow */
1604 # ifndef YYSTACK_RELOCATE
1605 goto yyexhaustedlab;
1606 # else
1607876 /* Extend the stack our own way. */
1608 if (YYMAXDEPTH <= yystacksize)
1609 goto yyexhaustedlab;
877 if (yystacksize >= YYMAXDEPTH)
878 {
879 yyerror("parser stack overflow");
880 if (yyfree_stacks)
881 {
882 free (yyss);
883 free (yyvs);
884 #ifdef YYLSP_NEEDED
885 free (yyls);
886 #endif
887 }
888 return 2;
889 }
1610890 yystacksize *= 2;
1611 if (YYMAXDEPTH < yystacksize)
891 if (yystacksize > YYMAXDEPTH)
1612892 yystacksize = YYMAXDEPTH;
1613
1614 {
1615 yytype_int16 *yyss1 = yyss;
1616 union yyalloc *yyptr =
1617 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1618 if (! yyptr)
1619 goto yyexhaustedlab;
1620 YYSTACK_RELOCATE (yyss);
1621 YYSTACK_RELOCATE (yyvs);
1622
1623 # undef YYSTACK_RELOCATE
1624 if (yyss1 != yyssa)
1625 YYSTACK_FREE (yyss1);
1626 }
1627 # endif
893 #ifndef YYSTACK_USE_ALLOCA
894 yyfree_stacks = 1;
895 #endif
896 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
897 __yy_memcpy ((char *)yyss, (char *)yyss1,
898 size * (unsigned int) sizeof (*yyssp));
899 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
900 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
901 size * (unsigned int) sizeof (*yyvsp));
902 #ifdef YYLSP_NEEDED
903 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
904 __yy_memcpy ((char *)yyls, (char *)yyls1,
905 size * (unsigned int) sizeof (*yylsp));
906 #endif
1628907 #endif /* no yyoverflow */
1629908
1630 yyssp = yyss + yysize - 1;
1631 yyvsp = yyvs + yysize - 1;
1632
1633
1634 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1635 (unsigned long int) yystacksize));
1636
1637 if (yyss + yystacksize - 1 <= yyssp)
909 yyssp = yyss + size - 1;
910 yyvsp = yyvs + size - 1;
911 #ifdef YYLSP_NEEDED
912 yylsp = yyls + size - 1;
913 #endif
914
915 #if YYDEBUG != 0
916 if (yydebug)
917 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
918 #endif
919
920 if (yyssp >= yyss + yystacksize - 1)
1638921 YYABORT;
1639922 }
1640923
1641 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
924 #if YYDEBUG != 0
925 if (yydebug)
926 fprintf(stderr, "Entering state %d\n", yystate);
927 #endif
1642928
1643929 goto yybackup;
1644
1645 /*-----------.
1646 | yybackup. |
1647 `-----------*/
1648 yybackup:
1649
1650 /* Do appropriate processing given the current state. Read a
1651 look-ahead token if we need one and don't already have one. */
1652
1653 /* First try to decide what to do without reference to look-ahead token. */
930 yybackup:
931
932 /* Do appropriate processing given the current state. */
933 /* Read a lookahead token if we need one and don't already have one. */
934 /* yyresume: */
935
936 /* First try to decide what to do without reference to lookahead token. */
937
1654938 yyn = yypact[yystate];
1655 if (yyn == YYPACT_NINF)
939 if (yyn == YYFLAG)
1656940 goto yydefault;
1657941
1658 /* Not known => get a look-ahead token if don't already have one. */
1659
1660 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
942 /* Not known => get a lookahead token if don't already have one. */
943
944 /* yychar is either YYEMPTY or YYEOF
945 or a valid token in external form. */
946
1661947 if (yychar == YYEMPTY)
1662948 {
1663 YYDPRINTF ((stderr, "Reading a token: "));
949 #if YYDEBUG != 0
950 if (yydebug)
951 fprintf(stderr, "Reading a token: ");
952 #endif
1664953 yychar = YYLEX;
1665954 }
1666955
1667 if (yychar <= YYEOF)
956 /* Convert token to internal form (in yychar1) for indexing tables with */
957
958 if (yychar <= 0) /* This means end of input. */
1668959 {
1669 yychar = yytoken = YYEOF;
1670 YYDPRINTF ((stderr, "Now at end of input.\n"));
960 yychar1 = 0;
961 yychar = YYEOF; /* Don't call YYLEX any more */
962
963 #if YYDEBUG != 0
964 if (yydebug)
965 fprintf(stderr, "Now at end of input.\n");
966 #endif
1671967 }
1672968 else
1673969 {
1674 yytoken = YYTRANSLATE (yychar);
1675 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1676 }
1677
1678 /* If the proper action on seeing token YYTOKEN is to reduce or to
1679 detect an error, take that action. */
1680 yyn += yytoken;
1681 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
970 yychar1 = YYTRANSLATE(yychar);
971
972 #if YYDEBUG != 0
973 if (yydebug)
974 {
975 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
976 /* Give the individual parser a way to print the precise meaning
977 of a token, for further debugging info. */
978 #ifdef YYPRINT
979 YYPRINT (stderr, yychar, yylval);
980 #endif
981 fprintf (stderr, ")\n");
982 }
983 #endif
984 }
985
986 yyn += yychar1;
987 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1682988 goto yydefault;
989
1683990 yyn = yytable[yyn];
1684 if (yyn <= 0)
991
992 /* yyn is what to do for this token type in this state.
993 Negative => reduce, -yyn is rule number.
994 Positive => shift, yyn is new state.
995 New state is final state => don't bother to shift,
996 just return success.
997 0, or most negative number => error. */
998
999 if (yyn < 0)
16851000 {
1686 if (yyn == 0 || yyn == YYTABLE_NINF)
1001 if (yyn == YYFLAG)
16871002 goto yyerrlab;
16881003 yyn = -yyn;
16891004 goto yyreduce;
16901005 }
1006 else if (yyn == 0)
1007 goto yyerrlab;
16911008
16921009 if (yyn == YYFINAL)
16931010 YYACCEPT;
16941011
1695 /* Count tokens shifted since error; after three, turn off error
1696 status. */
1697 if (yyerrstatus)
1698 yyerrstatus--;
1699
1700 /* Shift the look-ahead token. */
1701 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1702
1703 /* Discard the shifted token unless it is eof. */
1012 /* Shift the lookahead token. */
1013
1014 #if YYDEBUG != 0
1015 if (yydebug)
1016 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1017 #endif
1018
1019 /* Discard the token being shifted unless it is eof. */
17041020 if (yychar != YYEOF)
17051021 yychar = YYEMPTY;
17061022
1023 *++yyvsp = yylval;
1024 #ifdef YYLSP_NEEDED
1025 *++yylsp = yylloc;
1026 #endif
1027
1028 /* count tokens shifted since error; after three, turn off error status. */
1029 if (yyerrstatus) yyerrstatus--;
1030
17071031 yystate = yyn;
1708 *++yyvsp = yylval;
1709
17101032 goto yynewstate;
17111033
1712
1713 /*-----------------------------------------------------------.
1714 | yydefault -- do the default action for the current state. |
1715 `-----------------------------------------------------------*/
1034 /* Do the default action for the current state. */
17161035 yydefault:
1036
17171037 yyn = yydefact[yystate];
17181038 if (yyn == 0)
17191039 goto yyerrlab;
1720 goto yyreduce;
1721
1722
1723 /*-----------------------------.
1724 | yyreduce -- Do a reduction. |
1725 `-----------------------------*/
1040
1041 /* Do a reduction. yyn is the number of a rule to reduce with. */
17261042 yyreduce:
1727 /* yyn is the number of a rule to reduce with. */
17281043 yylen = yyr2[yyn];
1729
1730 /* If YYLEN is nonzero, implement the default value of the action:
1731 `$$ = $1'.
1732
1733 Otherwise, the following line sets YYVAL to garbage.
1734 This behavior is undocumented and Bison
1735 users should not rely upon it. Assigning to YYVAL
1736 unconditionally makes the parser a bit smaller, and it avoids a
1737 GCC warning that YYVAL may be used uninitialized. */
1738 yyval = yyvsp[1-yylen];
1739
1740
1741 YY_REDUCE_PRINT (yyn);
1742 switch (yyn)
1044 if (yylen > 0)
1045 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1046
1047 #if YYDEBUG != 0
1048 if (yydebug)
17431049 {
1744 case 2:
1745 #line 246 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1746 {
1050 int i;
1051
1052 fprintf (stderr, "Reducing via rule %d (line %d), ",
1053 yyn, yyrline[yyn]);
1054
1055 /* Print the symbols being reduced, and their result. */
1056 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1057 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1058 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1059 }
1060 #endif
1061
1062
1063 switch (yyn) {
1064
1065 case 1:
1066 #line 246 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1067 {
17471068 if (CurDefmPrefix) {
17481069 // If CurDefmPrefix is set, we're parsing a defm, which means that this is
17491070 // actually the name of a multiclass.
1750 MultiClass *MC = MultiClasses[*(yyvsp[(1) - (1)].StrVal)];
1071 MultiClass *MC = MultiClasses[*yyvsp[0].StrVal];
17511072 if (MC == 0) {
1752 err() << "Couldn't find class '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
1073 err() << "Couldn't find class '" << *yyvsp[0].StrVal << "'!\n";
17531074 exit(1);
17541075 }
1755 (yyval.Rec) = &MC->Rec;
1076 yyval.Rec = &MC->Rec;
17561077 } else {
1757 (yyval.Rec) = Records.getClass(*(yyvsp[(1) - (1)].StrVal));
1758 }
1759 if ((yyval.Rec) == 0) {
1760 err() << "Couldn't find class '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
1078 yyval.Rec = Records.getClass(*yyvsp[0].StrVal);
1079 }
1080 if (yyval.Rec == 0) {
1081 err() << "Couldn't find class '" << *yyvsp[0].StrVal << "'!\n";
17611082 exit(1);
17621083 }
1763 delete (yyvsp[(1) - (1)].StrVal);
1764 ;}
1765 break;
1766
1767 case 3:
1768 #line 268 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1769 { // string type
1770 (yyval.Ty) = new StringRecTy();
1771 ;}
1772 break;
1773
1774 case 4:
1775 #line 270 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1776 { // bit type
1777 (yyval.Ty) = new BitRecTy();
1778 ;}
1779 break;
1780
1781 case 5:
1782 #line 272 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1783 { // bits type
1784 (yyval.Ty) = new BitsRecTy((yyvsp[(3) - (4)].IntVal));
1785 ;}
1786 break;
1787
1788 case 6:
1789 #line 274 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1790 { // int type
1791 (yyval.Ty) = new IntRecTy();
1792 ;}
1793 break;
1794
1795 case 7:
1796 #line 276 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1797 { // list type
1798 (yyval.Ty) = new ListRecTy((yyvsp[(3) - (4)].Ty));
1799 ;}
1800 break;
1801
1802 case 8:
1803 #line 278 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1804 { // code type
1805 (yyval.Ty) = new CodeRecTy();
1806 ;}
1807 break;
1808
1809 case 9:
1810 #line 280 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1811 { // dag type
1812 (yyval.Ty) = new DagRecTy();
1813 ;}
1814 break;
1815
1816 case 10:
1817 #line 282 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1818 { // Record Type
1819 (yyval.Ty) = new RecordRecTy((yyvsp[(1) - (1)].Rec));
1820 ;}
1821 break;
1822
1823 case 11:
1824 #line 286 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1825 { (yyval.IntVal) = 0; ;}
1826 break;
1827
1828 case 12:
1829 #line 286 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1830 { (yyval.IntVal) = 1; ;}
1831 break;
1832
1833 case 13:
1834 #line 288 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1835 { (yyval.Initializer) = 0; ;}
1836 break;
1837
1838 case 14:
1839 #line 288 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1840 { (yyval.Initializer) = (yyvsp[(2) - (2)].Initializer); ;}
1841 break;
1842
1843 case 15:
1844 #line 290 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1845 {
1846 if (const RecordVal *RV = (CurRec ? CurRec->getValue(*(yyvsp[(1) - (1)].StrVal)) : 0)) {
1847 (yyval.Initializer) = new VarInit(*(yyvsp[(1) - (1)].StrVal), RV->getType());
1848 } else if (CurRec && CurRec->isTemplateArg(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal))) {
1849 const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal));
1084 delete yyvsp[0].StrVal;
1085 ;
1086 break;}
1087 case 2:
1088 #line 268 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1089 { // string type
1090 yyval.Ty = new StringRecTy();
1091 ;
1092 break;}
1093 case 3:
1094 #line 270 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1095 { // bit type
1096 yyval.Ty = new BitRecTy();
1097 ;
1098 break;}
1099 case 4:
1100 #line 272 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1101 { // bits type
1102 yyval.Ty = new BitsRecTy(yyvsp[-1].IntVal);
1103 ;
1104 break;}
1105 case 5:
1106 #line 274 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1107 { // int type
1108 yyval.Ty = new IntRecTy();
1109 ;
1110 break;}
1111 case 6:
1112 #line 276 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1113 { // list type
1114 yyval.Ty = new ListRecTy(yyvsp[-1].Ty);
1115 ;
1116 break;}
1117 case 7:
1118 #line 278 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1119 { // code type
1120 yyval.Ty = new CodeRecTy();
1121 ;
1122 break;}
1123 case 8:
1124 #line 280 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1125 { // dag type
1126 yyval.Ty = new DagRecTy();
1127 ;
1128 break;}
1129 case 9:
1130 #line 282 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1131 { // Record Type
1132 yyval.Ty = new RecordRecTy(yyvsp[0].Rec);
1133 ;
1134 break;}
1135 case 10:
1136 #line 286 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1137 { yyval.IntVal = 0; ;
1138 break;}
1139 case 11:
1140 #line 286 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1141 { yyval.IntVal = 1; ;
1142 break;}
1143 case 12:
1144 #line 288 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1145 { yyval.Initializer = 0; ;
1146 break;}
1147 case 13:
1148 #line 288 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1149 { yyval.Initializer = yyvsp[0].Initializer; ;
1150 break;}
1151 case 14:
1152 #line 290 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1153 {
1154 if (const RecordVal *RV = (CurRec ? CurRec->getValue(*yyvsp[0].StrVal) : 0)) {
1155 yyval.Initializer = new VarInit(*yyvsp[0].StrVal, RV->getType());
1156 } else if (CurRec && CurRec->isTemplateArg(CurRec->getName()+":"+*yyvsp[0].StrVal)) {
1157 const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*yyvsp[0].StrVal);
18501158 assert(RV && "Template arg doesn't exist??");
1851 (yyval.Initializer) = new VarInit(CurRec->getName()+":"+*(yyvsp[(1) - (1)].StrVal), RV->getType());
1159 yyval.Initializer = new VarInit(CurRec->getName()+":"+*yyvsp[0].StrVal, RV->getType());
18521160 } else if (CurMultiClass &&
1853 CurMultiClass->Rec.isTemplateArg(CurMultiClass->Rec.getName()+"::"+*(yyvsp[(1) - (1)].StrVal))) {
1854 std::string Name = CurMultiClass->Rec.getName()+"::"+*(yyvsp[(1) - (1)].StrVal);
1161 CurMultiClass->Rec.isTemplateArg(CurMultiClass->Rec.getName()+"::"+*yyvsp[0].StrVal)) {
1162 std::string Name = CurMultiClass->Rec.getName()+"::"+*yyvsp[0].StrVal;
18551163 const RecordVal *RV = CurMultiClass->Rec.getValue(Name);
18561164 assert(RV && "Template arg doesn't exist??");
1857 (yyval.Initializer) = new VarInit(Name, RV->getType());
1858 } else if (Record *D = Records.getDef(*(yyvsp[(1) - (1)].StrVal))) {
1859 (yyval.Initializer) = new DefInit(D);
1165 yyval.Initializer = new VarInit(Name, RV->getType());
1166 } else if (Record *D = Records.getDef(*yyvsp[0].StrVal)) {
1167 yyval.Initializer = new DefInit(D);
18601168 } else {
1861 err() << "Variable not defined: '" << *(yyvsp[(1) - (1)].StrVal) << "'!\n";
1169 err() << "Variable not defined: '" << *yyvsp[0].StrVal << "'!\n";
18621170 exit(1);
18631171 }
18641172
1865 delete (yyvsp[(1) - (1)].StrVal);
1866 ;}
1867 break;
1868
1869 case 16:
1870 #line 313 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1871 {
1872 (yyval.Initializer) = (yyvsp[(1) - (1)].Initializer);
1873 ;}
1874 break;
1875
1876 case 17:
1877 #line 315 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1878 {
1879 (yyval.Initializer) = new IntInit((yyvsp[(1) - (1)].IntVal));
1880 ;}
1881 break;
1882
1883 case 18:
1884 #line 317 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1885 {
1886 (yyval.Initializer) = new StringInit(*(yyvsp[(1) - (1)].StrVal));
1887 delete (yyvsp[(1) - (1)].StrVal);
1888 ;}
1889 break;
1890
1891 case 19:
1892 #line 320 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1893 {
1894 (yyval.Initializer) = new CodeInit(*(yyvsp[(1) - (1)].StrVal));
1895 delete (yyvsp[(1) - (1)].StrVal);
1896 ;}
1897 break;
1898
1899 case 20:
1900 #line 323 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1901 {
1902 (yyval.Initializer) = new UnsetInit();
1903 ;}
1904 break;
1905
1906 case 21:
1907 #line 325 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1908 {
1909 BitsInit *Init = new BitsInit((yyvsp[(2) - (3)].FieldList)->size());
1910 for (unsigned i = 0, e = (yyvsp[(2) - (3)].FieldList)->size(); i != e; ++i) {
1911 struct Init *Bit = (*(yyvsp[(2) - (3)].FieldList))[i]->convertInitializerTo(new BitRecTy());
1173 delete yyvsp[0].StrVal;
1174 ;
1175 break;}
1176 case 15:
1177 #line 313 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1178 {
1179 yyval.Initializer = yyvsp[0].Initializer;
1180 ;
1181 break;}
1182 case 16:
1183 #line 315 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1184 {
1185 yyval.Initializer = new IntInit(yyvsp[0].IntVal);
1186 ;
1187 break;}
1188 case 17:
1189 #line 317 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1190 {
1191 yyval.Initializer = new StringInit(*yyvsp[0].StrVal);
1192 delete yyvsp[0].StrVal;
1193 ;
1194 break;}
1195 case 18:
1196 #line 320 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1197 {
1198 yyval.Initializer = new CodeInit(*yyvsp[0].StrVal);
1199 delete yyvsp[0].StrVal;
1200 ;
1201 break;}
1202 case 19:
1203 #line 323 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1204 {
1205 yyval.Initializer = new UnsetInit();
1206 ;
1207 break;}
1208 case 20:
1209 #line 325 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1210 {
1211 BitsInit *Init = new BitsInit(yyvsp[-1].FieldList->size());
1212 for (unsigned i = 0, e = yyvsp[-1].FieldList->size(); i != e; ++i) {
1213 struct Init *Bit = (*yyvsp[-1].FieldList)[i]->convertInitializerTo(new BitRecTy());
19121214 if (Bit == 0) {
1913 err() << "Element #" << i << " (" << *(*(yyvsp[(2) - (3)].FieldList))[i]
1215 err() << "Element #" << i << " (" << *(*yyvsp[-1].FieldList)[i]
19141216 << ") is not convertable to a bit!\n";
19151217 exit(1);
19161218 }
1917 Init->setBit((yyvsp[(2) - (3)].FieldList)->size()-i-1, Bit);
1918 }
1919 (yyval.Initializer) = Init;
1920 delete (yyvsp[(2) - (3)].FieldList);
1921 ;}
1922 break;
1923
1924 case 22:
1925 #line 338 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1926 {
1219 Init->setBit(yyvsp[-1].FieldList->size()-i-1, Bit);
1220 }
1221 yyval.Initializer = Init;
1222 delete yyvsp[-1].FieldList;
1223 ;
1224 break;}
1225 case 21:
1226 #line 338 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1227 {
19271228 // This is a CLASS expression. This is supposed to synthesize
19281229 // a new anonymous definition, deriving from CLASS with no
19291230 // body.
1930 Record *Class = Records.getClass(*(yyvsp[(1) - (4)].StrVal));
1231 Record *Class = Records.getClass(*yyvsp[-3].StrVal);
19311232 if (!Class) {
1932 err() << "Expected a class, got '" << *(yyvsp[(1) - (4)].StrVal) << "'!\n";
1233 err() << "Expected a class, got '" << *yyvsp[-3].StrVal << "'!\n";
19331234 exit(1);
19341235 }
1935 delete (yyvsp[(1) - (4)].StrVal);
1236 delete yyvsp[-3].StrVal;
19361237
19371238 static unsigned AnonCounter = 0;
19381239 Record *OldRec = CurRec; // Save CurRec.
19391240
19401241 // Create the new record, set it as CurRec temporarily.
19411242 CurRec = new Record("anonymous.val."+utostr(AnonCounter++));
1942 addSubClass(Class, *(yyvsp[(3) - (4)].FieldList)); // Add info about the subclass to CurRec.
1943 delete (yyvsp[(3) - (4)].FieldList); // Free up the template args.
1243 addSubClass(Class, *yyvsp[-1].FieldList); // Add info about the subclass to CurRec.
1244 delete yyvsp[-1].FieldList; // Free up the template args.
19441245
19451246 CurRec->resolveReferences();
19461247
19471248 Records.addDef(CurRec);
19481249
19491250 // The result of the expression is a reference to the new record.
1950 (yyval.Initializer) = new DefInit(CurRec);
1251 yyval.Initializer = new DefInit(CurRec);
19511252
19521253 // Restore the old CurRec
19531254 CurRec = OldRec;
1954 ;}
1955 break;
1956
1957 case 23:
1958 #line 366 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1959 {
1960 (yyval.Initializer) = (yyvsp[(1) - (4)].Initializer)->convertInitializerBitRange(*(yyvsp[(3) - (4)].BitList));
1961 if ((yyval.Initializer) == 0) {
1962 err() << "Invalid bit range for value '" << *(yyvsp[(1) - (4)].Initializer) << "'!\n";
1255 ;
1256 break;}
1257 case 22:
1258 #line 366 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1259 {
1260 yyval.Initializer = yyvsp[-3].Initializer->convertInitializerBitRange(*yyvsp[-1].BitList);
1261 if (yyval.Initializer == 0) {
1262 err() << "Invalid bit range for value '" << *yyvsp[-3].Initializer << "'!\n";
19631263 exit(1);
19641264 }
1965 delete (yyvsp[(3) - (4)].BitList);
1966 ;}
1967 break;
1968
1969 case 24:
1970 #line 373 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1971 {
1972 (yyval.Initializer) = new ListInit(*(yyvsp[(2) - (3)].FieldList));
1973 delete (yyvsp[(2) - (3)].FieldList);
1974 ;}
1975 break;
1976
1977 case 25:
1978 #line 376 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1979 {
1980 if (!(yyvsp[(1) - (3)].Initializer)->getFieldType(*(yyvsp[(3) - (3)].StrVal))) {
1981 err() << "Cannot access field '" << *(yyvsp[(3) - (3)].StrVal) << "' of value '" << *(yyvsp[(1) - (3)].Initializer) << "!\n";
1265 delete yyvsp[-1].BitList;
1266 ;
1267 break;}
1268 case 23:
1269 #line 373 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1270 {
1271 yyval.Initializer = new ListInit(*yyvsp[-1].FieldList);
1272 delete yyvsp[-1].FieldList;
1273 ;
1274 break;}
1275 case 24:
1276 #line 376 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1277 {
1278 if (!yyvsp[-2].Initializer->getFieldType(*yyvsp[0].StrVal)) {
1279 err() << "Cannot access field '" << *yyvsp[0].StrVal << "' of value '" << *yyvsp[-2].Initializer << "!\n";
19821280 exit(1);
19831281 }
1984 (yyval.Initializer) = new FieldInit((yyvsp[(1) - (3)].Initializer), *(yyvsp[(3) - (3)].StrVal));
1985 delete (yyvsp[(3) - (3)].StrVal);
1986 ;}
1987 break;
1988
1989 case 26:
1990 #line 383 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1991 {
1992 (yyval.Initializer) = new DagInit((yyvsp[(2) - (4)].Initializer), *(yyvsp[(3) - (4)].DagValueList));
1993 delete (yyvsp[(3) - (4)].DagValueList);
1994 ;}
1995 break;
1996
1997 case 27:
1998 #line 386 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
1999 {
2000 std::reverse((yyvsp[(3) - (4)].BitList)->begin(), (yyvsp[(3) - (4)].BitList)->end());
2001 (yyval.Initializer) = (yyvsp[(1) - (4)].Initializer)->convertInitListSlice(*(yyvsp[(3) - (4)].BitList));
2002 if ((yyval.Initializer) == 0) {
2003 err() << "Invalid list slice for value '" << *(yyvsp[(1) - (4)].Initializer) << "'!\n";
1282 yyval.Initializer = new FieldInit(yyvsp[-2].Initializer, *yyvsp[0].StrVal);
1283 delete yyvsp[0].StrVal;
1284 ;
1285 break;}
1286 case 25:
1287 #line 383 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1288 {
1289 yyval.Initializer = new DagInit(yyvsp[-2].Initializer, *yyvsp[-1].DagValueList);
1290 delete yyvsp[-1].DagValueList;
1291 ;
1292 break;}
1293 case 26:
1294 #line 386 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1295 {
1296 std::reverse(yyvsp[-1].BitList->begin(), yyvsp[-1].BitList->end());
1297 yyval.Initializer = yyvsp[-3].Initializer->convertInitListSlice(*yyvsp[-1].BitList);
1298 if (yyval.Initializer == 0) {
1299 err() << "Invalid list slice for value '" << *yyvsp[-3].Initializer << "'!\n";
20041300 exit(1);
20051301 }
2006 delete (yyvsp[(3) - (4)].BitList);
2007 ;}
2008 break;
2009
2010 case 28:
2011 #line 394 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2012 {
2013 (yyval.Initializer) = (new BinOpInit(BinOpInit::SHL, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
2014 ;}
2015 break;
2016
2017 case 29:
2018 #line 396 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2019 {
2020 (yyval.Initializer) = (new BinOpInit(BinOpInit::SRA, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
2021 ;}
2022 break;
2023
2024 case 30:
2025 #line 398 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2026 {
2027 (yyval.Initializer) = (new BinOpInit(BinOpInit::SRL, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
2028 ;}
2029 break;
2030
2031 case 31:
2032 #line 400 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2033 {
2034 (yyval.Initializer) = (new BinOpInit(BinOpInit::STRCONCAT, (yyvsp[(3) - (6)].Initializer), (yyvsp[(5) - (6)].Initializer)))->Fold();
2035 ;}
2036 break;
2037
2038 case 32:
2039 #line 404 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2040 {
2041 (yyval.StrVal) = new std::string();
2042 ;}
2043 break;
2044
2045 case 33:
2046 #line 407 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2047 {
2048 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
2049 ;}
2050 break;
2051
2052 case 34:
2053 #line 411 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2054 {
2055 (yyval.DagValueList) = new std::vector >();
2056 (yyval.DagValueList)->push_back(std::make_pair((yyvsp[(1) - (2)].Initializer), *(yyvsp[(2) - (2)].StrVal)));
2057 delete (yyvsp[(2) - (2)].StrVal);
2058 ;}
2059 break;
2060
2061 case 35:
2062 #line 416 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2063 {
2064 (yyvsp[(1) - (4)].DagValueList)->push_back(std::make_pair((yyvsp[(3) - (4)].Initializer), *(yyvsp[(4) - (4)].StrVal)));
2065 delete (yyvsp[(4) - (4)].StrVal);
2066 (yyval.DagValueList) = (yyvsp[(1) - (4)].DagValueList);
2067 ;}
2068 break;
2069
2070 case 36:
2071 #line 422 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2072 {
2073 (yyval.DagValueList) = new std::vector >();
2074 ;}
2075 break;
2076
2077 case 37:
2078 #line 425 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2079 { (yyval.DagValueList) = (yyvsp[(1) - (1)].DagValueList); ;}
2080 break;
2081
2082 case 38:
2083 #line 428 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2084 {
2085 (yyval.BitList) = new std::vector();
2086 (yyval.BitList)->push_back((yyvsp[(1) - (1)].IntVal));
2087 ;}
2088 break;
2089
2090 case 39:
2091 #line 431 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2092 {
2093 if ((yyvsp[(1) - (3)].IntVal) < 0 || (yyvsp[(3) - (3)].IntVal) < 0) {
2094 err() << "Invalid range: " << (yyvsp[(1) - (3)].IntVal) << "-" << (yyvsp[(3) - (3)].IntVal) << "!\n";
1302 delete yyvsp[-1].BitList;
1303 ;
1304 break;}
1305 case 27:
1306 #line 394 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1307 {
1308 yyval.Initializer = (new BinOpInit(BinOpInit::CONCAT, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
1309 ;
1310 break;}
1311 case 28:
1312 #line 396 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1313 {
1314 yyval.Initializer = (new BinOpInit(BinOpInit::SHL, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
1315 ;
1316 break;}
1317 case 29:
1318 #line 398 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1319 {
1320 yyval.Initializer = (new BinOpInit(BinOpInit::SRA, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
1321 ;
1322 break;}
1323 case 30:
1324 #line 400 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1325 {
1326 yyval.Initializer = (new BinOpInit(BinOpInit::SRL, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
1327 ;
1328 break;}
1329 case 31:
1330 #line 402 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1331 {
1332 yyval.Initializer = (new BinOpInit(BinOpInit::STRCONCAT, yyvsp[-3].Initializer, yyvsp[-1].Initializer))->Fold();
1333 ;
1334 break;}
1335 case 32:
1336 #line 406 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1337 {
1338 yyval.StrVal = new std::string();
1339 ;
1340 break;}
1341 case 33:
1342 #line 409 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1343 {
1344 yyval.StrVal = yyvsp[0].StrVal;
1345 ;
1346 break;}
1347 case 34:
1348 #line 413 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1349 {
1350 yyval.DagValueList = new std::vector >();
1351 yyval.DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
1352 delete yyvsp[0].StrVal;
1353 ;
1354 break;}
1355 case 35:
1356 #line 418 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1357 {
1358 yyvsp[-3].DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal));
1359 delete yyvsp[0].StrVal;
1360 yyval.DagValueList = yyvsp[-3].DagValueList;
1361 ;
1362 break;}
1363 case 36:
1364 #line 424 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1365 {
1366 yyval.DagValueList = new std::vector >();
1367 ;
1368 break;}
1369 case 37:
1370 #line 427 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1371 { yyval.DagValueList = yyvsp[0].DagValueList; ;
1372 break;}
1373 case 38:
1374 #line 430 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1375 {
1376 yyval.BitList = new std::vector();
1377 yyval.BitList->push_back(yyvsp[0].IntVal);
1378 ;
1379 break;}
1380 case 39:
1381 #line 433 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1382 {
1383 if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
1384 err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
20951385 exit(1);
20961386 }
2097 (yyval.BitList) = new std::vector();
2098 if ((yyvsp[(1) - (3)].IntVal) < (yyvsp[(3) - (3)].IntVal)) {
2099 for (int i = (yyvsp[(1) - (3)].IntVal); i <= (yyvsp[(3) - (3)].IntVal); ++i)
2100 (yyval.BitList)->push_back(i);
1387 yyval.BitList = new std::vector();
1388 if (yyvsp[-2].IntVal < yyvsp[0].IntVal) {
1389 for (int i = yyvsp[-2].IntVal; i <= yyvsp[0].IntVal; ++i)
1390 yyval.BitList->push_back(i);
21011391 } else {
2102 for (int i = (yyvsp[(1) - (3)].IntVal); i >= (yyvsp[(3) - (3)].IntVal); --i)
2103 (yyval.BitList)->push_back(i);
2104 }
2105 ;}
2106 break;
2107
2108 case 40:
2109 #line 444 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2110 {
2111 (yyvsp[(2) - (2)].IntVal) = -(yyvsp[(2) - (2)].IntVal);
2112 if ((yyvsp[(1) - (2)].IntVal) < 0 || (yyvsp[(2) - (2)].IntVal) < 0) {
2113 err() << "Invalid range: " << (yyvsp[(1) - (2)].IntVal) << "-" << (yyvsp[(2) - (2)].IntVal) << "!\n";
1392 for (int i = yyvsp[-2].IntVal; i >= yyvsp[0].IntVal; --i)
1393 yyval.BitList->push_back(i);
1394 }
1395 ;
1396 break;}
1397 case 40:
1398 #line 446 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1399 {
1400 yyvsp[0].IntVal = -yyvsp[0].IntVal;
1401 if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
1402 err() << "Invalid range: " << yyvsp[-1].IntVal << "-" << yyvsp[0].IntVal << "!\n";
21141403 exit(1);
21151404 }
2116 (yyval.BitList) = new std::vector();
2117 if ((yyvsp[(1) - (2)].IntVal) < (yyvsp[(2) - (2)].IntVal)) {
2118 for (int i = (yyvsp[(1) - (2)].IntVal); i <= (yyvsp[(2) - (2)].IntVal); ++i)
2119 (yyval.BitList)->push_back(i);
1405 yyval.BitList = new std::vector();
1406 if (yyvsp[-1].IntVal < yyvsp[0].IntVal) {
1407 for (int i = yyvsp[-1].IntVal; i <= yyvsp[0].IntVal; ++i)
1408 yyval.BitList->push_back(i);
21201409 } else {
2121 for (int i = (yyvsp[(1) - (2)].IntVal); i >= (yyvsp[(2) - (2)].IntVal); --i)
2122 (yyval.BitList)->push_back(i);
2123 }
2124 ;}
2125 break;
2126
2127 case 41:
2128 #line 458 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2129 {
2130 ((yyval.BitList)=(yyvsp[(1) - (3)].BitList))->push_back((yyvsp[(3) - (3)].IntVal));
2131 ;}
2132 break;
2133
2134 case 42:
2135 #line 460 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2136 {
2137 if ((yyvsp[(3) - (5)].IntVal) < 0 || (yyvsp[(5) - (5)].IntVal) < 0) {
2138 err() << "Invalid range: " << (yyvsp[(3) - (5)].IntVal) << "-" << (yyvsp[(5) - (5)].IntVal) << "!\n";
1410 for (int i = yyvsp[-1].IntVal; i >= yyvsp[0].IntVal; --i)
1411 yyval.BitList->push_back(i);
1412 }
1413 ;
1414 break;}
1415 case 41:
1416 #line 460 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1417 {
1418 (yyval.BitList=yyvsp[-2].BitList)->push_back(yyvsp[0].IntVal);
1419 ;
1420 break;}
1421 case 42:
1422 #line 462 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1423 {
1424 if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) {
1425 err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n";
21391426 exit(1);
21401427 }
2141 (yyval.BitList) = (yyvsp[(1) - (5)].BitList);
2142 if ((yyvsp[(3) - (5)].IntVal) < (yyvsp[(5) - (5)].IntVal)) {
2143 for (int i = (yyvsp[(3) - (5)].IntVal); i <= (yyvsp[(5) - (5)].IntVal); ++i)
2144 (yyval.BitList)->push_back(i);
1428 yyval.BitList = yyvsp[-4].BitList;
1429 if (yyvsp[-2].IntVal < yyvsp[0].IntVal) {
1430 for (int i = yyvsp[-2].IntVal; i <= yyvsp[0].IntVal; ++i)
1431 yyval.BitList->push_back(i);
21451432 } else {
2146 for (int i = (yyvsp[(3) - (5)].IntVal); i >= (yyvsp[(5) - (5)].IntVal); --i)
2147 (yyval.BitList)->push_back(i);
2148 }
2149 ;}
2150 break;
2151
2152 case 43:
2153 #line 473 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2154 {
2155 (yyvsp[(4) - (4)].IntVal) = -(yyvsp[(4) - (4)].IntVal);
2156 if ((yyvsp[(3) - (4)].IntVal) < 0 || (yyvsp[(4) - (4)].IntVal) < 0) {
2157 err() << "Invalid range: " << (yyvsp[(3) - (4)].IntVal) << "-" << (yyvsp[(4) - (4)].IntVal) << "!\n";
1433 for (int i = yyvsp[-2].IntVal; i >= yyvsp[0].IntVal; --i)
1434 yyval.BitList->push_back(i);
1435 }
1436 ;
1437 break;}
1438 case 43:
1439 #line 475 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1440 {
1441 yyvsp[0].IntVal = -yyvsp[0].IntVal;
1442 if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) {
1443 err() << "Invalid range: " << yyvsp[-1].IntVal << "-" << yyvsp[0].IntVal << "!\n";
21581444 exit(1);
21591445 }
2160 (yyval.BitList) = (yyvsp[(1) - (4)].BitList);
2161 if ((yyvsp[(3) - (4)].IntVal) < (yyvsp[(4) - (4)].IntVal)) {
2162 for (int i = (yyvsp[(3) - (4)].IntVal); i <= (yyvsp[(4) - (4)].IntVal); ++i)
2163 (yyval.BitList)->push_back(i);
1446 yyval.BitList = yyvsp[-3].BitList;
1447 if (yyvsp[-1].IntVal < yyvsp[0].IntVal) {
1448 for (int i = yyvsp[-1].IntVal; i <= yyvsp[0].IntVal; ++i)
1449 yyval.BitList->push_back(i);
21641450 } else {
2165 for (int i = (yyvsp[(3) - (4)].IntVal); i >= (yyvsp[(4) - (4)].IntVal); --i)
2166 (yyval.BitList)->push_back(i);
2167 }
2168 ;}
2169 break;
2170
2171 case 44:
2172 #line 489 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2173 { (yyval.BitList) = (yyvsp[(1) - (1)].BitList); std::reverse((yyvsp[(1) - (1)].BitList)->begin(), (yyvsp[(1) - (1)].BitList)->end()); ;}
2174 break;
2175
2176 case 45:
2177 #line 491 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2178 { (yyval.BitList) = 0; ;}
2179 break;
2180
2181 case 46:
2182 #line 491 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2183 { (yyval.BitList) = (yyvsp[(2) - (3)].BitList); ;}
2184 break;
2185
2186 case 47:
2187 #line 495 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2188 {
2189 (yyval.FieldList) = new std::vector();
2190 ;}
2191 break;
2192
2193 case 48:
2194 #line 497 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2195 {
2196 (yyval.FieldList) = (yyvsp[(1) - (1)].FieldList);
2197 ;}
2198 break;
2199
2200 case 49:
2201 #line 501 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2202 {
2203 (yyval.FieldList) = new std::vector();
2204 (yyval.FieldList)->push_back((yyvsp[(1) - (1)].Initializer));
2205 ;}
2206 break;
2207
2208 case 50:
2209 #line 504 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2210 {
2211 ((yyval.FieldList) = (yyvsp[(1) - (3)].FieldList))->push_back((yyvsp[(3) - (3)].Initializer));
2212 ;}
2213 break;
2214
2215 case 51:
2216 #line 508 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2217 {
2218 std::string DecName = *(yyvsp[(3) - (4)].StrVal);
1451 for (int i = yyvsp[-1].IntVal; i >= yyvsp[0].IntVal; --i)
1452 yyval.BitList->push_back(i);
1453 }
1454 ;
1455 break;}
1456 case 44:
1457 #line 491 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1458 { yyval.BitList = yyvsp[0].BitList; std::reverse(yyvsp[0].BitList->begin(), yyvsp[0].BitList->end()); ;
1459 break;}
1460 case 45:
1461 #line 493 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1462 { yyval.BitList = 0; ;
1463 break;}
1464 case 46:
1465 #line 493 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1466 { yyval.BitList = yyvsp[-1].BitList; ;
1467 break;}
1468 case 47:
1469 #line 497 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1470 {
1471 yyval.FieldList = new std::vector();
1472 ;
1473 break;}
1474 case 48:
1475 #line 499 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1476 {
1477 yyval.FieldList = yyvsp[0].FieldList;
1478 ;
1479 break;}
1480 case 49:
1481 #line 503 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1482 {
1483 yyval.FieldList = new std::vector();
1484 yyval.FieldList->push_back(yyvsp[0].Initializer);
1485 ;
1486 break;}
1487 case 50:
1488 #line 506 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1489 {
1490 (yyval.FieldList = yyvsp[-2].FieldList)->push_back(yyvsp[0].Initializer);
1491 ;
1492 break;}
1493 case 51:
1494 #line 510 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
1495 {
1496 std::string DecName = *yyvsp[-1].StrVal;
22191497 if (ParsingTemplateArgs) {
22201498 if (CurRec) {
22211499 DecName = CurRec->getName() + ":" + DecName;
22261504 DecName = CurMultiClass->Rec.getName() + "::" + DecName;
22271505 }
22281506
2229 addValue(RecordVal(DecName, (yyvsp[(2) - (4)].Ty), (yyvsp[(1) - (4)].IntVal)));
2230 setValue(DecName, 0, (yyvsp[(4) - (4)].Initializer));
2231 (yyval.StrVal) = new std::string(DecName);
2232 ;}
2233 break;
2234
2235 case 52:
2236 #line 525 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2237 {
2238 delete (yyvsp[(1) - (2)].StrVal);
2239 ;}
2240 break;
2241
2242 case 53:
2243 #line 527 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2244 {
2245 setValue(*(yyvsp[(2) - (6)].StrVal), (yyvsp[(3) - (6)].BitList), (yyvsp[(5) - (6)].Initializer));
2246 delete (yyvsp[(2) - (6)].StrVal);
2247 delete (yyvsp[(3) - (6)].BitList);
2248 ;}
2249 break;
2250
2251 case 58:
2252 #line 536 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2253 {
2254 (yyval.SubClassRef) = new SubClassRefTy((yyvsp[(1) - (1)].Rec), new std::vector());
2255 ;}
2256 break;
2257
2258 case 59:
2259 #line 538 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2260 {
2261 (yyval.SubClassRef) = new SubClassRefTy((yyvsp[(1) - (4)].Rec), (yyvsp[(3) - (4)].FieldList));
2262 ;}
2263 break;
2264
2265 case 60:
2266 #line 542 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2267 {
2268 (yyval.SubClassList) = new std::vector();
2269 (yyval.SubClassList)->push_back(*(yyvsp[(1) - (1)].SubClassRef));
2270 delete (yyvsp[(1) - (1)].SubClassRef);
2271 ;}
2272 break;
2273
2274 case 61:
2275 #line 547 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2276 {
2277 ((yyval.SubClassList)=(yyvsp[(1) - (3)].SubClassList))->push_back(*(yyvsp[(3) - (3)].SubClassRef));
2278 delete (yyvsp[(3) - (3)].SubClassRef);
2279 ;}
2280 break;
2281
2282 case 62:
2283 #line 552 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2284 {
2285 (yyval.SubClassList) = new std::vector();
2286 ;}
2287 break;
2288
2289 case 63:
2290 #line 555 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2291 {
2292 (yyval.SubClassList) = (yyvsp[(2) - (2)].SubClassList);
2293 ;}
2294 break;
2295
2296 case 64:
2297 #line 559 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2298 {
2299 getActiveRec()->addTemplateArg(*(yyvsp[(1) - (1)].StrVal));
2300 delete (yyvsp[(1) - (1)].StrVal);
2301 ;}
2302 break;
2303
2304 case 65:
2305 #line 562 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2306 {
2307 getActiveRec()->addTemplateArg(*(yyvsp[(3) - (3)].StrVal));
2308 delete (yyvsp[(3) - (3)].StrVal);
2309 ;}
2310 break;
2311
2312 case 66:
2313 #line 567 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2314 {;}
2315 break;
2316
2317 case 69:
2318 #line 570 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2319 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
2320 break;
2321
2322 case 70:
2323 #line 570 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2324 { (yyval.StrVal) = new std::string(); ;}
2325 break;
2326
2327 case 71:
2328 #line 572 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
2329 {
1507 addValue(RecordVal(DecName, yyvsp[-2].Ty, yyvsp[-3].IntVal));
1508 setValue(DecName, 0, yyvsp[0].Initializer);
1509 yyval.StrVal = new std::string(DecName);
1510 ;
1511 break;}
1512 case 52:
1513