|
1 /* A Bison parser, made by GNU Bison 2.4.1. */ |
|
2 |
|
3 /* Skeleton implementation for Bison's Yacc-like parsers in C |
|
4 |
|
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 |
|
6 Free Software Foundation, Inc. |
|
7 |
|
8 This program is free software: you can redistribute it and/or modify |
|
9 it under the terms of the GNU General Public License as published by |
|
10 the Free Software Foundation, either version 3 of the License, or |
|
11 (at your option) any later version. |
|
12 |
|
13 This program is distributed in the hope that it will be useful, |
|
14 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 GNU General Public License for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
|
20 |
|
21 /* As a special exception, you may create a larger work that contains |
|
22 part or all of the Bison parser skeleton and distribute that work |
|
23 under terms of your choice, so long as that work isn't itself a |
|
24 parser generator using the skeleton or a modified version thereof |
|
25 as a parser skeleton. Alternatively, if you modify or redistribute |
|
26 the parser skeleton itself, you may (at your option) remove this |
|
27 special exception, which will cause the skeleton and the resulting |
|
28 Bison output files to be licensed under the GNU General Public |
|
29 License without this special exception. |
|
30 |
|
31 This special exception was added by the Free Software Foundation in |
|
32 version 2.2 of Bison. */ |
|
33 |
|
34 /* C LALR(1) parser skeleton written by Richard Stallman, by |
|
35 simplifying the original so-called "semantic" parser. */ |
|
36 |
|
37 /* All symbols defined below should begin with yy or YY, to avoid |
|
38 infringing on user name space. This should be done even for local |
|
39 variables, as they might otherwise be expanded by user macros. |
|
40 There are some unavoidable exceptions within include files to |
|
41 define necessary library symbols; they are noted "INFRINGES ON |
|
42 USER NAME SPACE" below. */ |
|
43 |
|
44 /* Identify Bison output. */ |
|
45 #define YYBISON 1 |
|
46 |
|
47 /* Bison version. */ |
|
48 #define YYBISON_VERSION "2.4.1" |
|
49 |
|
50 /* Skeleton name. */ |
|
51 #define YYSKELETON_NAME "yacc.c" |
|
52 |
|
53 /* Pure parsers. */ |
|
54 #define YYPURE 0 |
|
55 |
|
56 /* Push parsers. */ |
|
57 #define YYPUSH 0 |
|
58 |
|
59 /* Pull parsers. */ |
|
60 #define YYPULL 1 |
|
61 |
|
62 /* Using locations. */ |
|
63 #define YYLSP_NEEDED 0 |
|
64 |
|
65 |
|
66 |
|
67 /* Copy the first part of user declarations. */ |
|
68 |
|
69 /* Line 189 of yacc.c */ |
|
70 #line 1 "rcomp.yacc" |
|
71 |
|
72 #include <assert.h> |
|
73 #include <ctype.h> |
|
74 #include <string.h> |
|
75 |
|
76 #if defined(__MSVCDOTNET__) || defined(__TOOLS2__) |
|
77 #include <fstream> |
|
78 #include <iostream> |
|
79 using namespace std; |
|
80 using std::cout; |
|
81 using std::endl; |
|
82 #else //!__MSVCDOTNET__ |
|
83 #include <fstream.h> |
|
84 #endif //__MSVCDOTNET__ |
|
85 |
|
86 #ifdef __VC32__ |
|
87 #pragma warning( disable : 4065 ) // C4065: switch statement contains 'default' but no 'case' labels |
|
88 #pragma warning( disable : 4102 ) // C4102: 'yyerrlab1' : unreferenced label |
|
89 #pragma warning( disable : 4127 ) // C4127: conditional expression is constant |
|
90 #pragma warning( disable : 4244 ) // C4244: '=' : conversion from 'int' to 'short', possible loss of data |
|
91 #endif //__VC32__ |
|
92 |
|
93 #include "resource.h" |
|
94 #include "parser.h" |
|
95 |
|
96 int yylex(); |
|
97 void yyerror(const char* string, ...); |
|
98 int yywrap(); |
|
99 #define YYDEBUG 1 |
|
100 extern int yylineno; |
|
101 |
|
102 #include "rcomp.hpp" |
|
103 #include "datatype.h" |
|
104 #include "mem.h" |
|
105 #include "rcbinstr.h" |
|
106 #include "rcscan.h" |
|
107 #include "errorhan.h" |
|
108 #include "fileacc.h" |
|
109 #include "version.h" |
|
110 #include "ctable.h" |
|
111 #include "localise.h" |
|
112 #include "main.h" |
|
113 |
|
114 #if defined(__VC32__) && !defined(_DEBUG) |
|
115 #pragma warning( disable : 4702 ) // unreachable code |
|
116 #pragma warning( disable : 4102 ) // 'yyerrlabel' : unreferenced label |
|
117 #pragma warning( disable : 4244 ) // '=' : conversion from 'int' to 'short', possible loss of data |
|
118 #endif |
|
119 |
|
120 |
|
121 |
|
122 String::CharacterSet CharacterSetID( const String & character_set_name ); |
|
123 void asUTF8(char* aUtf8, int aUnicode); |
|
124 void SetIdFromName( const String & NameStatementValue); |
|
125 void CheckStructUsage(); |
|
126 |
|
127 unsigned short & d = MemCheckControl::iLogMemory; |
|
128 |
|
129 StructHeader * pSH; |
|
130 |
|
131 StructHeaderArray * pSHA; // Used in resource struct handling functions. |
|
132 ResourceHeader * pResourceHeader; |
|
133 ResourceItemArray * pCurrentRIA; |
|
134 StringArray * pUsedLabelsArray = new StringArray(); |
|
135 int verbose; |
|
136 String::CharacterSet SourceCharacterSet = String::CP1252; |
|
137 String::CharacterSet TargetCharacterSet = String::CP1252; |
|
138 unsigned short logmemorysetting; |
|
139 int * pCurrentLineNumber; |
|
140 FileLineManager * pFileLineHandler; |
|
141 NameIdMap * pResourceNameIds; |
|
142 long CurrentEnumValue; |
|
143 String CurrentEnumName; |
|
144 char TempStr[300]; |
|
145 rcscan * pScan; |
|
146 |
|
147 int CurrentIdStep=1; |
|
148 long CurrentId=0; |
|
149 int FormatIdAsHex=0; // defaults to decimal, changes in SetIdFromName |
|
150 |
|
151 unsigned long Uid2=0; |
|
152 unsigned long Uid3=0; |
|
153 |
|
154 |
|
155 |
|
156 const String Divider("*******************************************"); |
|
157 |
|
158 #define REGISTER_LINE ErrorHandler::Register(pFileLineHandler->GetCurrentFile(), pFileLineHandler->GetErrorLine(* pCurrentLineNumber)) |
|
159 |
|
160 // Convert a string containing a character literal in aQuoted |
|
161 // into a value suitable for LCHAR_LITERAL |
|
162 void SetCharacterLiteral(char* aOut, const String& aQuoted) |
|
163 { |
|
164 UTF16 first; |
|
165 int length=1; |
|
166 if (aQuoted.Length() < 1 ) |
|
167 { |
|
168 REGISTER_LINE; |
|
169 ErrorHandler::OutputErrorLine("Warning: Empty Character literal"); |
|
170 } |
|
171 if (aQuoted.Length() > 1 ) |
|
172 { |
|
173 REGISTER_LINE; |
|
174 ErrorHandler::OutputErrorLine("Error: String Literal length greater than 1"); |
|
175 exit(1); |
|
176 } |
|
177 if (aQuoted.Export(&first, length, SourceCharacterSet)==0) |
|
178 { |
|
179 REGISTER_LINE; |
|
180 ErrorHandler::OutputErrorLine("Warning: Ignoring trailing characters in character literal"); |
|
181 } |
|
182 sprintf(aOut, "%d", first); |
|
183 } |
|
184 |
|
185 |
|
186 |
|
187 /* Line 189 of yacc.c */ |
|
188 #line 205 "rcomp.tab.cacc" |
|
189 |
|
190 /* Enabling traces. */ |
|
191 #ifndef YYDEBUG |
|
192 # define YYDEBUG 0 |
|
193 #endif |
|
194 |
|
195 /* Enabling verbose error messages. */ |
|
196 #ifdef YYERROR_VERBOSE |
|
197 # undef YYERROR_VERBOSE |
|
198 # define YYERROR_VERBOSE 1 |
|
199 #else |
|
200 # define YYERROR_VERBOSE 0 |
|
201 #endif |
|
202 |
|
203 /* Enabling the token table. */ |
|
204 #ifndef YYTOKEN_TABLE |
|
205 # define YYTOKEN_TABLE 0 |
|
206 #endif |
|
207 |
|
208 |
|
209 /* Tokens. */ |
|
210 #ifndef YYTOKENTYPE |
|
211 # define YYTOKENTYPE |
|
212 /* Put the tokens into the symbol table, so that GDB and other debuggers |
|
213 know about them. */ |
|
214 enum yytokentype { |
|
215 L_STRUCT = 258, |
|
216 L_RESOURCE = 259, |
|
217 L_NAME = 260, |
|
218 L_OFFSET = 261, |
|
219 L_SYSTEM = 262, |
|
220 L_GLOBAL = 263, |
|
221 L_LOCAL = 264, |
|
222 L_CHARACTER_SET = 265, |
|
223 L_BUF = 266, |
|
224 L_WORD = 267, |
|
225 L_BYTE = 268, |
|
226 L_LONG = 269, |
|
227 L_DOUBLE = 270, |
|
228 L_TEXT = 271, |
|
229 L_LTEXT = 272, |
|
230 L_LINK = 273, |
|
231 L_LLINK = 274, |
|
232 L_SRLINK = 275, |
|
233 L_BUF8 = 276, |
|
234 L_TEXT8 = 277, |
|
235 L_LTEXT8 = 278, |
|
236 L_BUF16 = 279, |
|
237 L_TEXT16 = 280, |
|
238 L_LTEXT16 = 281, |
|
239 L_UID_TWO = 282, |
|
240 L_UID_THREE = 283, |
|
241 L_RLS_STRING = 284, |
|
242 L_RLS_STRING8 = 285, |
|
243 L_RLS_DOUBLE = 286, |
|
244 L_RLS_BYTE = 287, |
|
245 L_RLS_WORD = 288, |
|
246 L_RLS_LONG = 289, |
|
247 L_MULTI = 290, |
|
248 L_TAG_START = 291, |
|
249 L_TAG_END = 292, |
|
250 L_TAG_COMMAND = 293, |
|
251 L_TAG_WORD = 294, |
|
252 L_TAG_NEW_LINE = 295, |
|
253 L_LABEL = 296, |
|
254 L_NUM_NATURAL = 297, |
|
255 L_NUM_FLOAT = 298, |
|
256 L_NATURAL_EXPR = 299, |
|
257 L_ENUM = 300, |
|
258 L_LEN = 301, |
|
259 L_CHAR_LITERAL = 302, |
|
260 L_STRING_LITERAL = 303, |
|
261 UMINUS = 304 |
|
262 }; |
|
263 #endif |
|
264 |
|
265 |
|
266 |
|
267 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
|
268 typedef union YYSTYPE |
|
269 { |
|
270 |
|
271 /* Line 214 of yacc.c */ |
|
272 #line 132 "rcomp.yacc" |
|
273 |
|
274 char Value[1024*8]; |
|
275 TValueMaybeRls ValueMaybeRls; |
|
276 unsigned long Id; |
|
277 StructItem * pStructItem; |
|
278 SimpleStructItem * pSimpleStructItem; |
|
279 ArrayStructItem * pArrayStructItem; |
|
280 StructArrayStructItem * pStructArrayStructItem; |
|
281 StringArray * pStringArray; |
|
282 long NumInitialiser; |
|
283 TRlsQualifiers RlsQualifiers; |
|
284 TRlsType RlsType; |
|
285 |
|
286 |
|
287 |
|
288 /* Line 214 of yacc.c */ |
|
289 #line 306 "rcomp.tab.cacc" |
|
290 } YYSTYPE; |
|
291 # define YYSTYPE_IS_TRIVIAL 1 |
|
292 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
|
293 # define YYSTYPE_IS_DECLARED 1 |
|
294 #endif |
|
295 |
|
296 |
|
297 /* Copy the second part of user declarations. */ |
|
298 |
|
299 |
|
300 /* Line 264 of yacc.c */ |
|
301 #line 318 "rcomp.tab.cacc" |
|
302 |
|
303 #ifdef short |
|
304 # undef short |
|
305 #endif |
|
306 |
|
307 #ifdef YYTYPE_UINT8 |
|
308 typedef YYTYPE_UINT8 yytype_uint8; |
|
309 #else |
|
310 typedef unsigned char yytype_uint8; |
|
311 #endif |
|
312 |
|
313 #ifdef YYTYPE_INT8 |
|
314 typedef YYTYPE_INT8 yytype_int8; |
|
315 #elif (defined __STDC__ || defined __C99__FUNC__ \ |
|
316 || defined __cplusplus || defined _MSC_VER) |
|
317 typedef signed char yytype_int8; |
|
318 #else |
|
319 typedef short int yytype_int8; |
|
320 #endif |
|
321 |
|
322 #ifdef YYTYPE_UINT16 |
|
323 typedef YYTYPE_UINT16 yytype_uint16; |
|
324 #else |
|
325 typedef unsigned short int yytype_uint16; |
|
326 #endif |
|
327 |
|
328 #ifdef YYTYPE_INT16 |
|
329 typedef YYTYPE_INT16 yytype_int16; |
|
330 #else |
|
331 typedef short int yytype_int16; |
|
332 #endif |
|
333 |
|
334 #ifndef YYSIZE_T |
|
335 # ifdef __SIZE_TYPE__ |
|
336 # define YYSIZE_T __SIZE_TYPE__ |
|
337 # elif defined size_t |
|
338 # define YYSIZE_T size_t |
|
339 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ |
|
340 || defined __cplusplus || defined _MSC_VER) |
|
341 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
|
342 # define YYSIZE_T size_t |
|
343 # else |
|
344 # define YYSIZE_T unsigned int |
|
345 # endif |
|
346 #endif |
|
347 |
|
348 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
|
349 |
|
350 #ifndef YY_ |
|
351 # if YYENABLE_NLS |
|
352 # if ENABLE_NLS |
|
353 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
|
354 # define YY_(msgid) dgettext ("bison-runtime", msgid) |
|
355 # endif |
|
356 # endif |
|
357 # ifndef YY_ |
|
358 # define YY_(msgid) msgid |
|
359 # endif |
|
360 #endif |
|
361 |
|
362 /* Suppress unused-variable warnings by "using" E. */ |
|
363 #if ! defined lint || defined __GNUC__ |
|
364 # define YYUSE(e) ((void) (e)) |
|
365 #else |
|
366 # define YYUSE(e) /* empty */ |
|
367 #endif |
|
368 |
|
369 /* Identity function, used to suppress warnings about constant conditions. */ |
|
370 #ifndef lint |
|
371 # define YYID(n) (n) |
|
372 #else |
|
373 #if (defined __STDC__ || defined __C99__FUNC__ \ |
|
374 || defined __cplusplus || defined _MSC_VER) |
|
375 static int |
|
376 YYID (int yyi) |
|
377 #else |
|
378 static int |
|
379 YYID (yyi) |
|
380 int yyi; |
|
381 #endif |
|
382 { |
|
383 return yyi; |
|
384 } |
|
385 #endif |
|
386 |
|
387 #if ! defined yyoverflow || YYERROR_VERBOSE |
|
388 |
|
389 /* The parser invokes alloca or malloc; define the necessary symbols. */ |
|
390 |
|
391 # ifdef YYSTACK_USE_ALLOCA |
|
392 # if YYSTACK_USE_ALLOCA |
|
393 # ifdef __GNUC__ |
|
394 # define YYSTACK_ALLOC __builtin_alloca |
|
395 # elif defined __BUILTIN_VA_ARG_INCR |
|
396 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
|
397 # elif defined _AIX |
|
398 # define YYSTACK_ALLOC __alloca |
|
399 # elif defined _MSC_VER |
|
400 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
|
401 # define alloca _alloca |
|
402 # else |
|
403 # define YYSTACK_ALLOC alloca |
|
404 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
|
405 || defined __cplusplus || defined _MSC_VER) |
|
406 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
|
407 # ifndef _STDLIB_H |
|
408 # define _STDLIB_H 1 |
|
409 # endif |
|
410 # endif |
|
411 # endif |
|
412 # endif |
|
413 # endif |
|
414 |
|
415 # ifdef YYSTACK_ALLOC |
|
416 /* Pacify GCC's `empty if-body' warning. */ |
|
417 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) |
|
418 # ifndef YYSTACK_ALLOC_MAXIMUM |
|
419 /* The OS might guarantee only one guard page at the bottom of the stack, |
|
420 and a page size can be as small as 4096 bytes. So we cannot safely |
|
421 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
|
422 to allow for a few compiler-allocated temporary stack slots. */ |
|
423 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
|
424 # endif |
|
425 # else |
|
426 # define YYSTACK_ALLOC YYMALLOC |
|
427 # define YYSTACK_FREE YYFREE |
|
428 # ifndef YYSTACK_ALLOC_MAXIMUM |
|
429 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
|
430 # endif |
|
431 # if (defined __cplusplus && ! defined _STDLIB_H \ |
|
432 && ! ((defined YYMALLOC || defined malloc) \ |
|
433 && (defined YYFREE || defined free))) |
|
434 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
|
435 # ifndef _STDLIB_H |
|
436 # define _STDLIB_H 1 |
|
437 # endif |
|
438 # endif |
|
439 # ifndef YYMALLOC |
|
440 # define YYMALLOC malloc |
|
441 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
|
442 || defined __cplusplus || defined _MSC_VER) |
|
443 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
|
444 # endif |
|
445 # endif |
|
446 # ifndef YYFREE |
|
447 # define YYFREE free |
|
448 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
|
449 || defined __cplusplus || defined _MSC_VER) |
|
450 void free (void *); /* INFRINGES ON USER NAME SPACE */ |
|
451 # endif |
|
452 # endif |
|
453 # endif |
|
454 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
|
455 |
|
456 |
|
457 #if (! defined yyoverflow \ |
|
458 && (! defined __cplusplus \ |
|
459 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
|
460 |
|
461 /* A type that is properly aligned for any stack member. */ |
|
462 union yyalloc |
|
463 { |
|
464 yytype_int16 yyss_alloc; |
|
465 YYSTYPE yyvs_alloc; |
|
466 }; |
|
467 |
|
468 /* The size of the maximum gap between one aligned stack and the next. */ |
|
469 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
|
470 |
|
471 /* The size of an array large to enough to hold all stacks, each with |
|
472 N elements. */ |
|
473 # define YYSTACK_BYTES(N) \ |
|
474 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ |
|
475 + YYSTACK_GAP_MAXIMUM) |
|
476 |
|
477 /* Copy COUNT objects from FROM to TO. The source and destination do |
|
478 not overlap. */ |
|
479 # ifndef YYCOPY |
|
480 # if defined __GNUC__ && 1 < __GNUC__ |
|
481 # define YYCOPY(To, From, Count) \ |
|
482 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) |
|
483 # else |
|
484 # define YYCOPY(To, From, Count) \ |
|
485 do \ |
|
486 { \ |
|
487 YYSIZE_T yyi; \ |
|
488 for (yyi = 0; yyi < (Count); yyi++) \ |
|
489 (To)[yyi] = (From)[yyi]; \ |
|
490 } \ |
|
491 while (YYID (0)) |
|
492 # endif |
|
493 # endif |
|
494 |
|
495 /* Relocate STACK from its old location to the new one. The |
|
496 local variables YYSIZE and YYSTACKSIZE give the old and new number of |
|
497 elements in the stack, and YYPTR gives the new location of the |
|
498 stack. Advance YYPTR to a properly aligned location for the next |
|
499 stack. */ |
|
500 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
|
501 do \ |
|
502 { \ |
|
503 YYSIZE_T yynewbytes; \ |
|
504 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
|
505 Stack = &yyptr->Stack_alloc; \ |
|
506 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
|
507 yyptr += yynewbytes / sizeof (*yyptr); \ |
|
508 } \ |
|
509 while (YYID (0)) |
|
510 |
|
511 #endif |
|
512 |
|
513 /* YYFINAL -- State number of the termination state. */ |
|
514 #define YYFINAL 3 |
|
515 /* YYLAST -- Last index in YYTABLE. */ |
|
516 #define YYLAST 303 |
|
517 |
|
518 /* YYNTOKENS -- Number of terminals. */ |
|
519 #define YYNTOKENS 66 |
|
520 /* YYNNTS -- Number of nonterminals. */ |
|
521 #define YYNNTS 61 |
|
522 /* YYNRULES -- Number of rules. */ |
|
523 #define YYNRULES 152 |
|
524 /* YYNRULES -- Number of states. */ |
|
525 #define YYNSTATES 255 |
|
526 |
|
527 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
|
528 #define YYUNDEFTOK 2 |
|
529 #define YYMAXUTOK 304 |
|
530 |
|
531 #define YYTRANSLATE(YYX) \ |
|
532 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
|
533 |
|
534 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ |
|
535 static const yytype_uint8 yytranslate[] = |
|
536 { |
|
537 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
541 58, 59, 51, 49, 65, 50, 2, 52, 2, 2, |
|
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 55, |
|
543 61, 60, 62, 2, 2, 2, 2, 2, 2, 2, |
|
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
546 2, 64, 2, 63, 2, 2, 2, 2, 2, 2, |
|
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
549 2, 2, 2, 57, 53, 56, 2, 2, 2, 2, |
|
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
|
562 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
|
563 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
|
564 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
|
565 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
|
566 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, |
|
567 45, 46, 47, 48, 54 |
|
568 }; |
|
569 |
|
570 #if YYDEBUG |
|
571 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
|
572 YYRHS. */ |
|
573 static const yytype_uint16 yyprhs[] = |
|
574 { |
|
575 0, 0, 3, 5, 8, 11, 12, 15, 18, 21, |
|
576 24, 27, 30, 32, 35, 38, 40, 41, 45, 50, |
|
577 56, 62, 66, 71, 72, 74, 76, 78, 80, 82, |
|
578 87, 91, 98, 101, 107, 109, 111, 113, 115, 117, |
|
579 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, |
|
580 139, 141, 147, 150, 154, 159, 165, 169, 171, 173, |
|
581 176, 178, 182, 187, 193, 198, 201, 204, 206, 210, |
|
582 213, 217, 222, 226, 227, 231, 233, 235, 237, 242, |
|
583 248, 252, 257, 261, 265, 271, 273, 277, 281, 284, |
|
584 286, 290, 294, 297, 299, 301, 303, 305, 307, 311, |
|
585 313, 315, 319, 323, 327, 331, 335, 338, 342, 344, |
|
586 347, 349, 351, 353, 357, 360, 363, 366, 369, 372, |
|
587 375, 377, 381, 386, 390, 393, 395, 399, 402, 407, |
|
588 412, 417, 422, 427, 432, 434, 439, 441, 443, 444, |
|
589 446, 448, 450, 452, 454, 456, 458, 459, 463, 466, |
|
590 467, 469, 471 |
|
591 }; |
|
592 |
|
593 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
|
594 static const yytype_int8 yyrhs[] = |
|
595 { |
|
596 67, 0, -1, 68, -1, 68, 69, -1, 68, 124, |
|
597 -1, -1, 71, 70, -1, 85, 70, -1, 109, 70, |
|
598 -1, 107, 70, -1, 110, 70, -1, 111, 70, -1, |
|
599 112, -1, 108, 70, -1, 116, 70, -1, 55, -1, |
|
600 -1, 72, 73, 56, -1, 3, 41, 123, 57, -1, |
|
601 3, 41, 81, 123, 57, -1, 3, 41, 46, 123, |
|
602 57, -1, 73, 74, 55, -1, 73, 124, 74, 55, |
|
603 -1, -1, 75, -1, 78, -1, 82, -1, 83, -1, |
|
604 76, -1, 76, 58, 102, 59, -1, 76, 60, 100, |
|
605 -1, 76, 58, 102, 59, 60, 104, -1, 77, 41, |
|
606 -1, 77, 61, 103, 62, 41, -1, 13, -1, 12, |
|
607 -1, 14, -1, 15, -1, 16, -1, 17, -1, 11, |
|
608 -1, 22, -1, 25, -1, 23, -1, 26, -1, 21, |
|
609 -1, 24, -1, 18, -1, 19, -1, 20, -1, 79, |
|
610 -1, 79, 60, 57, 101, 56, -1, 80, 63, -1, |
|
611 80, 102, 63, -1, 46, 81, 80, 63, -1, 46, |
|
612 81, 80, 102, 63, -1, 77, 41, 64, -1, 13, |
|
613 -1, 12, -1, 3, 41, -1, 84, -1, 46, 81, |
|
614 84, -1, 3, 41, 64, 63, -1, 3, 41, 64, |
|
615 102, 63, -1, 86, 57, 88, 56, -1, 8, 87, |
|
616 -1, 9, 87, -1, 87, -1, 4, 41, 41, -1, |
|
617 4, 41, -1, 88, 89, 55, -1, 88, 124, 89, |
|
618 55, -1, 88, 1, 55, -1, -1, 41, 60, 100, |
|
619 -1, 90, -1, 91, -1, 93, -1, 41, 60, 57, |
|
620 56, -1, 41, 60, 57, 101, 56, -1, 92, 88, |
|
621 56, -1, 41, 60, 41, 57, -1, 94, 95, 56, |
|
622 -1, 94, 95, 1, -1, 41, 60, 57, 41, 57, |
|
623 -1, 96, -1, 96, 65, 97, -1, 96, 65, 1, |
|
624 -1, 88, 56, -1, 98, -1, 97, 65, 98, -1, |
|
625 99, 88, 56, -1, 41, 57, -1, 43, -1, 47, |
|
626 -1, 104, -1, 102, -1, 100, -1, 101, 65, 100, |
|
627 -1, 103, -1, 42, -1, 103, 49, 103, -1, 103, |
|
628 50, 103, -1, 103, 51, 103, -1, 103, 52, 103, |
|
629 -1, 103, 53, 103, -1, 50, 103, -1, 58, 103, |
|
630 59, -1, 105, -1, 105, 104, -1, 48, -1, 106, |
|
631 -1, 41, -1, 61, 103, 62, -1, 5, 41, -1, |
|
632 5, 48, -1, 27, 103, -1, 28, 103, -1, 10, |
|
633 41, -1, 6, 102, -1, 7, -1, 113, 115, 56, |
|
634 -1, 113, 115, 56, 55, -1, 45, 41, 57, -1, |
|
635 45, 57, -1, 41, -1, 41, 60, 100, -1, 123, |
|
636 114, -1, 115, 65, 123, 114, -1, 120, 118, 117, |
|
637 104, -1, 120, 118, 117, 47, -1, 122, 119, 117, |
|
638 43, -1, 121, 119, 117, 42, -1, 121, 119, 117, |
|
639 47, -1, 41, -1, 61, 42, 62, 119, -1, 119, |
|
640 -1, 35, -1, -1, 29, -1, 30, -1, 32, -1, |
|
641 33, -1, 34, -1, 31, -1, 124, -1, -1, 36, |
|
642 125, 37, -1, 125, 126, -1, -1, 40, -1, 38, |
|
643 -1, 39, -1 |
|
644 }; |
|
645 |
|
646 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
|
647 static const yytype_uint16 yyrline[] = |
|
648 { |
|
649 0, 182, 182, 189, 190, 191, 195, 196, 197, 198, |
|
650 199, 200, 201, 202, 203, 207, 214, 221, 225, 231, |
|
651 237, 245, 249, 253, 256, 257, 258, 259, 262, 263, |
|
652 268, 273, 289, 297, 312, 313, 314, 315, 319, 325, |
|
653 329, 336, 340, 344, 345, 346, 347, 348, 349, 350, |
|
654 353, 354, 372, 375, 380, 388, 399, 407, 408, 411, |
|
655 416, 417, 423, 426, 435, 451, 452, 458, 461, 474, |
|
656 483, 484, 485, 486, 489, 493, 494, 495, 498, 503, |
|
657 531, 537, 548, 552, 556, 569, 570, 571, 574, 579, |
|
658 580, 583, 589, 603, 604, 609, 610, 613, 623, 632, |
|
659 635, 639, 640, 641, 642, 643, 644, 652, 655, 656, |
|
660 667, 668, 669, 748, 794, 799, 811, 822, 844, 868, |
|
661 879, 888, 889, 892, 899, 909, 914, 925, 926, 933, |
|
662 950, 966, 973, 980, 991, 1012, 1018, 1023, 1029, 1036, |
|
663 1038, 1043, 1045, 1047, 1052, 1060, 1061, 1065, 1069, 1071, |
|
664 1075, 1076, 1077 |
|
665 }; |
|
666 #endif |
|
667 |
|
668 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE |
|
669 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
|
670 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
|
671 static const char *const yytname[] = |
|
672 { |
|
673 "$end", "error", "$undefined", "L_STRUCT", "L_RESOURCE", "L_NAME", |
|
674 "L_OFFSET", "L_SYSTEM", "L_GLOBAL", "L_LOCAL", "L_CHARACTER_SET", |
|
675 "L_BUF", "L_WORD", "L_BYTE", "L_LONG", "L_DOUBLE", "L_TEXT", "L_LTEXT", |
|
676 "L_LINK", "L_LLINK", "L_SRLINK", "L_BUF8", "L_TEXT8", "L_LTEXT8", |
|
677 "L_BUF16", "L_TEXT16", "L_LTEXT16", "L_UID_TWO", "L_UID_THREE", |
|
678 "L_RLS_STRING", "L_RLS_STRING8", "L_RLS_DOUBLE", "L_RLS_BYTE", |
|
679 "L_RLS_WORD", "L_RLS_LONG", "L_MULTI", "L_TAG_START", "L_TAG_END", |
|
680 "L_TAG_COMMAND", "L_TAG_WORD", "L_TAG_NEW_LINE", "L_LABEL", |
|
681 "L_NUM_NATURAL", "L_NUM_FLOAT", "L_NATURAL_EXPR", "L_ENUM", "L_LEN", |
|
682 "L_CHAR_LITERAL", "L_STRING_LITERAL", "'+'", "'-'", "'*'", "'/'", "'|'", |
|
683 "UMINUS", "';'", "'}'", "'{'", "'('", "')'", "'='", "'<'", "'>'", "']'", |
|
684 "'['", "','", "$accept", "source", "statement_list", "statement", |
|
685 "maybe_semicolon", "struct_statement", "struct_statement_start", |
|
686 "struct_item_list", "struct_item", "simple_struct_item", |
|
687 "simple_struct_item_start", "data_type", "array_struct_item", |
|
688 "array_struct_item_base", "array_struct_item_start", "len_declaration", |
|
689 "struct_type_struct_item", "struct_array_struct_item", |
|
690 "struct_array_struct_item_base", "resource_statement", |
|
691 "resource_statement_start", "resource_statement_start_names", |
|
692 "resource_item_list", "resource_item", "resource_simple_array_item", |
|
693 "struct_resource_item", "struct_resource_item_start", |
|
694 "struct_array_resource_item", "struct_array_resource_item_start", |
|
695 "struct_array_resource_item_list_top", |
|
696 "struct_array_resource_item_list_top_start", |
|
697 "struct_array_resource_item_list", |
|
698 "struct_array_resource_item_list_item", |
|
699 "struct_array_resource_item_list_item_start", "simple_initialiser", |
|
700 "simple_initialiser_list", "natural_expression", |
|
701 "natural_expression_numeric", "string_expression", |
|
702 "string_expression_item", "character_code_expression", "name_statement", |
|
703 "uidX_statement", "character_set_statement", "offset_statement", |
|
704 "system_statement", "enum_statement", "enum_statement_start", |
|
705 "enum_list_entry", "enum_list", "rls_item_statement", "rls_label", |
|
706 "rls_qualifiers", "rls_cardinality", "rls_string_item", "rls_num_item", |
|
707 "rls_float_item", "maybe_comment_tag", "comment_tag", "tag_line", |
|
708 "tag_word", 0 |
|
709 }; |
|
710 #endif |
|
711 |
|
712 # ifdef YYPRINT |
|
713 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to |
|
714 token YYLEX-NUM. */ |
|
715 static const yytype_uint16 yytoknum[] = |
|
716 { |
|
717 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
|
718 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
|
719 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, |
|
720 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, |
|
721 295, 296, 297, 298, 299, 300, 301, 302, 303, 43, |
|
722 45, 42, 47, 124, 304, 59, 125, 123, 40, 41, |
|
723 61, 60, 62, 93, 91, 44 |
|
724 }; |
|
725 # endif |
|
726 |
|
727 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
|
728 static const yytype_uint8 yyr1[] = |
|
729 { |
|
730 0, 66, 67, 68, 68, 68, 69, 69, 69, 69, |
|
731 69, 69, 69, 69, 69, 70, 70, 71, 72, 72, |
|
732 72, 73, 73, 73, 74, 74, 74, 74, 75, 75, |
|
733 75, 75, 76, 76, 77, 77, 77, 77, 77, 77, |
|
734 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, |
|
735 78, 78, 79, 79, 79, 79, 80, 81, 81, 82, |
|
736 83, 83, 84, 84, 85, 86, 86, 86, 87, 87, |
|
737 88, 88, 88, 88, 89, 89, 89, 89, 90, 90, |
|
738 91, 92, 93, 93, 94, 95, 95, 95, 96, 97, |
|
739 97, 98, 99, 100, 100, 100, 100, 101, 101, 102, |
|
740 103, 103, 103, 103, 103, 103, 103, 103, 104, 104, |
|
741 105, 105, 105, 106, 107, 107, 108, 108, 109, 110, |
|
742 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, |
|
743 116, 116, 116, 116, 117, 118, 118, 119, 119, 120, |
|
744 120, 121, 121, 121, 122, 123, 123, 124, 125, 125, |
|
745 126, 126, 126 |
|
746 }; |
|
747 |
|
748 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
|
749 static const yytype_uint8 yyr2[] = |
|
750 { |
|
751 0, 2, 1, 2, 2, 0, 2, 2, 2, 2, |
|
752 2, 2, 1, 2, 2, 1, 0, 3, 4, 5, |
|
753 5, 3, 4, 0, 1, 1, 1, 1, 1, 4, |
|
754 3, 6, 2, 5, 1, 1, 1, 1, 1, 1, |
|
755 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
|
756 1, 5, 2, 3, 4, 5, 3, 1, 1, 2, |
|
757 1, 3, 4, 5, 4, 2, 2, 1, 3, 2, |
|
758 3, 4, 3, 0, 3, 1, 1, 1, 4, 5, |
|
759 3, 4, 3, 3, 5, 1, 3, 3, 2, 1, |
|
760 3, 3, 2, 1, 1, 1, 1, 1, 3, 1, |
|
761 1, 3, 3, 3, 3, 3, 2, 3, 1, 2, |
|
762 1, 1, 1, 3, 2, 2, 2, 2, 2, 2, |
|
763 1, 3, 4, 3, 2, 1, 3, 2, 4, 4, |
|
764 4, 4, 4, 4, 1, 4, 1, 1, 0, 1, |
|
765 1, 1, 1, 1, 1, 1, 0, 3, 2, 0, |
|
766 1, 1, 1 |
|
767 }; |
|
768 |
|
769 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state |
|
770 STATE-NUM when YYTABLE doesn't specify something else to do. Zero |
|
771 means the default is an error. */ |
|
772 static const yytype_uint8 yydefact[] = |
|
773 { |
|
774 5, 0, 2, 1, 0, 0, 0, 0, 120, 0, |
|
775 0, 0, 0, 0, 139, 140, 144, 141, 142, 143, |
|
776 149, 0, 3, 16, 23, 16, 0, 67, 16, 16, |
|
777 16, 16, 16, 12, 146, 16, 138, 138, 138, 4, |
|
778 146, 69, 114, 115, 100, 0, 0, 119, 99, 65, |
|
779 66, 118, 116, 117, 0, 0, 124, 15, 6, 0, |
|
780 7, 73, 9, 13, 8, 10, 11, 0, 0, 145, |
|
781 14, 137, 0, 0, 136, 0, 0, 58, 57, 146, |
|
782 146, 0, 68, 106, 0, 0, 0, 0, 0, 0, |
|
783 147, 151, 152, 150, 148, 123, 0, 40, 35, 34, |
|
784 36, 37, 38, 39, 47, 48, 49, 45, 41, 43, |
|
785 46, 42, 44, 0, 17, 0, 24, 28, 0, 25, |
|
786 50, 0, 26, 27, 60, 0, 0, 121, 146, 125, |
|
787 127, 0, 134, 0, 0, 0, 0, 0, 18, 107, |
|
788 101, 102, 103, 104, 105, 59, 0, 21, 0, 0, |
|
789 32, 0, 0, 52, 0, 0, 0, 0, 64, 0, |
|
790 75, 76, 73, 77, 73, 0, 122, 0, 0, 138, |
|
791 112, 130, 110, 0, 129, 108, 111, 132, 133, 131, |
|
792 20, 19, 0, 0, 0, 0, 61, 0, 93, 94, |
|
793 30, 96, 95, 56, 0, 0, 53, 22, 72, 0, |
|
794 70, 0, 0, 0, 85, 0, 128, 126, 135, 0, |
|
795 109, 62, 0, 0, 0, 54, 0, 29, 0, 97, |
|
796 0, 112, 0, 74, 80, 88, 83, 82, 0, 71, |
|
797 113, 63, 55, 0, 33, 51, 0, 81, 112, 78, |
|
798 0, 87, 0, 86, 89, 73, 31, 98, 84, 79, |
|
799 92, 0, 0, 90, 91 |
|
800 }; |
|
801 |
|
802 /* YYDEFGOTO[NTERM-NUM]. */ |
|
803 static const yytype_int16 yydefgoto[] = |
|
804 { |
|
805 -1, 1, 2, 22, 58, 23, 24, 59, 115, 116, |
|
806 117, 118, 119, 120, 121, 80, 122, 123, 124, 25, |
|
807 26, 27, 126, 159, 160, 161, 162, 163, 164, 203, |
|
808 204, 243, 244, 245, 219, 220, 191, 48, 192, 175, |
|
809 176, 28, 29, 30, 31, 32, 33, 34, 130, 67, |
|
810 35, 133, 73, 74, 36, 37, 38, 68, 69, 54, |
|
811 94 |
|
812 }; |
|
813 |
|
814 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
|
815 STATE-NUM. */ |
|
816 #define YYPACT_NINF -156 |
|
817 static const yytype_int16 yypact[] = |
|
818 { |
|
819 -156, 20, 215, -156, -18, 15, 21, 41, -156, 13, |
|
820 13, 63, 41, 41, -156, -156, -156, -156, -156, -156, |
|
821 -156, 4, -156, 27, -156, 27, 59, -156, 27, 27, |
|
822 27, 27, 27, -156, -5, 27, -21, 37, 37, -156, |
|
823 17, 78, -156, -156, -156, 41, 41, -156, 145, -156, |
|
824 -156, -156, 145, 145, 74, 66, -156, -156, -156, 132, |
|
825 -156, -156, -156, -156, -156, -156, -156, 32, 96, -156, |
|
826 -156, -156, 97, 118, -156, 118, 118, -156, -156, -5, |
|
827 -5, 124, -156, -156, 81, 41, 41, 41, 41, 41, |
|
828 -156, -156, -156, -156, -156, -156, 141, -156, -156, -156, |
|
829 -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, |
|
830 -156, -156, -156, 80, -156, 129, -156, 62, -19, -156, |
|
831 125, -26, -156, -156, -156, 190, 10, 131, -5, 127, |
|
832 -156, 128, -156, 23, -9, 146, 134, 135, -156, -156, |
|
833 34, 34, 164, 164, -156, 162, 250, -156, 41, 236, |
|
834 165, 41, 171, -156, 172, 183, 184, 180, -156, 186, |
|
835 -156, -156, -156, -156, -156, 211, -156, 96, 236, 37, |
|
836 -156, -156, -156, 41, -156, -20, -156, -156, -156, -156, |
|
837 -156, -156, -24, 213, 214, 31, -156, 197, -156, -156, |
|
838 -156, -156, -156, -156, 76, 236, -156, -156, -156, 60, |
|
839 -156, 11, 18, 12, 192, 203, -156, -156, -156, 121, |
|
840 -156, -156, 196, 162, 165, -156, 217, 221, 241, -156, |
|
841 40, 228, 119, -156, -156, -156, -156, -156, 14, -156, |
|
842 -156, -156, -156, -20, -156, -156, 236, -156, 230, -156, |
|
843 44, -156, 231, 224, -156, -156, -156, -156, -156, -156, |
|
844 -156, 249, 24, -156, -156 |
|
845 }; |
|
846 |
|
847 /* YYPGOTO[NTERM-NUM]. */ |
|
848 static const yytype_int16 yypgoto[] = |
|
849 { |
|
850 -156, -156, -156, -156, 202, -156, -156, -156, 166, -156, |
|
851 -156, 147, -156, -156, 149, 179, -156, -156, 150, -156, |
|
852 -156, 155, -155, 133, -156, -156, -156, -156, -156, -156, |
|
853 -156, -156, 48, -156, -141, 79, -6, -10, -127, -156, |
|
854 -156, -156, -156, -156, -156, -156, -156, -156, 136, -156, |
|
855 -156, -32, -156, -33, -156, -156, -156, -30, -2, -156, |
|
856 -156 |
|
857 }; |
|
858 |
|
859 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
|
860 positive, shift that token. If negative, reduce the rule which |
|
861 number is the opposite. If zero, do what YYDEFACT says. |
|
862 If YYTABLE_NINF, syntax error. */ |
|
863 #define YYTABLE_NINF -1 |
|
864 static const yytype_uint8 yytable[] = |
|
865 { |
|
866 39, 47, 52, 53, 75, 76, 174, 201, 190, 202, |
|
867 81, 156, 156, 226, 71, 241, 44, 5, 44, 156, |
|
868 3, 170, 150, 40, 45, 156, 45, 207, 172, 77, |
|
869 78, 20, 46, 177, 46, 83, 84, 153, 178, 211, |
|
870 72, 173, 151, 134, 135, 55, 20, 20, 210, 136, |
|
871 137, 157, 157, 20, 20, 242, 41, 125, 223, 157, |
|
872 20, 56, 42, 79, 170, 157, 158, 224, 227, 43, |
|
873 171, 172, 71, 44, 225, 140, 141, 142, 143, 144, |
|
874 254, 45, 57, 44, 173, 87, 88, 89, 127, 46, |
|
875 252, 45, 77, 78, 215, 247, 235, 128, 167, 46, |
|
876 249, 221, 44, 188, 51, 236, 246, 189, 172, 236, |
|
877 45, 90, 91, 92, 93, 154, 61, 222, 46, 82, |
|
878 148, 173, 149, 95, 165, 85, 86, 87, 88, 89, |
|
879 85, 86, 87, 88, 89, 96, 208, 129, 218, 131, |
|
880 139, 194, 187, 97, 98, 99, 100, 101, 102, 103, |
|
881 104, 105, 106, 107, 108, 109, 110, 111, 112, 132, |
|
882 238, 44, 188, 209, 49, 50, 189, 172, 20, 45, |
|
883 85, 86, 87, 88, 89, 239, 212, 46, 113, 216, |
|
884 173, 138, 145, 230, 147, 152, 166, 168, 114, 179, |
|
885 169, 180, 181, 96, 85, 86, 87, 88, 89, 165, |
|
886 165, 97, 98, 99, 100, 101, 102, 103, 104, 105, |
|
887 106, 107, 108, 109, 110, 111, 112, 89, 4, 5, |
|
888 6, 7, 8, 9, 10, 11, 182, 60, 195, 193, |
|
889 62, 63, 64, 65, 66, 196, 113, 70, 197, 198, |
|
890 199, 200, 12, 13, 14, 15, 16, 17, 18, 19, |
|
891 165, 20, 157, 183, 213, 214, 217, 228, 229, 231, |
|
892 21, 97, 98, 99, 100, 101, 102, 103, 104, 105, |
|
893 106, 107, 108, 109, 110, 111, 112, 170, 44, 188, |
|
894 232, 233, 234, 189, 172, 237, 45, 248, 250, 251, |
|
895 242, 155, 146, 184, 46, 185, 186, 173, 205, 253, |
|
896 0, 240, 0, 206 |
|
897 }; |
|
898 |
|
899 static const yytype_int16 yycheck[] = |
|
900 { |
|
901 2, 7, 12, 13, 37, 38, 133, 162, 149, 164, |
|
902 40, 1, 1, 1, 35, 1, 42, 4, 42, 1, |
|
903 0, 41, 41, 41, 50, 1, 50, 168, 48, 12, |
|
904 13, 36, 58, 42, 58, 45, 46, 63, 47, 63, |
|
905 61, 61, 61, 75, 76, 41, 36, 36, 175, 79, |
|
906 80, 41, 41, 36, 36, 41, 41, 59, 199, 41, |
|
907 36, 57, 41, 46, 41, 41, 56, 56, 56, 48, |
|
908 47, 48, 35, 42, 56, 85, 86, 87, 88, 89, |
|
909 56, 50, 55, 42, 61, 51, 52, 53, 56, 58, |
|
910 245, 50, 12, 13, 63, 236, 56, 65, 128, 58, |
|
911 56, 41, 42, 43, 41, 65, 233, 47, 48, 65, |
|
912 50, 37, 38, 39, 40, 121, 57, 57, 58, 41, |
|
913 58, 61, 60, 57, 126, 49, 50, 51, 52, 53, |
|
914 49, 50, 51, 52, 53, 3, 169, 41, 62, 42, |
|
915 59, 151, 148, 11, 12, 13, 14, 15, 16, 17, |
|
916 18, 19, 20, 21, 22, 23, 24, 25, 26, 41, |
|
917 41, 42, 43, 173, 9, 10, 47, 48, 36, 50, |
|
918 49, 50, 51, 52, 53, 56, 182, 58, 46, 185, |
|
919 61, 57, 41, 62, 55, 60, 55, 60, 56, 43, |
|
920 62, 57, 57, 3, 49, 50, 51, 52, 53, 201, |
|
921 202, 11, 12, 13, 14, 15, 16, 17, 18, 19, |
|
922 20, 21, 22, 23, 24, 25, 26, 53, 3, 4, |
|
923 5, 6, 7, 8, 9, 10, 64, 25, 57, 64, |
|
924 28, 29, 30, 31, 32, 63, 46, 35, 55, 55, |
|
925 60, 55, 27, 28, 29, 30, 31, 32, 33, 34, |
|
926 252, 36, 41, 3, 41, 41, 59, 65, 55, 63, |
|
927 45, 11, 12, 13, 14, 15, 16, 17, 18, 19, |
|
928 20, 21, 22, 23, 24, 25, 26, 41, 42, 43, |
|
929 63, 60, 41, 47, 48, 57, 50, 57, 57, 65, |
|
930 41, 125, 113, 146, 58, 146, 146, 61, 165, 251, |
|
931 -1, 222, -1, 167 |
|
932 }; |
|
933 |
|
934 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
|
935 symbol of state STATE-NUM. */ |
|
936 static const yytype_uint8 yystos[] = |
|
937 { |
|
938 0, 67, 68, 0, 3, 4, 5, 6, 7, 8, |
|
939 9, 10, 27, 28, 29, 30, 31, 32, 33, 34, |
|
940 36, 45, 69, 71, 72, 85, 86, 87, 107, 108, |
|
941 109, 110, 111, 112, 113, 116, 120, 121, 122, 124, |
|
942 41, 41, 41, 48, 42, 50, 58, 102, 103, 87, |
|
943 87, 41, 103, 103, 125, 41, 57, 55, 70, 73, |
|
944 70, 57, 70, 70, 70, 70, 70, 115, 123, 124, |
|
945 70, 35, 61, 118, 119, 119, 119, 12, 13, 46, |
|
946 81, 123, 41, 103, 103, 49, 50, 51, 52, 53, |
|
947 37, 38, 39, 40, 126, 57, 3, 11, 12, 13, |
|
948 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, |
|
949 24, 25, 26, 46, 56, 74, 75, 76, 77, 78, |
|
950 79, 80, 82, 83, 84, 124, 88, 56, 65, 41, |
|
951 114, 42, 41, 117, 117, 117, 123, 123, 57, 59, |
|
952 103, 103, 103, 103, 103, 41, 81, 55, 58, 60, |
|
953 41, 61, 60, 63, 102, 74, 1, 41, 56, 89, |
|
954 90, 91, 92, 93, 94, 124, 55, 123, 60, 62, |
|
955 41, 47, 48, 61, 104, 105, 106, 42, 47, 43, |
|
956 57, 57, 64, 3, 77, 80, 84, 102, 43, 47, |
|
957 100, 102, 104, 64, 103, 57, 63, 55, 55, 60, |
|
958 55, 88, 88, 95, 96, 89, 114, 100, 119, 103, |
|
959 104, 63, 102, 41, 41, 63, 102, 59, 62, 100, |
|
960 101, 41, 57, 100, 56, 56, 1, 56, 65, 55, |
|
961 62, 63, 63, 60, 41, 56, 65, 57, 41, 56, |
|
962 101, 1, 41, 97, 98, 99, 104, 100, 57, 56, |
|
963 57, 65, 88, 98, 56 |
|
964 }; |
|
965 |
|
966 #define yyerrok (yyerrstatus = 0) |
|
967 #define yyclearin (yychar = YYEMPTY) |
|
968 #define YYEMPTY (-2) |
|
969 #define YYEOF 0 |
|
970 |
|
971 #define YYACCEPT goto yyacceptlab |
|
972 #define YYABORT goto yyabortlab |
|
973 #define YYERROR goto yyerrorlab |
|
974 |
|
975 |
|
976 /* Like YYERROR except do call yyerror. This remains here temporarily |
|
977 to ease the transition to the new meaning of YYERROR, for GCC. |
|
978 Once GCC version 2 has supplanted version 1, this can go. */ |
|
979 |
|
980 #define YYFAIL goto yyerrlab |
|
981 |
|
982 #define YYRECOVERING() (!!yyerrstatus) |
|
983 |
|
984 #define YYBACKUP(Token, Value) \ |
|
985 do \ |
|
986 if (yychar == YYEMPTY && yylen == 1) \ |
|
987 { \ |
|
988 yychar = (Token); \ |
|
989 yylval = (Value); \ |
|
990 yytoken = YYTRANSLATE (yychar); \ |
|
991 YYPOPSTACK (1); \ |
|
992 goto yybackup; \ |
|
993 } \ |
|
994 else \ |
|
995 { \ |
|
996 yyerror (YY_("syntax error: cannot back up")); \ |
|
997 YYERROR; \ |
|
998 } \ |
|
999 while (YYID (0)) |
|
1000 |
|
1001 |
|
1002 #define YYTERROR 1 |
|
1003 #define YYERRCODE 256 |
|
1004 |
|
1005 |
|
1006 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. |
|
1007 If N is 0, then set CURRENT to the empty location which ends |
|
1008 the previous symbol: RHS[0] (always defined). */ |
|
1009 |
|
1010 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
|
1011 #ifndef YYLLOC_DEFAULT |
|
1012 # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
|
1013 do \ |
|
1014 if (YYID (N)) \ |
|
1015 { \ |
|
1016 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ |
|
1017 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ |
|
1018 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ |
|
1019 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ |
|
1020 } \ |
|
1021 else \ |
|
1022 { \ |
|
1023 (Current).first_line = (Current).last_line = \ |
|
1024 YYRHSLOC (Rhs, 0).last_line; \ |
|
1025 (Current).first_column = (Current).last_column = \ |
|
1026 YYRHSLOC (Rhs, 0).last_column; \ |
|
1027 } \ |
|
1028 while (YYID (0)) |
|
1029 #endif |
|
1030 |
|
1031 |
|
1032 /* YY_LOCATION_PRINT -- Print the location on the stream. |
|
1033 This macro was not mandated originally: define only if we know |
|
1034 we won't break user code: when these are the locations we know. */ |
|
1035 |
|
1036 #ifndef YY_LOCATION_PRINT |
|
1037 # if YYLTYPE_IS_TRIVIAL |
|
1038 # define YY_LOCATION_PRINT(File, Loc) \ |
|
1039 fprintf (File, "%d.%d-%d.%d", \ |
|
1040 (Loc).first_line, (Loc).first_column, \ |
|
1041 (Loc).last_line, (Loc).last_column) |
|
1042 # else |
|
1043 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
|
1044 # endif |
|
1045 #endif |
|
1046 |
|
1047 |
|
1048 /* YYLEX -- calling `yylex' with the right arguments. */ |
|
1049 |
|
1050 #ifdef YYLEX_PARAM |
|
1051 # define YYLEX yylex (YYLEX_PARAM) |
|
1052 #else |
|
1053 # define YYLEX yylex () |
|
1054 #endif |
|
1055 |
|
1056 /* Enable debugging if requested. */ |
|
1057 #if YYDEBUG |
|
1058 |
|
1059 # ifndef YYFPRINTF |
|
1060 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
|
1061 # define YYFPRINTF fprintf |
|
1062 # endif |
|
1063 |
|
1064 # define YYDPRINTF(Args) \ |
|
1065 do { \ |
|
1066 if (yydebug) \ |
|
1067 YYFPRINTF Args; \ |
|
1068 } while (YYID (0)) |
|
1069 |
|
1070 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
|
1071 do { \ |
|
1072 if (yydebug) \ |
|
1073 { \ |
|
1074 YYFPRINTF (stderr, "%s ", Title); \ |
|
1075 yy_symbol_print (stderr, \ |
|
1076 Type, Value); \ |
|
1077 YYFPRINTF (stderr, "\n"); \ |
|
1078 } \ |
|
1079 } while (YYID (0)) |
|
1080 |
|
1081 |
|
1082 /*--------------------------------. |
|
1083 | Print this symbol on YYOUTPUT. | |
|
1084 `--------------------------------*/ |
|
1085 |
|
1086 /*ARGSUSED*/ |
|
1087 #if (defined __STDC__ || defined __C99__FUNC__ \ |
|
1088 || defined __cplusplus || defined _MSC_VER) |
|
1089 static void |
|
1090 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
|
1091 #else |
|
1092 static void |
|
1093 yy_symbol_value_print (yyoutput, yytype, yyvaluep) |
|
1094 FILE *yyoutput; |
|
1095 int yytype; |
|
1096 YYSTYPE const * const yyvaluep; |
|
1097 #endif |
|
1098 { |
|
1099 if (!yyvaluep) |
|
1100 return; |
|
1101 # ifdef YYPRINT |
|
1102 if (yytype < YYNTOKENS) |
|
1103 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
|
1104 # else |
|
1105 YYUSE (yyoutput); |
|
1106 # endif |
|
1107 switch (yytype) |
|
1108 { |
|
1109 default: |
|
1110 break; |
|
1111 } |
|
1112 } |
|
1113 |
|
1114 |
|
1115 /*--------------------------------. |
|
1116 | Print this symbol on YYOUTPUT. | |
|
1117 `--------------------------------*/ |
|
1118 |
|
1119 #if (defined __STDC__ || defined __C99__FUNC__ \ |
|
1120 || defined __cplusplus || defined _MSC_VER) |
|
1121 static void |
|
1122 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
|
1123 #else |
|
1124 static void |
|
1125 yy_symbol_print (yyoutput, yytype, yyvaluep) |
|
1126 FILE *yyoutput; |
|
1127 int yytype; |
|
1128 YYSTYPE const * const yyvaluep; |
|
1129 #endif |
|
1130 { |
|
1131 if (yytype < YYNTOKENS) |
|
1132 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
|
1133 else |
|
1134 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
|
1135 |
|
1136 yy_symbol_value_print (yyoutput, yytype, yyvaluep); |
|
1137 YYFPRINTF (yyoutput, ")"); |
|
1138 } |
|
1139 |
|
1140 /*------------------------------------------------------------------. |
|
1141 | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
|
1142 | TOP (included). | |
|
1143 `------------------------------------------------------------------*/ |
|
1144 |
|
1145 #if (defined __STDC__ || defined __C99__FUNC__ \ |
|
1146 || defined __cplusplus || defined _MSC_VER) |
|
1147 static void |
|
1148 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
|
1149 #else |
|
1150 static void |
|
1151 yy_stack_print (yybottom, yytop) |
|
1152 yytype_int16 *yybottom; |
|
1153 yytype_int16 *yytop; |
|
1154 #endif |
|
1155 { |
|
1156 YYFPRINTF (stderr, "Stack now"); |
|
1157 for (; yybottom <= yytop; yybottom++) |
|
1158 { |
|
1159 int yybot = *yybottom; |
|
1160 YYFPRINTF (stderr, " %d", yybot); |
|
1161 } |
|
1162 YYFPRINTF (stderr, "\n"); |
|
1163 } |
|
1164 |
|
1165 # define YY_STACK_PRINT(Bottom, Top) \ |
|
1166 do { \ |
|
1167 if (yydebug) \ |
|
1168 yy_stack_print ((Bottom), (Top)); \ |
|
1169 } while (YYID (0)) |
|
1170 |
|
1171 |
|
1172 /*------------------------------------------------. |
|
1173 | Report that the YYRULE is going to be reduced. | |
|
1174 `------------------------------------------------*/ |
|
1175 |
|
1176 #if (defined __STDC__ || defined __C99__FUNC__ \ |
|
1177 || defined __cplusplus || defined _MSC_VER) |
|
1178 static void |
|
1179 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) |
|
1180 #else |
|
1181 static void |
|
1182 yy_reduce_print (yyvsp, yyrule) |
|
1183 YYSTYPE *yyvsp; |
|
1184 int yyrule; |
|
1185 #endif |
|
1186 { |
|
1187 int yynrhs = yyr2[yyrule]; |
|
1188 int yyi; |
|
1189 unsigned long int yylno = yyrline[yyrule]; |
|
1190 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
|
1191 yyrule - 1, yylno); |
|
1192 /* The symbols being reduced. */ |
|
1193 for (yyi = 0; yyi < yynrhs; yyi++) |
|
1194 { |
|
1195 YYFPRINTF (stderr, " $%d = ", yyi + 1); |
|
1196 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], |
|
1197 &(yyvsp[(yyi + 1) - (yynrhs)]) |
|
1198 ); |
|
1199 YYFPRINTF (stderr, "\n"); |
|
1200 } |
|
1201 } |
|
1202 |
|
1203 # define YY_REDUCE_PRINT(Rule) \ |
|
1204 do { \ |
|
1205 if (yydebug) \ |
|
1206 yy_reduce_print (yyvsp, Rule); \ |
|
1207 } while (YYID (0)) |
|
1208 |
|
1209 /* Nonzero means print parse trace. It is left uninitialized so that |
|
1210 multiple parsers can coexist. */ |
|
1211 int yydebug; |
|
1212 #else /* !YYDEBUG */ |
|
1213 # define YYDPRINTF(Args) |
|
1214 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
|
1215 # define YY_STACK_PRINT(Bottom, Top) |
|
1216 # define YY_REDUCE_PRINT(Rule) |
|
1217 #endif /* !YYDEBUG */ |
|
1218 |
|
1219 |
|
1220 /* YYINITDEPTH -- initial size of the parser's stacks. */ |
|
1221 #ifndef YYINITDEPTH |
|
1222 # define YYINITDEPTH 200 |
|
1223 #endif |
|
1224 |
|
1225 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
|
1226 if the built-in stack extension method is used). |
|
1227 |
|
1228 Do not make this value too large; the results are undefined if |
|
1229 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
|
1230 evaluated with infinite-precision integer arithmetic. */ |
|
1231 |
|
1232 #ifndef YYMAXDEPTH |
|
1233 # define YYMAXDEPTH 10000 |
|
1234 #endif |
|
1235 |
|
1236 |
|
1237 |
|
1238 #if YYERROR_VERBOSE |
|
1239 |
|
1240 # ifndef yystrlen |
|
1241 # if defined __GLIBC__ && defined _STRING_H |
|
1242 # define yystrlen strlen |
|
1243 # else |
|
1244 /* Return the length of YYSTR. */ |
|
1245 #if (defined __STDC__ || defined __C99__FUNC__ \ |
|
1246 || defined __cplusplus || defined _MSC_VER) |
|
1247 static YYSIZE_T |
|
1248 yystrlen (const char *yystr) |
|
1249 #else |
|
1250 static YYSIZE_T |
|
1251 yystrlen (yystr) |
|
1252 const char *yystr; |
|
1253 #endif |
|
1254 { |
|
1255 YYSIZE_T yylen; |
|
1256 for (yylen = 0; yystr[yylen]; yylen++) |
|
1257 continue; |
|
1258 return yylen; |
|
1259 } |
|
1260 # endif |
|
1261 # endif |
|
1262 |
|
1263 # ifndef yystpcpy |
|
1264 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
|
1265 # define yystpcpy stpcpy |
|
1266 # else |
|
1267 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
|
1268 YYDEST. */ |
|
1269 #if (defined __STDC__ || defined __C99__FUNC__ \ |
|
1270 || defined __cplusplus || defined _MSC_VER) |
|
1271 static char * |
|
1272 yystpcpy (char *yydest, const char *yysrc) |
|
1273 #else |
|
1274 static char * |
|
1275 yystpcpy (yydest, yysrc) |
|
1276 char *yydest; |
|
1277 const char *yysrc; |
|
1278 #endif |
|
1279 { |
|
1280 char *yyd = yydest; |
|
1281 const char *yys = yysrc; |
|
1282 |
|
1283 while ((*yyd++ = *yys++) != '\0') |
|
1284 continue; |
|
1285 |
|
1286 return yyd - 1; |
|
1287 } |
|
1288 # endif |
|
1289 # endif |
|
1290 |
|
1291 # ifndef yytnamerr |
|
1292 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
|
1293 quotes and backslashes, so that it's suitable for yyerror. The |
|
1294 heuristic is that double-quoting is unnecessary unless the string |
|
1295 contains an apostrophe, a comma, or backslash (other than |
|
1296 backslash-backslash). YYSTR is taken from yytname. If YYRES is |
|
1297 null, do not copy; instead, return the length of what the result |
|
1298 would have been. */ |
|
1299 static YYSIZE_T |
|
1300 yytnamerr (char *yyres, const char *yystr) |
|
1301 { |
|
1302 if (*yystr == '"') |
|
1303 { |
|
1304 YYSIZE_T yyn = 0; |
|
1305 char const *yyp = yystr; |
|
1306 |
|
1307 for (;;) |
|
1308 switch (*++yyp) |
|
1309 { |
|
1310 case '\'': |
|
1311 case ',': |
|
1312 goto do_not_strip_quotes; |
|
1313 |
|
1314 case '\\': |
|
1315 if (*++yyp != '\\') |
|
1316 goto do_not_strip_quotes; |
|
1317 /* Fall through. */ |
|
1318 default: |
|
1319 if (yyres) |
|
1320 yyres[yyn] = *yyp; |
|
1321 yyn++; |
|
1322 break; |
|
1323 |
|
1324 case '"': |
|
1325 if (yyres) |
|
1326 yyres[yyn] = '\0'; |
|
1327 return yyn; |
|
1328 } |
|
1329 do_not_strip_quotes: ; |
|
1330 } |
|
1331 |
|
1332 if (! yyres) |
|
1333 return yystrlen (yystr); |
|
1334 |
|
1335 return yystpcpy (yyres, yystr) - yyres; |
|
1336 } |
|
1337 # endif |
|
1338 |
|
1339 /* Copy into YYRESULT an error message about the unexpected token |
|
1340 YYCHAR while in state YYSTATE. Return the number of bytes copied, |
|
1341 including the terminating null byte. If YYRESULT is null, do not |
|
1342 copy anything; just return the number of bytes that would be |
|
1343 copied. As a special case, return 0 if an ordinary "syntax error" |
|
1344 message will do. Return YYSIZE_MAXIMUM if overflow occurs during |
|
1345 size calculation. */ |
|
1346 static YYSIZE_T |
|
1347 yysyntax_error (char *yyresult, int yystate, int yychar) |
|
1348 { |
|
1349 int yyn = yypact[yystate]; |
|
1350 |
|
1351 if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) |
|
1352 return 0; |
|
1353 else |
|
1354 { |
|
1355 int yytype = YYTRANSLATE (yychar); |
|
1356 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); |
|
1357 YYSIZE_T yysize = yysize0; |
|
1358 YYSIZE_T yysize1; |
|
1359 int yysize_overflow = 0; |
|
1360 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
|
1361 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
|
1362 int yyx; |
|
1363 |
|
1364 # if 0 |
|
1365 /* This is so xgettext sees the translatable formats that are |
|
1366 constructed on the fly. */ |
|
1367 YY_("syntax error, unexpected %s"); |
|
1368 YY_("syntax error, unexpected %s, expecting %s"); |
|
1369 YY_("syntax error, unexpected %s, expecting %s or %s"); |
|
1370 YY_("syntax error, unexpected %s, expecting %s or %s or %s"); |
|
1371 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); |
|
1372 # endif |
|
1373 char *yyfmt; |
|
1374 char const *yyf; |
|
1375 static char const yyunexpected[] = "syntax error, unexpected %s"; |
|
1376 static char const yyexpecting[] = ", expecting %s"; |
|
1377 static char const yyor[] = " or %s"; |
|
1378 char yyformat[sizeof yyunexpected |
|
1379 + sizeof yyexpecting - 1 |
|
1380 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) |
|
1381 * (sizeof yyor - 1))]; |
|
1382 char const *yyprefix = yyexpecting; |
|
1383 |
|
1384 /* Start YYX at -YYN if negative to avoid negative indexes in |
|
1385 YYCHECK. */ |
|
1386 int yyxbegin = yyn < 0 ? -yyn : 0; |
|
1387 |
|
1388 /* Stay within bounds of both yycheck and yytname. */ |
|
1389 int yychecklim = YYLAST - yyn + 1; |
|
1390 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
|
1391 int yycount = 1; |
|
1392 |
|
1393 yyarg[0] = yytname[yytype]; |
|
1394 yyfmt = yystpcpy (yyformat, yyunexpected); |
|
1395 |
|
1396 for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
|
1397 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) |
|
1398 { |
|
1399 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
|
1400 { |
|
1401 yycount = 1; |
|
1402 yysize = yysize0; |
|
1403 yyformat[sizeof yyunexpected - 1] = '\0'; |
|
1404 break; |
|
1405 } |
|
1406 yyarg[yycount++] = yytname[yyx]; |
|
1407 yysize1 = yysize + yytnamerr (0, yytname[yyx]); |
|
1408 yysize_overflow |= (yysize1 < yysize); |
|
1409 yysize = yysize1; |
|
1410 yyfmt = yystpcpy (yyfmt, yyprefix); |
|
1411 yyprefix = yyor; |
|
1412 } |
|
1413 |
|
1414 yyf = YY_(yyformat); |
|
1415 yysize1 = yysize + yystrlen (yyf); |
|
1416 yysize_overflow |= (yysize1 < yysize); |
|
1417 yysize = yysize1; |
|
1418 |
|
1419 if (yysize_overflow) |
|
1420 return YYSIZE_MAXIMUM; |
|
1421 |
|
1422 if (yyresult) |
|
1423 { |
|
1424 /* Avoid sprintf, as that infringes on the user's name space. |
|
1425 Don't have undefined behavior even if the translation |
|
1426 produced a string with the wrong number of "%s"s. */ |
|
1427 char *yyp = yyresult; |
|
1428 int yyi = 0; |
|
1429 while ((*yyp = *yyf) != '\0') |
|
1430 { |
|
1431 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) |
|
1432 { |
|
1433 yyp += yytnamerr (yyp, yyarg[yyi++]); |
|
1434 yyf += 2; |
|
1435 } |
|
1436 else |
|
1437 { |
|
1438 yyp++; |
|
1439 yyf++; |
|
1440 } |
|
1441 } |
|
1442 } |
|
1443 return yysize; |
|
1444 } |
|
1445 } |
|
1446 #endif /* YYERROR_VERBOSE */ |
|
1447 |
|
1448 |
|
1449 /*-----------------------------------------------. |
|
1450 | Release the memory associated to this symbol. | |
|
1451 `-----------------------------------------------*/ |
|
1452 |
|
1453 /*ARGSUSED*/ |
|
1454 #if (defined __STDC__ || defined __C99__FUNC__ \ |
|
1455 || defined __cplusplus || defined _MSC_VER) |
|
1456 static void |
|
1457 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) |
|
1458 #else |
|
1459 static void |
|
1460 yydestruct (yymsg, yytype, yyvaluep) |
|
1461 const char *yymsg; |
|
1462 int yytype; |
|
1463 YYSTYPE *yyvaluep; |
|
1464 #endif |
|
1465 { |
|
1466 YYUSE (yyvaluep); |
|
1467 |
|
1468 if (!yymsg) |
|
1469 yymsg = "Deleting"; |
|
1470 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
|
1471 |
|
1472 switch (yytype) |
|
1473 { |
|
1474 |
|
1475 default: |
|
1476 break; |
|
1477 } |
|
1478 } |
|
1479 |
|
1480 /* Prevent warnings from -Wmissing-prototypes. */ |
|
1481 #ifdef YYPARSE_PARAM |
|
1482 #if defined __STDC__ || defined __cplusplus |
|
1483 int yyparse (void *YYPARSE_PARAM); |
|
1484 #else |
|
1485 int yyparse (); |
|
1486 #endif |
|
1487 #else /* ! YYPARSE_PARAM */ |
|
1488 #if defined __STDC__ || defined __cplusplus |
|
1489 int yyparse (void); |
|
1490 #else |
|
1491 int yyparse (); |
|
1492 #endif |
|
1493 #endif /* ! YYPARSE_PARAM */ |
|
1494 |
|
1495 |
|
1496 /* The lookahead symbol. */ |
|
1497 int yychar; |
|
1498 |
|
1499 /* The semantic value of the lookahead symbol. */ |
|
1500 YYSTYPE yylval; |
|
1501 |
|
1502 /* Number of syntax errors so far. */ |
|
1503 int yynerrs; |
|
1504 |
|
1505 |
|
1506 |
|
1507 /*-------------------------. |
|
1508 | yyparse or yypush_parse. | |
|
1509 `-------------------------*/ |
|
1510 |
|
1511 #ifdef YYPARSE_PARAM |
|
1512 #if (defined __STDC__ || defined __C99__FUNC__ \ |
|
1513 || defined __cplusplus || defined _MSC_VER) |
|
1514 int |
|
1515 yyparse (void *YYPARSE_PARAM) |
|
1516 #else |
|
1517 int |
|
1518 yyparse (YYPARSE_PARAM) |
|
1519 void *YYPARSE_PARAM; |
|
1520 #endif |
|
1521 #else /* ! YYPARSE_PARAM */ |
|
1522 #if (defined __STDC__ || defined __C99__FUNC__ \ |
|
1523 || defined __cplusplus || defined _MSC_VER) |
|
1524 int |
|
1525 yyparse (void) |
|
1526 #else |
|
1527 int |
|
1528 yyparse () |
|
1529 |
|
1530 #endif |
|
1531 #endif |
|
1532 { |
|
1533 |
|
1534 |
|
1535 int yystate; |
|
1536 /* Number of tokens to shift before error messages enabled. */ |
|
1537 int yyerrstatus; |
|
1538 |
|
1539 /* The stacks and their tools: |
|
1540 `yyss': related to states. |
|
1541 `yyvs': related to semantic values. |
|
1542 |
|
1543 Refer to the stacks thru separate pointers, to allow yyoverflow |
|
1544 to reallocate them elsewhere. */ |
|
1545 |
|
1546 /* The state stack. */ |
|
1547 yytype_int16 yyssa[YYINITDEPTH]; |
|
1548 yytype_int16 *yyss; |
|
1549 yytype_int16 *yyssp; |
|
1550 |
|
1551 /* The semantic value stack. */ |
|
1552 YYSTYPE yyvsa[YYINITDEPTH]; |
|
1553 YYSTYPE *yyvs; |
|
1554 YYSTYPE *yyvsp; |
|
1555 |
|
1556 YYSIZE_T yystacksize; |
|
1557 |
|
1558 int yyn; |
|
1559 int yyresult; |
|
1560 /* Lookahead token as an internal (translated) token number. */ |
|
1561 int yytoken; |
|
1562 /* The variables used to return semantic value and location from the |
|
1563 action routines. */ |
|
1564 YYSTYPE yyval; |
|
1565 |
|
1566 #if YYERROR_VERBOSE |
|
1567 /* Buffer for error messages, and its allocated size. */ |
|
1568 char yymsgbuf[128]; |
|
1569 char *yymsg = yymsgbuf; |
|
1570 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
|
1571 #endif |
|
1572 |
|
1573 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
|
1574 |
|
1575 /* The number of symbols on the RHS of the reduced rule. |
|
1576 Keep to zero when no symbol should be popped. */ |
|
1577 int yylen = 0; |
|
1578 |
|
1579 yytoken = 0; |
|
1580 yyss = yyssa; |
|
1581 yyvs = yyvsa; |
|
1582 yystacksize = YYINITDEPTH; |
|
1583 |
|
1584 YYDPRINTF ((stderr, "Starting parse\n")); |
|
1585 |
|
1586 yystate = 0; |
|
1587 yyerrstatus = 0; |
|
1588 yynerrs = 0; |
|
1589 yychar = YYEMPTY; /* Cause a token to be read. */ |
|
1590 |
|
1591 /* Initialize stack pointers. |
|
1592 Waste one element of value and location stack |
|
1593 so that they stay on the same level as the state stack. |
|
1594 The wasted elements are never initialized. */ |
|
1595 yyssp = yyss; |
|
1596 yyvsp = yyvs; |
|
1597 |
|
1598 goto yysetstate; |
|
1599 |
|
1600 /*------------------------------------------------------------. |
|
1601 | yynewstate -- Push a new state, which is found in yystate. | |
|
1602 `------------------------------------------------------------*/ |
|
1603 yynewstate: |
|
1604 /* In all cases, when you get here, the value and location stacks |
|
1605 have just been pushed. So pushing a state here evens the stacks. */ |
|
1606 yyssp++; |
|
1607 |
|
1608 yysetstate: |
|
1609 *yyssp = yystate; |
|
1610 |
|
1611 if (yyss + yystacksize - 1 <= yyssp) |
|
1612 { |
|
1613 /* Get the current used size of the three stacks, in elements. */ |
|
1614 YYSIZE_T yysize = yyssp - yyss + 1; |
|
1615 |
|
1616 #ifdef yyoverflow |
|
1617 { |
|
1618 /* Give user a chance to reallocate the stack. Use copies of |
|
1619 these so that the &'s don't force the real ones into |
|
1620 memory. */ |
|
1621 YYSTYPE *yyvs1 = yyvs; |
|
1622 yytype_int16 *yyss1 = yyss; |
|
1623 |
|
1624 /* Each stack pointer address is followed by the size of the |
|
1625 data in use in that stack, in bytes. This used to be a |
|
1626 conditional around just the two extra args, but that might |
|
1627 be undefined if yyoverflow is a macro. */ |
|
1628 yyoverflow (YY_("memory exhausted"), |
|
1629 &yyss1, yysize * sizeof (*yyssp), |
|
1630 &yyvs1, yysize * sizeof (*yyvsp), |
|
1631 &yystacksize); |
|
1632 |
|
1633 yyss = yyss1; |
|
1634 yyvs = yyvs1; |
|
1635 } |
|
1636 #else /* no yyoverflow */ |
|
1637 # ifndef YYSTACK_RELOCATE |
|
1638 goto yyexhaustedlab; |
|
1639 # else |
|
1640 /* Extend the stack our own way. */ |
|
1641 if (YYMAXDEPTH <= yystacksize) |
|
1642 goto yyexhaustedlab; |
|
1643 yystacksize *= 2; |
|
1644 if (YYMAXDEPTH < yystacksize) |
|
1645 yystacksize = YYMAXDEPTH; |
|
1646 |
|
1647 { |
|
1648 yytype_int16 *yyss1 = yyss; |
|
1649 union yyalloc *yyptr = |
|
1650 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
|
1651 if (! yyptr) |
|
1652 goto yyexhaustedlab; |
|
1653 YYSTACK_RELOCATE (yyss_alloc, yyss); |
|
1654 YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
|
1655 # undef YYSTACK_RELOCATE |
|
1656 if (yyss1 != yyssa) |
|
1657 YYSTACK_FREE (yyss1); |
|
1658 } |
|
1659 # endif |
|
1660 #endif /* no yyoverflow */ |
|
1661 |
|
1662 yyssp = yyss + yysize - 1; |
|
1663 yyvsp = yyvs + yysize - 1; |
|
1664 |
|
1665 YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
|
1666 (unsigned long int) yystacksize)); |
|
1667 |
|
1668 if (yyss + yystacksize - 1 <= yyssp) |
|
1669 YYABORT; |
|
1670 } |
|
1671 |
|
1672 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
|
1673 |
|
1674 if (yystate == YYFINAL) |
|
1675 YYACCEPT; |
|
1676 |
|
1677 goto yybackup; |
|
1678 |
|
1679 /*-----------. |
|
1680 | yybackup. | |
|
1681 `-----------*/ |
|
1682 yybackup: |
|
1683 |
|
1684 /* Do appropriate processing given the current state. Read a |
|
1685 lookahead token if we need one and don't already have one. */ |
|
1686 |
|
1687 /* First try to decide what to do without reference to lookahead token. */ |
|
1688 yyn = yypact[yystate]; |
|
1689 if (yyn == YYPACT_NINF) |
|
1690 goto yydefault; |
|
1691 |
|
1692 /* Not known => get a lookahead token if don't already have one. */ |
|
1693 |
|
1694 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
|
1695 if (yychar == YYEMPTY) |
|
1696 { |
|
1697 YYDPRINTF ((stderr, "Reading a token: ")); |
|
1698 yychar = YYLEX; |
|
1699 } |
|
1700 |
|
1701 if (yychar <= YYEOF) |
|
1702 { |
|
1703 yychar = yytoken = YYEOF; |
|
1704 YYDPRINTF ((stderr, "Now at end of input.\n")); |
|
1705 } |
|
1706 else |
|
1707 { |
|
1708 yytoken = YYTRANSLATE (yychar); |
|
1709 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
|
1710 } |
|
1711 |
|
1712 /* If the proper action on seeing token YYTOKEN is to reduce or to |
|
1713 detect an error, take that action. */ |
|
1714 yyn += yytoken; |
|
1715 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
|
1716 goto yydefault; |
|
1717 yyn = yytable[yyn]; |
|
1718 if (yyn <= 0) |
|
1719 { |
|
1720 if (yyn == 0 || yyn == YYTABLE_NINF) |
|
1721 goto yyerrlab; |
|
1722 yyn = -yyn; |
|
1723 goto yyreduce; |
|
1724 } |
|
1725 |
|
1726 /* Count tokens shifted since error; after three, turn off error |
|
1727 status. */ |
|
1728 if (yyerrstatus) |
|
1729 yyerrstatus--; |
|
1730 |
|
1731 /* Shift the lookahead token. */ |
|
1732 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
|
1733 |
|
1734 /* Discard the shifted token. */ |
|
1735 yychar = YYEMPTY; |
|
1736 |
|
1737 yystate = yyn; |
|
1738 *++yyvsp = yylval; |
|
1739 |
|
1740 goto yynewstate; |
|
1741 |
|
1742 |
|
1743 /*-----------------------------------------------------------. |
|
1744 | yydefault -- do the default action for the current state. | |
|
1745 `-----------------------------------------------------------*/ |
|
1746 yydefault: |
|
1747 yyn = yydefact[yystate]; |
|
1748 if (yyn == 0) |
|
1749 goto yyerrlab; |
|
1750 goto yyreduce; |
|
1751 |
|
1752 |
|
1753 /*-----------------------------. |
|
1754 | yyreduce -- Do a reduction. | |
|
1755 `-----------------------------*/ |
|
1756 yyreduce: |
|
1757 /* yyn is the number of a rule to reduce with. */ |
|
1758 yylen = yyr2[yyn]; |
|
1759 |
|
1760 /* If YYLEN is nonzero, implement the default value of the action: |
|
1761 `$$ = $1'. |
|
1762 |
|
1763 Otherwise, the following line sets YYVAL to garbage. |
|
1764 This behavior is undocumented and Bison |
|
1765 users should not rely upon it. Assigning to YYVAL |
|
1766 unconditionally makes the parser a bit smaller, and it avoids a |
|
1767 GCC warning that YYVAL may be used uninitialized. */ |
|
1768 yyval = yyvsp[1-yylen]; |
|
1769 |
|
1770 |
|
1771 YY_REDUCE_PRINT (yyn); |
|
1772 switch (yyn) |
|
1773 { |
|
1774 case 2: |
|
1775 |
|
1776 /* Line 1455 of yacc.c */ |
|
1777 #line 182 "rcomp.yacc" |
|
1778 { if(verbose) { MOFF; cout << Divider << "\n" << Divider << endl; MON; } |
|
1779 ;} |
|
1780 break; |
|
1781 |
|
1782 case 15: |
|
1783 |
|
1784 /* Line 1455 of yacc.c */ |
|
1785 #line 208 "rcomp.yacc" |
|
1786 { |
|
1787 // This is my gift to the world: no more "syntax error" for adding |
|
1788 // an extra semicolon at the end of a struct or resource. |
|
1789 REGISTER_LINE; |
|
1790 ErrorHandler::OutputErrorLine("Warning: unnecessary semicolon"); |
|
1791 ;} |
|
1792 break; |
|
1793 |
|
1794 case 17: |
|
1795 |
|
1796 /* Line 1455 of yacc.c */ |
|
1797 #line 222 "rcomp.yacc" |
|
1798 { if(verbose) { MOFF; cout << Divider << "\n" << * pSH << Divider << endl; MON;} ;} |
|
1799 break; |
|
1800 |
|
1801 case 18: |
|
1802 |
|
1803 /* Line 1455 of yacc.c */ |
|
1804 #line 226 "rcomp.yacc" |
|
1805 { if(verbose) { MOFF;cout << "struct_statement_start " << (yyvsp[(2) - (4)].Value) << endl; MON;} |
|
1806 pSH = new StructHeader((yyvsp[(2) - (4)].Value)); |
|
1807 REGISTER_LINE; |
|
1808 pG->SHA.Add(pSH); |
|
1809 ;} |
|
1810 break; |
|
1811 |
|
1812 case 19: |
|
1813 |
|
1814 /* Line 1455 of yacc.c */ |
|
1815 #line 232 "rcomp.yacc" |
|
1816 { if(verbose) { RCTypeArray Types; MOFF;cout << "struct_statement_start " << (yyvsp[(2) - (5)].Value) << " " << Types.GetName((yyvsp[(3) - (5)].Id)) << endl; MON;} |
|
1817 pSH = new StructHeader((yyvsp[(2) - (5)].Value), (yyvsp[(3) - (5)].Id)); |
|
1818 REGISTER_LINE; |
|
1819 pG->SHA.Add(pSH); |
|
1820 ;} |
|
1821 break; |
|
1822 |
|
1823 case 20: |
|
1824 |
|
1825 /* Line 1455 of yacc.c */ |
|
1826 #line 238 "rcomp.yacc" |
|
1827 { if(verbose) { MOFF;cout << "struct_statement_start " << (yyvsp[(2) - (5)].Value) << " (WORD)" << endl; MON;} |
|
1828 pSH = new StructHeader((yyvsp[(2) - (5)].Value), L_WORD); |
|
1829 REGISTER_LINE; |
|
1830 pG->SHA.Add(pSH); |
|
1831 ;} |
|
1832 break; |
|
1833 |
|
1834 case 21: |
|
1835 |
|
1836 /* Line 1455 of yacc.c */ |
|
1837 #line 245 "rcomp.yacc" |
|
1838 { if(verbose) { MOFF;cout << "struct_item_list Adding struct_item." << endl; MON;} |
|
1839 REGISTER_LINE; |
|
1840 pSH->iSIA.Add((yyvsp[(2) - (3)].pStructItem)); |
|
1841 ;} |
|
1842 break; |
|
1843 |
|
1844 case 22: |
|
1845 |
|
1846 /* Line 1455 of yacc.c */ |
|
1847 #line 249 "rcomp.yacc" |
|
1848 { if(verbose) { MOFF;cout << "tagged struct_item_list Adding struct_item." << endl; MON;} |
|
1849 REGISTER_LINE; |
|
1850 pSH->iSIA.Add((yyvsp[(3) - (4)].pStructItem)); |
|
1851 ;} |
|
1852 break; |
|
1853 |
|
1854 case 28: |
|
1855 |
|
1856 /* Line 1455 of yacc.c */ |
|
1857 #line 262 "rcomp.yacc" |
|
1858 { (yyval.pStructItem) = (yyvsp[(1) - (1)].pSimpleStructItem);;} |
|
1859 break; |
|
1860 |
|
1861 case 29: |
|
1862 |
|
1863 /* Line 1455 of yacc.c */ |
|
1864 #line 264 "rcomp.yacc" |
|
1865 { if(verbose) { MOFF;cout << " Limit: " << (yyvsp[(3) - (4)].Value) << endl; MON;} |
|
1866 (yyvsp[(1) - (4)].pSimpleStructItem)->iLengthLimit = (yyvsp[(3) - (4)].Value); |
|
1867 (yyval.pStructItem) = (yyvsp[(1) - (4)].pSimpleStructItem); |
|
1868 ;} |
|
1869 break; |
|
1870 |
|
1871 case 30: |
|
1872 |
|
1873 /* Line 1455 of yacc.c */ |
|
1874 #line 269 "rcomp.yacc" |
|
1875 { if(verbose) { MOFF;cout << " Default: " << (yyvsp[(3) - (3)].Value) << endl; MON;} |
|
1876 (yyvsp[(1) - (3)].pSimpleStructItem)->iDefault = (yyvsp[(3) - (3)].Value); |
|
1877 (yyval.pStructItem) = (yyvsp[(1) - (3)].pSimpleStructItem); |
|
1878 ;} |
|
1879 break; |
|
1880 |
|
1881 case 31: |
|
1882 |
|
1883 /* Line 1455 of yacc.c */ |
|
1884 #line 274 "rcomp.yacc" |
|
1885 { if(verbose) { MOFF;cout << " Limit: " << (yyvsp[(3) - (6)].Value) << ", Default: " << (yyvsp[(6) - (6)].Value) << endl; MON;} |
|
1886 NumericValue Limit((yyvsp[(3) - (6)].Value), L_LONG); |
|
1887 if(String((yyvsp[(6) - (6)].Value)).ExportLength(TargetCharacterSet,SourceCharacterSet) > Limit.GetULong() ) |
|
1888 { |
|
1889 REGISTER_LINE; |
|
1890 ErrorHandler::OutputErrorLine("Text length exceeds specified limit"); |
|
1891 exit(1); |
|
1892 } |
|
1893 (yyvsp[(1) - (6)].pSimpleStructItem)->iLengthLimit = (yyvsp[(3) - (6)].Value); |
|
1894 (yyvsp[(1) - (6)].pSimpleStructItem)->iDefault = (yyvsp[(6) - (6)].Value); |
|
1895 (yyval.pStructItem) = (yyvsp[(1) - (6)].pSimpleStructItem); |
|
1896 ;} |
|
1897 break; |
|
1898 |
|
1899 case 32: |
|
1900 |
|
1901 /* Line 1455 of yacc.c */ |
|
1902 #line 289 "rcomp.yacc" |
|
1903 { if(verbose) |
|
1904 { |
|
1905 RCTypeArray Types; |
|
1906 MOFF;cout << "simple_struct_item " << Types.GetName((yyvsp[(1) - (2)].Id)) << " " << (yyvsp[(2) - (2)].Value) << endl; MON; |
|
1907 } |
|
1908 (yyval.pSimpleStructItem) = new SimpleStructItem((yyvsp[(1) - (2)].Id),(yyvsp[(2) - (2)].Value)); |
|
1909 assert((yyval.pSimpleStructItem) != NULL); |
|
1910 ;} |
|
1911 break; |
|
1912 |
|
1913 case 33: |
|
1914 |
|
1915 /* Line 1455 of yacc.c */ |
|
1916 #line 298 "rcomp.yacc" |
|
1917 { if(verbose) |
|
1918 { RCTypeArray Types; |
|
1919 MOFF;cout << "simple_struct_item " << Types.GetName((yyvsp[(1) - (5)].Id)) << " " << (yyvsp[(5) - (5)].Value) << endl; MON; |
|
1920 } |
|
1921 String s(NumericValue::ltoa((yyvsp[(3) - (5)].NumInitialiser))); |
|
1922 (yyval.pSimpleStructItem) = new SimpleStructItem((yyvsp[(1) - (5)].Id),(yyvsp[(5) - (5)].Value),s); |
|
1923 assert((yyval.pSimpleStructItem) != NULL); |
|
1924 ;} |
|
1925 break; |
|
1926 |
|
1927 case 34: |
|
1928 |
|
1929 /* Line 1455 of yacc.c */ |
|
1930 #line 312 "rcomp.yacc" |
|
1931 { (yyval.Id) = L_BYTE;;} |
|
1932 break; |
|
1933 |
|
1934 case 35: |
|
1935 |
|
1936 /* Line 1455 of yacc.c */ |
|
1937 #line 313 "rcomp.yacc" |
|
1938 { (yyval.Id) = L_WORD;;} |
|
1939 break; |
|
1940 |
|
1941 case 36: |
|
1942 |
|
1943 /* Line 1455 of yacc.c */ |
|
1944 #line 314 "rcomp.yacc" |
|
1945 { (yyval.Id) = L_LONG;;} |
|
1946 break; |
|
1947 |
|
1948 case 37: |
|
1949 |
|
1950 /* Line 1455 of yacc.c */ |
|
1951 #line 315 "rcomp.yacc" |
|
1952 { (yyval.Id) = L_DOUBLE;;} |
|
1953 break; |
|
1954 |
|
1955 case 38: |
|
1956 |
|
1957 /* Line 1455 of yacc.c */ |
|
1958 #line 320 "rcomp.yacc" |
|
1959 { |
|
1960 (yyval.Id) = ( TargetCharacterSet == String::Unicode ) ? L_TEXT16: L_TEXT8; |
|
1961 REGISTER_LINE; |
|
1962 ErrorHandler::OutputErrorLine("Warning: Deprecated use of zero-terminated TEXT - use LTEXT instead"); |
|
1963 ;} |
|
1964 break; |
|
1965 |
|
1966 case 39: |
|
1967 |
|
1968 /* Line 1455 of yacc.c */ |
|
1969 #line 326 "rcomp.yacc" |
|
1970 { |
|
1971 (yyval.Id) = ( TargetCharacterSet == String::Unicode ) ? L_LTEXT16: L_LTEXT8; |
|
1972 ;} |
|
1973 break; |
|
1974 |
|
1975 case 40: |
|
1976 |
|
1977 /* Line 1455 of yacc.c */ |
|
1978 #line 330 "rcomp.yacc" |
|
1979 { |
|
1980 (yyval.Id) = ( TargetCharacterSet == String::Unicode ) ? L_BUF16: L_BUF8; |
|
1981 ;} |
|
1982 break; |
|
1983 |
|
1984 case 41: |
|
1985 |
|
1986 /* Line 1455 of yacc.c */ |
|
1987 #line 336 "rcomp.yacc" |
|
1988 { (yyval.Id) = L_TEXT8; |
|
1989 REGISTER_LINE; |
|
1990 ErrorHandler::OutputErrorLine("Warning: Deprecated use of zero-terminated TEXT8 - use LTEXT8 instead"); |
|
1991 ;} |
|
1992 break; |
|
1993 |
|
1994 case 42: |
|
1995 |
|
1996 /* Line 1455 of yacc.c */ |
|
1997 #line 340 "rcomp.yacc" |
|
1998 { (yyval.Id) = L_TEXT16; |
|
1999 REGISTER_LINE; |
|
2000 ErrorHandler::OutputErrorLine("Warning: Deprecated use of zero-terminated TEXT16 - use LTEXT16 instead"); |
|
2001 ;} |
|
2002 break; |
|
2003 |
|
2004 case 43: |
|
2005 |
|
2006 /* Line 1455 of yacc.c */ |
|
2007 #line 344 "rcomp.yacc" |
|
2008 { (yyval.Id) = L_LTEXT8;;} |
|
2009 break; |
|
2010 |
|
2011 case 44: |
|
2012 |
|
2013 /* Line 1455 of yacc.c */ |
|
2014 #line 345 "rcomp.yacc" |
|
2015 { (yyval.Id) = L_LTEXT16;;} |
|
2016 break; |
|
2017 |
|
2018 case 45: |
|
2019 |
|
2020 /* Line 1455 of yacc.c */ |
|
2021 #line 346 "rcomp.yacc" |
|
2022 { (yyval.Id) = L_BUF8;;} |
|
2023 break; |
|
2024 |
|
2025 case 46: |
|
2026 |
|
2027 /* Line 1455 of yacc.c */ |
|
2028 #line 347 "rcomp.yacc" |
|
2029 { (yyval.Id) = L_BUF16;;} |
|
2030 break; |
|
2031 |
|
2032 case 47: |
|
2033 |
|
2034 /* Line 1455 of yacc.c */ |
|
2035 #line 348 "rcomp.yacc" |
|
2036 { (yyval.Id) = L_LINK;;} |
|
2037 break; |
|
2038 |
|
2039 case 48: |
|
2040 |
|
2041 /* Line 1455 of yacc.c */ |
|
2042 #line 349 "rcomp.yacc" |
|
2043 { (yyval.Id) = L_LLINK;;} |
|
2044 break; |
|
2045 |
|
2046 case 49: |
|
2047 |
|
2048 /* Line 1455 of yacc.c */ |
|
2049 #line 350 "rcomp.yacc" |
|
2050 { (yyval.Id) = L_SRLINK;;} |
|
2051 break; |
|
2052 |
|
2053 case 50: |
|
2054 |
|
2055 /* Line 1455 of yacc.c */ |
|
2056 #line 353 "rcomp.yacc" |
|
2057 { (yyval.pStructItem) = (yyvsp[(1) - (1)].pArrayStructItem);;} |
|
2058 break; |
|
2059 |
|
2060 case 51: |
|
2061 |
|
2062 /* Line 1455 of yacc.c */ |
|
2063 #line 355 "rcomp.yacc" |
|
2064 { if(verbose) { MOFF;cout << "array_struct_item with simple_initialiser_list" << endl;MON;} |
|
2065 (yyvsp[(1) - (5)].pArrayStructItem)->iDefaults = * (yyvsp[(4) - (5)].pStringArray); |
|
2066 if((yyvsp[(1) - (5)].pArrayStructItem)->iSize.Length() > 0) |
|
2067 { |
|
2068 NumericValue v((yyvsp[(1) - (5)].pArrayStructItem)->iSize, L_LONG); |
|
2069 REGISTER_LINE; |
|
2070 if((yyvsp[(4) - (5)].pStringArray)->Size()!=long(v.GetULong())) |
|
2071 { |
|
2072 ErrorHandler::OutputErrorLine("Size does not match number of initialisers"); |
|
2073 exit(1); |
|
2074 } |
|
2075 } |
|
2076 (yyval.pStructItem) = (yyvsp[(1) - (5)].pArrayStructItem); |
|
2077 delete (yyvsp[(4) - (5)].pStringArray); |
|
2078 ;} |
|
2079 break; |
|
2080 |
|
2081 case 52: |
|
2082 |
|
2083 /* Line 1455 of yacc.c */ |
|
2084 #line 372 "rcomp.yacc" |
|
2085 { if(verbose) { MOFF;cout << "array_struct_item_base with no size" << endl;MON;} |
|
2086 (yyval.pArrayStructItem) =(yyvsp[(1) - (2)].pArrayStructItem); |
|
2087 ;} |
|
2088 break; |
|
2089 |
|
2090 case 53: |
|
2091 |
|
2092 /* Line 1455 of yacc.c */ |
|
2093 #line 376 "rcomp.yacc" |
|
2094 { if(verbose) { MOFF;cout << "array_struct_item_base with size " << (yyvsp[(2) - (3)].Value) << endl;MON;} |
|
2095 (yyvsp[(1) - (3)].pArrayStructItem)->iSize = (yyvsp[(2) - (3)].Value); |
|
2096 (yyval.pArrayStructItem) = (yyvsp[(1) - (3)].pArrayStructItem); |
|
2097 ;} |
|
2098 break; |
|
2099 |
|
2100 case 54: |
|
2101 |
|
2102 /* Line 1455 of yacc.c */ |
|
2103 #line 381 "rcomp.yacc" |
|
2104 { if(verbose) |
|
2105 { RCTypeArray Types; |
|
2106 MOFF;cout << "array_struct_item_base with LenType " << Types.GetName((yyvsp[(2) - (4)].Id)) << endl;MON; |
|
2107 } |
|
2108 (yyvsp[(3) - (4)].pArrayStructItem)->iLenType = (yyvsp[(2) - (4)].Id); |
|
2109 (yyval.pArrayStructItem) = (yyvsp[(3) - (4)].pArrayStructItem); |
|
2110 ;} |
|
2111 break; |
|
2112 |
|
2113 case 55: |
|
2114 |
|
2115 /* Line 1455 of yacc.c */ |
|
2116 #line 389 "rcomp.yacc" |
|
2117 { if(verbose) |
|
2118 { RCTypeArray Types; |
|
2119 MOFF;cout << "array_struct_item_base with size " << (yyvsp[(4) - (5)].Value) << " and LenType " << Types.GetName((yyvsp[(2) - (5)].Id)) << endl;MON; |
|
2120 } |
|
2121 (yyvsp[(3) - (5)].pArrayStructItem)->iLenType = (yyvsp[(2) - (5)].Id); |
|
2122 (yyvsp[(3) - (5)].pArrayStructItem)->iSize = (yyvsp[(4) - (5)].Value); |
|
2123 (yyval.pArrayStructItem) = (yyvsp[(3) - (5)].pArrayStructItem); |
|
2124 ;} |
|
2125 break; |
|
2126 |
|
2127 case 56: |
|
2128 |
|
2129 /* Line 1455 of yacc.c */ |
|
2130 #line 399 "rcomp.yacc" |
|
2131 { if(verbose) |
|
2132 { RCTypeArray Types; |
|
2133 MOFF;cout << "array_struct_item_start " << Types.GetName((yyvsp[(1) - (3)].Id)) << " " << (yyvsp[(2) - (3)].Value) << endl;MON; |
|
2134 } |
|
2135 (yyval.pArrayStructItem) = new ArrayStructItem((yyvsp[(1) - (3)].Id), (yyvsp[(2) - (3)].Value)); |
|
2136 ;} |
|
2137 break; |
|
2138 |
|
2139 case 57: |
|
2140 |
|
2141 /* Line 1455 of yacc.c */ |
|
2142 #line 407 "rcomp.yacc" |
|
2143 { (yyval.Id) = L_BYTE;;} |
|
2144 break; |
|
2145 |
|
2146 case 58: |
|
2147 |
|
2148 /* Line 1455 of yacc.c */ |
|
2149 #line 408 "rcomp.yacc" |
|
2150 { (yyval.Id) = L_WORD;;} |
|
2151 break; |
|
2152 |
|
2153 case 59: |
|
2154 |
|
2155 /* Line 1455 of yacc.c */ |
|
2156 #line 411 "rcomp.yacc" |
|
2157 { if(verbose) { MOFF;cout << "struct_type_struct_item " << (yyvsp[(2) - (2)].Value) << endl;MON;} |
|
2158 (yyval.pStructItem) = new StructTypeStructItem((yyvsp[(2) - (2)].Value)); |
|
2159 ;} |
|
2160 break; |
|
2161 |
|
2162 case 60: |
|
2163 |
|
2164 /* Line 1455 of yacc.c */ |
|
2165 #line 416 "rcomp.yacc" |
|
2166 { (yyval.pStructItem) = (yyvsp[(1) - (1)].pStructArrayStructItem);;} |
|
2167 break; |
|
2168 |
|
2169 case 61: |
|
2170 |
|
2171 /* Line 1455 of yacc.c */ |
|
2172 #line 418 "rcomp.yacc" |
|
2173 { if(verbose) { RCTypeArray Types; MOFF;cout << "struct_array_struct_item - Setting Size to " << Types.GetName((yyvsp[(2) - (3)].Id)) << endl;MON;} |
|
2174 (yyvsp[(3) - (3)].pStructArrayStructItem)->iLenType = (yyvsp[(2) - (3)].Id); (yyval.pStructItem) = (yyvsp[(3) - (3)].pStructArrayStructItem); |
|
2175 ;} |
|
2176 break; |
|
2177 |
|
2178 case 62: |
|
2179 |
|
2180 /* Line 1455 of yacc.c */ |
|
2181 #line 423 "rcomp.yacc" |
|
2182 { if(verbose) { MOFF;cout << "struct_array_struct_item_base " << (yyvsp[(2) - (4)].Value) << endl;MON;} |
|
2183 (yyval.pStructArrayStructItem) = new StructArrayStructItem((yyvsp[(2) - (4)].Value)); |
|
2184 ;} |
|
2185 break; |
|
2186 |
|
2187 case 63: |
|
2188 |
|
2189 /* Line 1455 of yacc.c */ |
|
2190 #line 427 "rcomp.yacc" |
|
2191 { if(verbose) { MOFF;cout << "struct_array_struct_item_base " << (yyvsp[(2) - (5)].Value) << " " << (yyvsp[(4) - (5)].Value) << endl;MON;} |
|
2192 (yyval.pStructArrayStructItem) = new StructArrayStructItem((yyvsp[(2) - (5)].Value), (yyvsp[(4) - (5)].Value)); |
|
2193 ;} |
|
2194 break; |
|
2195 |
|
2196 case 64: |
|
2197 |
|
2198 /* Line 1455 of yacc.c */ |
|
2199 #line 436 "rcomp.yacc" |
|
2200 { |
|
2201 pResourceHeader->AddDefault(); |
|
2202 CurrentId+=CurrentIdStep; |
|
2203 if(verbose) { MOFF;cout << "Resource ID "<< CurrentId << endl << Divider << "\n" << * pResourceHeader << Divider << endl;MON;} |
|
2204 pResourceHeader->SetResourceId(*pResourceNameIds,CurrentId,FormatIdAsHex); |
|
2205 pG->Index.Add(pResourceHeader); |
|
2206 |
|
2207 CheckStructUsage(); |
|
2208 |
|
2209 pUsedLabelsArray->Empty(); |
|
2210 |
|
2211 pResourceHeader = NULL; |
|
2212 ;} |
|
2213 break; |
|
2214 |
|
2215 case 65: |
|
2216 |
|
2217 /* Line 1455 of yacc.c */ |
|
2218 #line 451 "rcomp.yacc" |
|
2219 {;} |
|
2220 break; |
|
2221 |
|
2222 case 66: |
|
2223 |
|
2224 /* Line 1455 of yacc.c */ |
|
2225 #line 453 "rcomp.yacc" |
|
2226 { |
|
2227 if(verbose) { MOFF;cout << "resource_statement_start LOCAL" << endl;MON;} |
|
2228 assert(pResourceHeader != NULL); |
|
2229 pResourceHeader->iLocal = 1; |
|
2230 ;} |
|
2231 break; |
|
2232 |
|
2233 case 67: |
|
2234 |
|
2235 /* Line 1455 of yacc.c */ |
|
2236 #line 458 "rcomp.yacc" |
|
2237 {;} |
|
2238 break; |
|
2239 |
|
2240 case 68: |
|
2241 |
|
2242 /* Line 1455 of yacc.c */ |
|
2243 #line 461 "rcomp.yacc" |
|
2244 { if(verbose) { MOFF;cout << "resource_statement_start_names " << (yyvsp[(2) - (3)].Value) << " " << (yyvsp[(3) - (3)].Value) << endl;MON;} |
|
2245 assert(pResourceHeader == NULL); |
|
2246 pResourceHeader = new ResourceHeader((yyvsp[(3) - (3)].Value)); |
|
2247 pCurrentRIA = & (pResourceHeader->iRIA); |
|
2248 REGISTER_LINE; |
|
2249 if(pResourceNameIds->IsStored((yyvsp[(3) - (3)].Value))) |
|
2250 { |
|
2251 ErrorHandler::OutputErrorLine("Resource with this name encountered already"); |
|
2252 exit(1); |
|
2253 } |
|
2254 pCurrentRIA->FillFromStruct((yyvsp[(2) - (3)].Value)); |
|
2255 pG->AllIdentifiers.Add(new String((yyvsp[(3) - (3)].Value))); // Add label to store |
|
2256 ;} |
|
2257 break; |
|
2258 |
|
2259 case 69: |
|
2260 |
|
2261 /* Line 1455 of yacc.c */ |
|
2262 #line 474 "rcomp.yacc" |
|
2263 { if(verbose) { MOFF;cout << "resource_statement_start_names " << (yyvsp[(2) - (2)].Value) << " <Resource not named>" << endl;MON;} |
|
2264 assert(pResourceHeader == NULL); |
|
2265 pResourceHeader = new ResourceHeader; |
|
2266 pCurrentRIA = & (pResourceHeader->iRIA); |
|
2267 REGISTER_LINE; |
|
2268 pCurrentRIA->FillFromStruct((yyvsp[(2) - (2)].Value)); |
|
2269 ;} |
|
2270 break; |
|
2271 |
|
2272 case 70: |
|
2273 |
|
2274 /* Line 1455 of yacc.c */ |
|
2275 #line 483 "rcomp.yacc" |
|
2276 { if(verbose) { MOFF;cout << "resource_item_list" << endl;MON;};} |
|
2277 break; |
|
2278 |
|
2279 case 71: |
|
2280 |
|
2281 /* Line 1455 of yacc.c */ |
|
2282 #line 484 "rcomp.yacc" |
|
2283 { if(verbose) { MOFF;cout << "tagged resource_item_list" << endl;MON;};} |
|
2284 break; |
|
2285 |
|
2286 case 72: |
|
2287 |
|
2288 /* Line 1455 of yacc.c */ |
|
2289 #line 485 "rcomp.yacc" |
|
2290 { yyerrok; yyclearin; ;} |
|
2291 break; |
|
2292 |
|
2293 case 74: |
|
2294 |
|
2295 /* Line 1455 of yacc.c */ |
|
2296 #line 489 "rcomp.yacc" |
|
2297 { if(verbose) { MOFF;cout << "resource_item " << (yyvsp[(1) - (3)].Value) << " " << (yyvsp[(3) - (3)].Value) << endl;MON;} |
|
2298 REGISTER_LINE;/****************************************************************/ |
|
2299 pCurrentRIA->Set((yyvsp[(1) - (3)].Value), (yyvsp[(3) - (3)].Value)); |
|
2300 ;} |
|
2301 break; |
|
2302 |
|
2303 case 78: |
|
2304 |
|
2305 /* Line 1455 of yacc.c */ |
|
2306 #line 499 "rcomp.yacc" |
|
2307 { |
|
2308 if (verbose) |
|
2309 { MOFF;cout << "resource_simple_array_item " << (yyvsp[(1) - (4)].Value) << endl;MON;} |
|
2310 ;} |
|
2311 break; |
|
2312 |
|
2313 case 79: |
|
2314 |
|
2315 /* Line 1455 of yacc.c */ |
|
2316 #line 504 "rcomp.yacc" |
|
2317 { |
|
2318 if (verbose) |
|
2319 { MOFF;cout << "resource_simple_array_item " << (yyvsp[(1) - (5)].Value) << " with simple_initialiser_list" << endl;MON;} |
|
2320 REGISTER_LINE; |
|
2321 pCurrentRIA->Set((yyvsp[(1) - (5)].Value), * (yyvsp[(4) - (5)].pStringArray)); |
|
2322 delete (yyvsp[(4) - (5)].pStringArray); |
|
2323 ;} |
|
2324 break; |
|
2325 |
|
2326 case 80: |
|
2327 |
|
2328 /* Line 1455 of yacc.c */ |
|
2329 #line 532 "rcomp.yacc" |
|
2330 { if(verbose) { MOFF;cout << "struct_resource_item" << endl;MON;} |
|
2331 pCurrentRIA = pG->RIAStack.Pop(); |
|
2332 ;} |
|
2333 break; |
|
2334 |
|
2335 case 81: |
|
2336 |
|
2337 /* Line 1455 of yacc.c */ |
|
2338 #line 537 "rcomp.yacc" |
|
2339 { if(verbose) { MOFF;cout << "struct_resource_item_start " << (yyvsp[(1) - (4)].Value) << " " << (yyvsp[(3) - (4)].Value) << endl;MON;} |
|
2340 REGISTER_LINE; |
|
2341 pCurrentRIA->Set((yyvsp[(1) - (4)].Value), (yyvsp[(3) - (4)].Value)); |
|
2342 String * thisLabel = new String((yyvsp[(1) - (4)].Value)); |
|
2343 pUsedLabelsArray->Add(thisLabel); |
|
2344 // in here add the label to a temp store |
|
2345 pG->RIAStack.Push(pCurrentRIA); |
|
2346 pCurrentRIA = pCurrentRIA->Find((yyvsp[(1) - (4)].Value))->GetRIA(); |
|
2347 ;} |
|
2348 break; |
|
2349 |
|
2350 case 82: |
|
2351 |
|
2352 /* Line 1455 of yacc.c */ |
|
2353 #line 549 "rcomp.yacc" |
|
2354 { if(verbose) { MOFF;cout << "struct_array_resource_item" << endl;MON;} |
|
2355 pG->SRIStack.Pop(); |
|
2356 ;} |
|
2357 break; |
|
2358 |
|
2359 case 83: |
|
2360 |
|
2361 /* Line 1455 of yacc.c */ |
|
2362 #line 553 "rcomp.yacc" |
|
2363 { pG->SRIStack.Pop();;} |
|
2364 break; |
|
2365 |
|
2366 case 84: |
|
2367 |
|
2368 /* Line 1455 of yacc.c */ |
|
2369 #line 556 "rcomp.yacc" |
|
2370 { if(verbose) { MOFF;cout << "struct_array_resource_item_start " << (yyvsp[(1) - (5)].Value) << " " << (yyvsp[(4) - (5)].Value) << endl;MON;} |
|
2371 ResourceItem * p = pCurrentRIA->Find((yyvsp[(1) - (5)].Value)); |
|
2372 pG->SRIStack.Push(p); |
|
2373 REGISTER_LINE; |
|
2374 String * thisLabel = new String((yyvsp[(1) - (5)].Value)); |
|
2375 pUsedLabelsArray->Add(thisLabel); |
|
2376 // in here add the label to a temp store |
|
2377 p->Set((yyvsp[(4) - (5)].Value)); |
|
2378 pG->RIAStack.Push(pCurrentRIA); |
|
2379 pCurrentRIA = p->GetRIA(); |
|
2380 ;} |
|
2381 break; |
|
2382 |
|
2383 case 88: |
|
2384 |
|
2385 /* Line 1455 of yacc.c */ |
|
2386 #line 574 "rcomp.yacc" |
|
2387 { if(verbose) { MOFF;cout << "struct_array_resource_item_list_top " << endl;MON;} |
|
2388 pCurrentRIA = pG->RIAStack.Pop(); |
|
2389 ;} |
|
2390 break; |
|
2391 |
|
2392 case 91: |
|
2393 |
|
2394 /* Line 1455 of yacc.c */ |
|
2395 #line 584 "rcomp.yacc" |
|
2396 { if(verbose) { MOFF;cout << "struct_array_resource_item_list_item " << endl;MON;} |
|
2397 pCurrentRIA = pG->RIAStack.Pop(); |
|
2398 ;} |
|
2399 break; |
|
2400 |
|
2401 case 92: |
|
2402 |
|
2403 /* Line 1455 of yacc.c */ |
|
2404 #line 589 "rcomp.yacc" |
|
2405 { if(verbose) { MOFF;cout << "struct_array_resource_item_list_item_start " << (yyvsp[(1) - (2)].Value) << endl;MON;} |
|
2406 ResourceItem * p = pG->SRIStack.Peek(); |
|
2407 REGISTER_LINE; |
|
2408 p->Set((yyvsp[(1) - (2)].Value)); |
|
2409 pG->RIAStack.Push(pCurrentRIA); |
|
2410 pCurrentRIA = p->GetRIA(); |
|
2411 ;} |
|
2412 break; |
|
2413 |
|
2414 case 94: |
|
2415 |
|
2416 /* Line 1455 of yacc.c */ |
|
2417 #line 605 "rcomp.yacc" |
|
2418 { |
|
2419 // convert literal to unsigned long value of 1st character |
|
2420 SetCharacterLiteral((yyval.Value), (yyvsp[(1) - (1)].Value)); |
|
2421 ;} |
|
2422 break; |
|
2423 |
|
2424 case 97: |
|
2425 |
|
2426 /* Line 1455 of yacc.c */ |
|
2427 #line 614 "rcomp.yacc" |
|
2428 { |
|
2429 if(verbose) |
|
2430 { |
|
2431 MOFF;cout << "simple_initialiser_list - single string " << (yyvsp[(1) - (1)].Value) << endl;MON; |
|
2432 } |
|
2433 |
|
2434 (yyval.pStringArray) = new StringArray; |
|
2435 (yyval.pStringArray)->Add(new String((yyvsp[(1) - (1)].Value)) ); |
|
2436 ;} |
|
2437 break; |
|
2438 |
|
2439 case 98: |
|
2440 |
|
2441 /* Line 1455 of yacc.c */ |
|
2442 #line 624 "rcomp.yacc" |
|
2443 { if(verbose) { MOFF;cout << "simple_initialiser_list - part of list " << (yyvsp[(3) - (3)].Value) << endl;MON;} |
|
2444 assert((yyvsp[(1) - (3)].pStringArray) != NULL); |
|
2445 (yyvsp[(1) - (3)].pStringArray)->Add(new String((yyvsp[(3) - (3)].Value) ) ); |
|
2446 (yyval.pStringArray) = (yyvsp[(1) - (3)].pStringArray); |
|
2447 ;} |
|
2448 break; |
|
2449 |
|
2450 case 99: |
|
2451 |
|
2452 /* Line 1455 of yacc.c */ |
|
2453 #line 632 "rcomp.yacc" |
|
2454 { String s(NumericValue::ltoa((yyvsp[(1) - (1)].NumInitialiser)) ); strcpy((yyval.Value), s.GetAssertedNonEmptyBuffer() ); ;} |
|
2455 break; |
|
2456 |
|
2457 case 100: |
|
2458 |
|
2459 /* Line 1455 of yacc.c */ |
|
2460 #line 635 "rcomp.yacc" |
|
2461 { if(verbose) { MOFF;cout << "Converting number " << (yyvsp[(1) - (1)].Value) << endl;MON;} |
|
2462 REGISTER_LINE; |
|
2463 NumericValue v((yyvsp[(1) - (1)].Value), L_LONG); (yyval.NumInitialiser) = (long)v.GetULong(); |
|
2464 ;} |
|
2465 break; |
|
2466 |
|
2467 case 101: |
|
2468 |
|
2469 /* Line 1455 of yacc.c */ |
|
2470 #line 639 "rcomp.yacc" |
|
2471 { (yyval.NumInitialiser) = (yyvsp[(1) - (3)].NumInitialiser) + (yyvsp[(3) - (3)].NumInitialiser); ;} |
|
2472 break; |
|
2473 |
|
2474 case 102: |
|
2475 |
|
2476 /* Line 1455 of yacc.c */ |
|
2477 #line 640 "rcomp.yacc" |
|
2478 { (yyval.NumInitialiser) = (yyvsp[(1) - (3)].NumInitialiser) - (yyvsp[(3) - (3)].NumInitialiser); ;} |
|
2479 break; |
|
2480 |
|
2481 case 103: |
|
2482 |
|
2483 /* Line 1455 of yacc.c */ |
|
2484 #line 641 "rcomp.yacc" |
|
2485 { (yyval.NumInitialiser) = (yyvsp[(1) - (3)].NumInitialiser) * (yyvsp[(3) - (3)].NumInitialiser); ;} |
|
2486 break; |
|
2487 |
|
2488 case 104: |
|
2489 |
|
2490 /* Line 1455 of yacc.c */ |
|
2491 #line 642 "rcomp.yacc" |
|
2492 { (yyval.NumInitialiser) = (yyvsp[(1) - (3)].NumInitialiser) / (yyvsp[(3) - (3)].NumInitialiser); ;} |
|
2493 break; |
|
2494 |
|
2495 case 105: |
|
2496 |
|
2497 /* Line 1455 of yacc.c */ |
|
2498 #line 643 "rcomp.yacc" |
|
2499 { (yyval.NumInitialiser) = (yyvsp[(1) - (3)].NumInitialiser) | (yyvsp[(3) - (3)].NumInitialiser); ;} |
|
2500 break; |
|
2501 |
|
2502 case 106: |
|
2503 |
|
2504 /* Line 1455 of yacc.c */ |
|
2505 #line 644 "rcomp.yacc" |
|
2506 { if (!NumericValue::CheckSigned((yyvsp[(2) - (2)].NumInitialiser),L_LONG)) |
|
2507 { |
|
2508 REGISTER_LINE; |
|
2509 ErrorHandler::OutputErrorLine("Signed value too low"); |
|
2510 exit(1); |
|
2511 } |
|
2512 (yyval.NumInitialiser) = - (yyvsp[(2) - (2)].NumInitialiser); |
|
2513 ;} |
|
2514 break; |
|
2515 |
|
2516 case 107: |
|
2517 |
|
2518 /* Line 1455 of yacc.c */ |
|
2519 #line 652 "rcomp.yacc" |
|
2520 { (yyval.NumInitialiser) = (yyvsp[(2) - (3)].NumInitialiser); ;} |
|
2521 break; |
|
2522 |
|
2523 case 109: |
|
2524 |
|
2525 /* Line 1455 of yacc.c */ |
|
2526 #line 656 "rcomp.yacc" |
|
2527 { |
|
2528 if (strlen((yyval.Value))+strlen((yyvsp[(2) - (2)].Value)) > sizeof((yyval.Value))-1) |
|
2529 { |
|
2530 REGISTER_LINE; |
|
2531 ErrorHandler::OutputErrorLine("String expression is too long"); |
|
2532 exit(1); |
|
2533 } |
|
2534 strcat((yyval.Value), (yyvsp[(2) - (2)].Value)); |
|
2535 ;} |
|
2536 break; |
|
2537 |
|
2538 case 112: |
|
2539 |
|
2540 /* Line 1455 of yacc.c */ |
|
2541 #line 670 "rcomp.yacc" |
|
2542 { |
|
2543 const char * fileName = (*ErrorHandler::GetFileName()).GetBuffer(); |
|
2544 int lineNumber = ErrorHandler::GetLineNumber(); |
|
2545 QualifiedString * thisLabel = new QualifiedString((yyvsp[(1) - (1)].Value), new String(fileName), lineNumber); |
|
2546 // store the label in the UsedIdentifiers array for checking |
|
2547 // whether label was declared |
|
2548 pG->UsedIdentifiers.Add(thisLabel); |
|
2549 |
|
2550 if (pG->EnumValues.IsStored((yyvsp[(1) - (1)].Value))) |
|
2551 { |
|
2552 sprintf((yyval.Value), "%d", pG->EnumValues.FindId((yyvsp[(1) - (1)].Value))); |
|
2553 } |
|
2554 else if (pG->RlsNameIndex.count((yyvsp[(1) - (1)].Value))) // if rls item has already been defined |
|
2555 { |
|
2556 // Found a reference to an rls_string. |
|
2557 RlsValue &rv = pG->RlsValues[pG->RlsNameIndex[(yyvsp[(1) - (1)].Value)]]; |
|
2558 ++rv.iCitationCount; // iCitationCount counts the number of times this rls value has been referneced |
|
2559 // Warn for multiple uses if 'multi' keyword not used. |
|
2560 if (1 < rv.iCitationCount && rv.iCardinality == ERlsCardinalitySingle) |
|
2561 { |
|
2562 Message * message = pG->Messages.GetEntry(LT_001); |
|
2563 String fileLine = *(rv.iFileName); |
|
2564 if(message->GetActivated()) |
|
2565 { |
|
2566 pGL->AddWarningToStore(fileLine, rv.iLineNumber, message->GetMessageOutput()); |
|
2567 } |
|
2568 REGISTER_LINE; |
|
2569 if (!pG->WarningMultiExplained) |
|
2570 { |
|
2571 Message * message = pG->Messages.GetEntry(LT_002); |
|
2572 fileLine = String(*(pFileLineHandler->GetCurrentFile())); |
|
2573 if(message->GetActivated()) |
|
2574 { |
|
2575 pGL->AddWarningToStore(fileLine, pFileLineHandler->GetErrorLine(* pCurrentLineNumber), message->GetMessageOutput()); |
|
2576 pG->WarningMultiExplained = true; |
|
2577 } |
|
2578 } |
|
2579 } |
|
2580 switch (rv.iType) |
|
2581 { |
|
2582 // Strings and numbers are just copied to the next layer up. |
|
2583 case ERlsString: |
|
2584 case ERlsString8: |
|
2585 case ERlsByte: |
|
2586 case ERlsWord: |
|
2587 case ERlsLong: |
|
2588 case ERlsDouble: |
|
2589 strcpy((yyval.Value), rv.iValue.GetBuffer()); |
|
2590 break; |
|
2591 // Anything else is a character: this is converted to a number. |
|
2592 case ERlsStringChar: |
|
2593 case ERlsByteChar: |
|
2594 case ERlsWordChar: |
|
2595 case ERlsLongChar: |
|
2596 SetCharacterLiteral((yyval.Value), rv.iValue); |
|
2597 break; |
|
2598 default: |
|
2599 Message * message = pG->Messages.GetEntry(LT_031); |
|
2600 if(message->GetActivated()) |
|
2601 { |
|
2602 ErrorHandler::OutputErrorLine(message->GetMessageOutput()); |
|
2603 exit(1); |
|
2604 } |
|
2605 break; |
|
2606 } |
|
2607 } |
|
2608 else |
|
2609 { |
|
2610 /* |
|
2611 Could be a reference to another resource, perhaps even a forward reference: |
|
2612 the OverwriteLink functions do FindId again when writing out the data. |
|
2613 Sadly this also permits things which are really syntax errors, inadvertently |
|
2614 converting labels into string literals.. |
|
2615 */ |
|
2616 } |
|
2617 ;} |
|
2618 break; |
|
2619 |
|
2620 case 113: |
|
2621 |
|
2622 /* Line 1455 of yacc.c */ |
|
2623 #line 749 "rcomp.yacc" |
|
2624 { |
|
2625 REGISTER_LINE; |
|
2626 if((yyvsp[(2) - (3)].NumInitialiser) < 0 || ((yyvsp[(2) - (3)].NumInitialiser) > 255 && TargetCharacterSet != String::Unicode)) |
|
2627 { |
|
2628 ErrorHandler::OutputErrorLine("Character code must be a number in the range 0 to 255."); |
|
2629 exit(1); |
|
2630 } |
|
2631 if (TargetCharacterSet != String::Unicode) |
|
2632 { |
|
2633 * (yyval.Value) = char((yyvsp[(2) - (3)].NumInitialiser)); * ((yyval.Value) + 1) = '\0'; |
|
2634 } |
|
2635 else |
|
2636 { |
|
2637 if (SourceCharacterSet == String::CP1252) |
|
2638 { |
|
2639 if ( ((yyvsp[(2) - (3)].NumInitialiser) >= 0x80) && ((yyvsp[(2) - (3)].NumInitialiser) <= 0x9F ) ) // 80-9F are illegal Unicode values. |
|
2640 { |
|
2641 ErrorHandler::OutputErrorLine("Warning: Deprecated non-unicode value in source stream"); |
|
2642 } |
|
2643 * (yyval.Value) = char(UnicodeEscape); |
|
2644 asUTF8((yyval.Value) + 1, (yyvsp[(2) - (3)].NumInitialiser)); |
|
2645 } |
|
2646 else |
|
2647 if (SourceCharacterSet == String::UTF8) |
|
2648 { |
|
2649 asUTF8((yyval.Value), (yyvsp[(2) - (3)].NumInitialiser)); |
|
2650 } |
|
2651 else |
|
2652 { |
|
2653 // Unsatisfactory, but do people use other character sets? |
|
2654 if ((yyvsp[(2) - (3)].NumInitialiser) > 255) |
|
2655 { |
|
2656 ErrorHandler::OutputErrorLine("Don't know how to handle character > 255"); |
|
2657 } |
|
2658 * (yyval.Value) = char((yyvsp[(2) - (3)].NumInitialiser)); * ((yyval.Value) + 1) = '\0'; |
|
2659 } |
|
2660 } |
|
2661 ;} |
|
2662 break; |
|
2663 |
|
2664 case 114: |
|
2665 |
|
2666 /* Line 1455 of yacc.c */ |
|
2667 #line 795 "rcomp.yacc" |
|
2668 { |
|
2669 REGISTER_LINE; |
|
2670 SetIdFromName((yyvsp[(2) - (2)].Value)); |
|
2671 ;} |
|
2672 break; |
|
2673 |
|
2674 case 115: |
|
2675 |
|
2676 /* Line 1455 of yacc.c */ |
|
2677 #line 800 "rcomp.yacc" |
|
2678 { |
|
2679 REGISTER_LINE; |
|
2680 SetIdFromName((yyvsp[(2) - (2)].Value)); |
|
2681 ;} |
|
2682 break; |
|
2683 |
|
2684 case 116: |
|
2685 |
|
2686 /* Line 1455 of yacc.c */ |
|
2687 #line 812 "rcomp.yacc" |
|
2688 { |
|
2689 REGISTER_LINE; |
|
2690 if ((yyvsp[(2) - (2)].NumInitialiser) == 0) |
|
2691 { ErrorHandler::OutputErrorLine("UID2 must be non-zero"); exit(1); } |
|
2692 if (Uid2 != 0) |
|
2693 { ErrorHandler::OutputErrorLine("Warning: overwriting previous UID2 value"); } |
|
2694 Uid2=(yyvsp[(2) - (2)].NumInitialiser); |
|
2695 if(verbose) |
|
2696 { MOFF;cout << "uidX_statement UID2 " << Uid2 << endl;MON;} |
|
2697 ;} |
|
2698 break; |
|
2699 |
|
2700 case 117: |
|
2701 |
|
2702 /* Line 1455 of yacc.c */ |
|
2703 #line 823 "rcomp.yacc" |
|
2704 { |
|
2705 REGISTER_LINE; |
|
2706 if ((yyvsp[(2) - (2)].NumInitialiser) == 0) |
|
2707 { ErrorHandler::OutputErrorLine("UID3 must be non-zero"); exit(1); } |
|
2708 if (Uid3 != 0) |
|
2709 { ErrorHandler::OutputErrorLine("Warning: overwriting previous UID3 value"); } |
|
2710 Uid3=(yyvsp[(2) - (2)].NumInitialiser); |
|
2711 if(verbose) |
|
2712 { MOFF;cout << "uidX_statement UID3 " << Uid3 << endl;MON;} |
|
2713 ;} |
|
2714 break; |
|
2715 |
|
2716 case 118: |
|
2717 |
|
2718 /* Line 1455 of yacc.c */ |
|
2719 #line 844 "rcomp.yacc" |
|
2720 { if(verbose) { MOFF;cout << "character_set_statement " << (yyvsp[(2) - (2)].Value) << endl;MON;} |
|
2721 REGISTER_LINE; |
|
2722 SourceCharacterSet = CharacterSetID((yyvsp[(2) - (2)].Value)); |
|
2723 if ( SourceCharacterSet == String::UNKNOWN ) |
|
2724 { |
|
2725 String err = "Warning: Unrecognised character set name '"; |
|
2726 err += (yyvsp[(2) - (2)].Value); |
|
2727 err += "'"; |
|
2728 ErrorHandler::OutputErrorLine(err); |
|
2729 } |
|
2730 if ( SourceCharacterSet == String::Unicode ) |
|
2731 { |
|
2732 SourceCharacterSet = String::UNKNOWN; |
|
2733 ErrorHandler::OutputErrorLine("Unicode source is unsupported"); |
|
2734 } |
|
2735 ;} |
|
2736 break; |
|
2737 |
|
2738 case 119: |
|
2739 |
|
2740 /* Line 1455 of yacc.c */ |
|
2741 #line 868 "rcomp.yacc" |
|
2742 { if(verbose) { RCTypeArray Types; |
|
2743 MOFF;cout << "offset_statement " << (yyvsp[(2) - (2)].Value) << endl;MON; } |
|
2744 REGISTER_LINE; |
|
2745 CurrentId=((long) NumericValue((yyvsp[(2) - (2)].Value), L_LONG).GetULong() ); |
|
2746 ;} |
|
2747 break; |
|
2748 |
|
2749 case 120: |
|
2750 |
|
2751 /* Line 1455 of yacc.c */ |
|
2752 #line 879 "rcomp.yacc" |
|
2753 { if(verbose) { MOFF;cout << "system_statement" << endl;MON;} |
|
2754 CurrentIdStep=-1; |
|
2755 ;} |
|
2756 break; |
|
2757 |
|
2758 case 123: |
|
2759 |
|
2760 /* Line 1455 of yacc.c */ |
|
2761 #line 893 "rcomp.yacc" |
|
2762 { |
|
2763 if(verbose) |
|
2764 { MOFF;cout << "enum_statement" << endl;MON;} |
|
2765 CurrentEnumName = (yyvsp[(2) - (3)].Value); |
|
2766 CurrentEnumValue=0; |
|
2767 ;} |
|
2768 break; |
|
2769 |
|
2770 case 124: |
|
2771 |
|
2772 /* Line 1455 of yacc.c */ |
|
2773 #line 900 "rcomp.yacc" |
|
2774 { |
|
2775 if(verbose) |
|
2776 { MOFF;cout << "enum_statement" << endl;MON;} |
|
2777 CurrentEnumName = ""; |
|
2778 CurrentEnumValue=0; |
|
2779 ;} |
|
2780 break; |
|
2781 |
|
2782 case 125: |
|
2783 |
|
2784 /* Line 1455 of yacc.c */ |
|
2785 #line 910 "rcomp.yacc" |
|
2786 { |
|
2787 pG->EnumValues.Add((yyvsp[(1) - (1)].Value), CurrentEnumValue++); |
|
2788 pG->AllIdentifiers.Add(new String((yyvsp[(1) - (1)].Value))); // Add label to store |
|
2789 ;} |
|
2790 break; |
|
2791 |
|
2792 case 126: |
|
2793 |
|
2794 /* Line 1455 of yacc.c */ |
|
2795 #line 915 "rcomp.yacc" |
|
2796 { |
|
2797 CurrentEnumValue = atol((yyvsp[(3) - (3)].Value)); |
|
2798 pG->EnumValues.Add((yyvsp[(1) - (3)].Value), CurrentEnumValue); |
|
2799 CurrentEnumValue++; // Increment so that next field has value ($3+1) |
|
2800 pG->AllIdentifiers.Add(new String((yyvsp[(1) - (3)].Value))); // Add label to store |
|
2801 ;} |
|
2802 break; |
|
2803 |
|
2804 case 129: |
|
2805 |
|
2806 /* Line 1455 of yacc.c */ |
|
2807 #line 934 "rcomp.yacc" |
|
2808 { |
|
2809 pG->RlsNameIndex[(yyvsp[(3) - (4)].Value)] = pG->RlsValues.size(); |
|
2810 pG->RlsValues.push_back(RlsValue(ErrorHandler::GetFileName(), |
|
2811 ErrorHandler::GetLineNumber(), (yyvsp[(4) - (4)].Value), (yyvsp[(1) - (4)].RlsType), |
|
2812 (yyvsp[(2) - (4)].RlsQualifiers).iCardinality, (yyvsp[(2) - (4)].RlsQualifiers).iMaxLength)); |
|
2813 if((yyvsp[(2) - (4)].RlsQualifiers).iMaxLength |
|
2814 < String((yyvsp[(4) - (4)].Value)).ExportLength(TargetCharacterSet,SourceCharacterSet)) |
|
2815 { |
|
2816 Message * message = pG->Messages.GetEntry(LT_032); |
|
2817 if(message->GetActivated()) |
|
2818 { |
|
2819 ErrorHandler::OutputErrorLine(message->GetMessageOutput()); |
|
2820 exit(1); |
|
2821 } |
|
2822 } |
|
2823 ;} |
|
2824 break; |
|
2825 |
|
2826 case 130: |
|
2827 |
|
2828 /* Line 1455 of yacc.c */ |
|
2829 #line 951 "rcomp.yacc" |
|
2830 { |
|
2831 Message * message = pG->Messages.GetEntry(LT_033); |
|
2832 String fileName = *(pFileLineHandler->GetCurrentFile()); |
|
2833 int lineNumber = pFileLineHandler->GetErrorLine(* pCurrentLineNumber); |
|
2834 if(message->GetActivated()) |
|
2835 { |
|
2836 pGL->AddWarningToStore(fileName, lineNumber, message->GetMessageOutput()); |
|
2837 } |
|
2838 //... |
|
2839 /* Produce a warning "rls_string used for character constant: use rls_long, rls_word or rls_byte" */ |
|
2840 pG->RlsNameIndex[(yyvsp[(3) - (4)].Value)] = pG->RlsValues.size(); |
|
2841 pG->RlsValues.push_back(RlsValue(ErrorHandler::GetFileName(), |
|
2842 ErrorHandler::GetLineNumber(), (yyvsp[(4) - (4)].Value), ERlsStringChar, |
|
2843 (yyvsp[(2) - (4)].RlsQualifiers).iCardinality)); |
|
2844 ;} |
|
2845 break; |
|
2846 |
|
2847 case 131: |
|
2848 |
|
2849 /* Line 1455 of yacc.c */ |
|
2850 #line 967 "rcomp.yacc" |
|
2851 { |
|
2852 pG->RlsNameIndex[(yyvsp[(3) - (4)].Value)] = pG->RlsValues.size(); |
|
2853 pG->RlsValues.push_back(RlsValue(ErrorHandler::GetFileName(), |
|
2854 ErrorHandler::GetLineNumber(), (yyvsp[(4) - (4)].Value), (yyvsp[(1) - (4)].RlsType), |
|
2855 (yyvsp[(2) - (4)].RlsQualifiers).iCardinality)); |
|
2856 ;} |
|
2857 break; |
|
2858 |
|
2859 case 132: |
|
2860 |
|
2861 /* Line 1455 of yacc.c */ |
|
2862 #line 974 "rcomp.yacc" |
|
2863 { |
|
2864 pG->RlsNameIndex[(yyvsp[(3) - (4)].Value)] = pG->RlsValues.size(); |
|
2865 pG->RlsValues.push_back(RlsValue(ErrorHandler::GetFileName(), |
|
2866 ErrorHandler::GetLineNumber(), (yyvsp[(4) - (4)].Value), (yyvsp[(1) - (4)].RlsType), |
|
2867 (yyvsp[(2) - (4)].RlsQualifiers).iCardinality)); |
|
2868 ;} |
|
2869 break; |
|
2870 |
|
2871 case 133: |
|
2872 |
|
2873 /* Line 1455 of yacc.c */ |
|
2874 #line 981 "rcomp.yacc" |
|
2875 { |
|
2876 TRlsType rlsCharType = (yyvsp[(1) - (4)].RlsType) == ERlsByte? ERlsByteChar |
|
2877 : ( (yyvsp[(1) - (4)].RlsType) == ERlsWord? ERlsWordChar : ERlsLongChar ); |
|
2878 pG->RlsNameIndex[(yyvsp[(3) - (4)].Value)] = pG->RlsValues.size(); |
|
2879 pG->RlsValues.push_back(RlsValue(ErrorHandler::GetFileName(), |
|
2880 ErrorHandler::GetLineNumber(), (yyvsp[(4) - (4)].Value), rlsCharType, |
|
2881 (yyvsp[(2) - (4)].RlsQualifiers).iCardinality)); |
|
2882 ;} |
|
2883 break; |
|
2884 |
|
2885 case 134: |
|
2886 |
|
2887 /* Line 1455 of yacc.c */ |
|
2888 #line 992 "rcomp.yacc" |
|
2889 { |
|
2890 // Register line even if no warning here so that |
|
2891 // the rls_ item knows which line the label was on. |
|
2892 // Without this, the line registered would be the |
|
2893 // line following the declaration. |
|
2894 REGISTER_LINE; |
|
2895 strcpy((yyval.Value), (yyvsp[(1) - (1)].Value)); |
|
2896 |
|
2897 if (pG->RlsNameIndex.count((yyvsp[(1) - (1)].Value)) != 0) |
|
2898 { |
|
2899 Message * message = pG->Messages.GetEntry(LT_003); |
|
2900 if(message->GetActivated()) |
|
2901 { |
|
2902 ErrorHandler::OutputErrorLine(message->GetMessageOutput()); |
|
2903 } |
|
2904 } |
|
2905 pG->AllIdentifiers.Add(new String((yyvsp[(1) - (1)].Value))); // Add label to store |
|
2906 ;} |
|
2907 break; |
|
2908 |
|
2909 case 135: |
|
2910 |
|
2911 /* Line 1455 of yacc.c */ |
|
2912 #line 1013 "rcomp.yacc" |
|
2913 { |
|
2914 NumericValue v((yyvsp[(2) - (4)].Value), L_LONG); |
|
2915 (yyval.RlsQualifiers).iMaxLength = v.GetULong(); |
|
2916 (yyval.RlsQualifiers).iCardinality = (yyvsp[(4) - (4)].RlsQualifiers).iCardinality; |
|
2917 ;} |
|
2918 break; |
|
2919 |
|
2920 case 136: |
|
2921 |
|
2922 /* Line 1455 of yacc.c */ |
|
2923 #line 1019 "rcomp.yacc" |
|
2924 { (yyval.RlsQualifiers) = (yyvsp[(1) - (1)].RlsQualifiers); ;} |
|
2925 break; |
|
2926 |
|
2927 case 137: |
|
2928 |
|
2929 /* Line 1455 of yacc.c */ |
|
2930 #line 1024 "rcomp.yacc" |
|
2931 { |
|
2932 (yyval.RlsQualifiers).iMaxLength = 0xFFFFFFF; |
|
2933 (yyval.RlsQualifiers).iCardinality = ERlsCardinalityMultiple; |
|
2934 ;} |
|
2935 break; |
|
2936 |
|
2937 case 138: |
|
2938 |
|
2939 /* Line 1455 of yacc.c */ |
|
2940 #line 1029 "rcomp.yacc" |
|
2941 { |
|
2942 (yyval.RlsQualifiers).iMaxLength = 0xFFFFFFF; |
|
2943 (yyval.RlsQualifiers).iCardinality = ERlsCardinalitySingle; |
|
2944 ;} |
|
2945 break; |
|
2946 |
|
2947 case 139: |
|
2948 |
|
2949 /* Line 1455 of yacc.c */ |
|
2950 #line 1037 "rcomp.yacc" |
|
2951 { (yyval.RlsType) = ERlsString; ;} |
|
2952 break; |
|
2953 |
|
2954 case 140: |
|
2955 |
|
2956 /* Line 1455 of yacc.c */ |
|
2957 #line 1039 "rcomp.yacc" |
|
2958 { (yyval.RlsType) = ERlsString8; ;} |
|
2959 break; |
|
2960 |
|
2961 case 141: |
|
2962 |
|
2963 /* Line 1455 of yacc.c */ |
|
2964 #line 1044 "rcomp.yacc" |
|
2965 { (yyval.RlsType) = ERlsByte; ;} |
|
2966 break; |
|
2967 |
|
2968 case 142: |
|
2969 |
|
2970 /* Line 1455 of yacc.c */ |
|
2971 #line 1046 "rcomp.yacc" |
|
2972 { (yyval.RlsType) = ERlsWord; ;} |
|
2973 break; |
|
2974 |
|
2975 case 143: |
|
2976 |
|
2977 /* Line 1455 of yacc.c */ |
|
2978 #line 1048 "rcomp.yacc" |
|
2979 { (yyval.RlsType) = ERlsLong; ;} |
|
2980 break; |
|
2981 |
|
2982 case 144: |
|
2983 |
|
2984 /* Line 1455 of yacc.c */ |
|
2985 #line 1053 "rcomp.yacc" |
|
2986 { (yyval.RlsType) = ERlsDouble; ;} |
|
2987 break; |
|
2988 |
|
2989 case 147: |
|
2990 |
|
2991 /* Line 1455 of yacc.c */ |
|
2992 #line 1065 "rcomp.yacc" |
|
2993 {ErrorHandler::Register(pFileLineHandler->GetCurrentFile(), pFileLineHandler->GetErrorLine(*pCurrentLineNumber)); ;} |
|
2994 break; |
|
2995 |
|
2996 case 150: |
|
2997 |
|
2998 /* Line 1455 of yacc.c */ |
|
2999 #line 1075 "rcomp.yacc" |
|
3000 { pGL->StoreComment((yyvsp[(1) - (1)].Value)); ;} |
|
3001 break; |
|
3002 |
|
3003 case 151: |
|
3004 |
|
3005 /* Line 1455 of yacc.c */ |
|
3006 #line 1076 "rcomp.yacc" |
|
3007 { pGL->StoreComment((yyvsp[(1) - (1)].Value)); ;} |
|
3008 break; |
|
3009 |
|
3010 case 152: |
|
3011 |
|
3012 /* Line 1455 of yacc.c */ |
|
3013 #line 1077 "rcomp.yacc" |
|
3014 { pGL->StoreComment((yyvsp[(1) - (1)].Value)); ;} |
|
3015 break; |
|
3016 |
|
3017 |
|
3018 |
|
3019 /* Line 1455 of yacc.c */ |
|
3020 #line 3037 "rcomp.tab.cacc" |
|
3021 default: break; |
|
3022 } |
|
3023 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
|
3024 |
|
3025 YYPOPSTACK (yylen); |
|
3026 yylen = 0; |
|
3027 YY_STACK_PRINT (yyss, yyssp); |
|
3028 |
|
3029 *++yyvsp = yyval; |
|
3030 |
|
3031 /* Now `shift' the result of the reduction. Determine what state |
|
3032 that goes to, based on the state we popped back to and the rule |
|
3033 number reduced by. */ |
|
3034 |
|
3035 yyn = yyr1[yyn]; |
|
3036 |
|
3037 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
|
3038 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
|
3039 yystate = yytable[yystate]; |
|
3040 else |
|
3041 yystate = yydefgoto[yyn - YYNTOKENS]; |
|
3042 |
|
3043 goto yynewstate; |
|
3044 |
|
3045 |
|
3046 /*------------------------------------. |
|
3047 | yyerrlab -- here on detecting error | |
|
3048 `------------------------------------*/ |
|
3049 yyerrlab: |
|
3050 /* If not already recovering from an error, report this error. */ |
|
3051 if (!yyerrstatus) |
|
3052 { |
|
3053 ++yynerrs; |
|
3054 #if ! YYERROR_VERBOSE |
|
3055 yyerror (YY_("syntax error")); |
|
3056 #else |
|
3057 { |
|
3058 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); |
|
3059 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) |
|
3060 { |
|
3061 YYSIZE_T yyalloc = 2 * yysize; |
|
3062 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) |
|
3063 yyalloc = YYSTACK_ALLOC_MAXIMUM; |
|
3064 if (yymsg != yymsgbuf) |
|
3065 YYSTACK_FREE (yymsg); |
|
3066 yymsg = (char *) YYSTACK_ALLOC (yyalloc); |
|
3067 if (yymsg) |
|
3068 yymsg_alloc = yyalloc; |
|
3069 else |
|
3070 { |
|
3071 yymsg = yymsgbuf; |
|
3072 yymsg_alloc = sizeof yymsgbuf; |
|
3073 } |
|
3074 } |
|
3075 |
|
3076 if (0 < yysize && yysize <= yymsg_alloc) |
|
3077 { |
|
3078 (void) yysyntax_error (yymsg, yystate, yychar); |
|
3079 yyerror (yymsg); |
|
3080 } |
|
3081 else |
|
3082 { |
|
3083 yyerror (YY_("syntax error")); |
|
3084 if (yysize != 0) |
|
3085 goto yyexhaustedlab; |
|
3086 } |
|
3087 } |
|
3088 #endif |
|
3089 } |
|
3090 |
|
3091 |
|
3092 |
|
3093 if (yyerrstatus == 3) |
|
3094 { |
|
3095 /* If just tried and failed to reuse lookahead token after an |
|
3096 error, discard it. */ |
|
3097 |
|
3098 if (yychar <= YYEOF) |
|
3099 { |
|
3100 /* Return failure if at end of input. */ |
|
3101 if (yychar == YYEOF) |
|
3102 YYABORT; |
|
3103 } |
|
3104 else |
|
3105 { |
|
3106 yydestruct ("Error: discarding", |
|
3107 yytoken, &yylval); |
|
3108 yychar = YYEMPTY; |
|
3109 } |
|
3110 } |
|
3111 |
|
3112 /* Else will try to reuse lookahead token after shifting the error |
|
3113 token. */ |
|
3114 goto yyerrlab1; |
|
3115 |
|
3116 |
|
3117 /*---------------------------------------------------. |
|
3118 | yyerrorlab -- error raised explicitly by YYERROR. | |
|
3119 `---------------------------------------------------*/ |
|
3120 yyerrorlab: |
|
3121 |
|
3122 /* Pacify compilers like GCC when the user code never invokes |
|
3123 YYERROR and the label yyerrorlab therefore never appears in user |
|
3124 code. */ |
|
3125 if (/*CONSTCOND*/ 0) |
|
3126 goto yyerrorlab; |
|
3127 |
|
3128 /* Do not reclaim the symbols of the rule which action triggered |
|
3129 this YYERROR. */ |
|
3130 YYPOPSTACK (yylen); |
|
3131 yylen = 0; |
|
3132 YY_STACK_PRINT (yyss, yyssp); |
|
3133 yystate = *yyssp; |
|
3134 goto yyerrlab1; |
|
3135 |
|
3136 |
|
3137 /*-------------------------------------------------------------. |
|
3138 | yyerrlab1 -- common code for both syntax error and YYERROR. | |
|
3139 `-------------------------------------------------------------*/ |
|
3140 yyerrlab1: |
|
3141 yyerrstatus = 3; /* Each real token shifted decrements this. */ |
|
3142 |
|
3143 for (;;) |
|
3144 { |
|
3145 yyn = yypact[yystate]; |
|
3146 if (yyn != YYPACT_NINF) |
|
3147 { |
|
3148 yyn += YYTERROR; |
|
3149 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
|
3150 { |
|
3151 yyn = yytable[yyn]; |
|
3152 if (0 < yyn) |
|
3153 break; |
|
3154 } |
|
3155 } |
|
3156 |
|
3157 /* Pop the current state because it cannot handle the error token. */ |
|
3158 if (yyssp == yyss) |
|
3159 YYABORT; |
|
3160 |
|
3161 |
|
3162 yydestruct ("Error: popping", |
|
3163 yystos[yystate], yyvsp); |
|
3164 YYPOPSTACK (1); |
|
3165 yystate = *yyssp; |
|
3166 YY_STACK_PRINT (yyss, yyssp); |
|
3167 } |
|
3168 |
|
3169 *++yyvsp = yylval; |
|
3170 |
|
3171 |
|
3172 /* Shift the error token. */ |
|
3173 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
|
3174 |
|
3175 yystate = yyn; |
|
3176 goto yynewstate; |
|
3177 |
|
3178 |
|
3179 /*-------------------------------------. |
|
3180 | yyacceptlab -- YYACCEPT comes here. | |
|
3181 `-------------------------------------*/ |
|
3182 yyacceptlab: |
|
3183 yyresult = 0; |
|
3184 goto yyreturn; |
|
3185 |
|
3186 /*-----------------------------------. |
|
3187 | yyabortlab -- YYABORT comes here. | |
|
3188 `-----------------------------------*/ |
|
3189 yyabortlab: |
|
3190 yyresult = 1; |
|
3191 goto yyreturn; |
|
3192 |
|
3193 #if !defined(yyoverflow) || YYERROR_VERBOSE |
|
3194 /*-------------------------------------------------. |
|
3195 | yyexhaustedlab -- memory exhaustion comes here. | |
|
3196 `-------------------------------------------------*/ |
|
3197 yyexhaustedlab: |
|
3198 yyerror (YY_("memory exhausted")); |
|
3199 yyresult = 2; |
|
3200 /* Fall through. */ |
|
3201 #endif |
|
3202 |
|
3203 yyreturn: |
|
3204 if (yychar != YYEMPTY) |
|
3205 yydestruct ("Cleanup: discarding lookahead", |
|
3206 yytoken, &yylval); |
|
3207 /* Do not reclaim the symbols of the rule which action triggered |
|
3208 this YYABORT or YYACCEPT. */ |
|
3209 YYPOPSTACK (yylen); |
|
3210 YY_STACK_PRINT (yyss, yyssp); |
|
3211 while (yyssp != yyss) |
|
3212 { |
|
3213 yydestruct ("Cleanup: popping", |
|
3214 yystos[*yyssp], yyvsp); |
|
3215 YYPOPSTACK (1); |
|
3216 } |
|
3217 #ifndef yyoverflow |
|
3218 if (yyss != yyssa) |
|
3219 YYSTACK_FREE (yyss); |
|
3220 #endif |
|
3221 #if YYERROR_VERBOSE |
|
3222 if (yymsg != yymsgbuf) |
|
3223 YYSTACK_FREE (yymsg); |
|
3224 #endif |
|
3225 /* Make sure YYID is used. */ |
|
3226 return YYID (yyresult); |
|
3227 } |
|
3228 |
|
3229 |
|
3230 |
|
3231 /* Line 1675 of yacc.c */ |
|
3232 #line 1080 "rcomp.yacc" |
|
3233 |
|
3234 |
|
3235 // Function section |
|
3236 // ================ |
|
3237 |
|
3238 void asUTF8(char* aUtf8, int aUnicode) |
|
3239 { |
|
3240 if ( aUnicode > 0xffff ) |
|
3241 { |
|
3242 if ( aUnicode > 0x10ffff ) |
|
3243 { |
|
3244 ErrorHandler::OutputErrorLine("Surrogate character code must be a number in the range 0x10000 to 0x10ffff"); |
|
3245 exit(1); |
|
3246 } |
|
3247 |
|
3248 UTF16 high = (UTF16)(0xD7C0 + (aUnicode >> 10)); // high surrogate |
|
3249 UTF16 low = (UTF16)(0xDC00 | (aUnicode & 0x3FF)); // low surrogate |
|
3250 |
|
3251 *aUtf8++ =(char)(0xe0|(high>>12)); |
|
3252 *aUtf8++ =(char)(0x80|((high>>6)&0x3f)); |
|
3253 *aUtf8++ =(char)(0x80|(high&0x3f)); |
|
3254 *aUtf8++ =(char)(0xe0|(low>>12)); |
|
3255 *aUtf8++ =(char)(0x80|((low>>6)&0x3f)); |
|
3256 *aUtf8 =(char)(0x80|(low&0x3f)); |
|
3257 } |
|
3258 else if ((aUnicode & 0xff80) == 0x0000) |
|
3259 { |
|
3260 *aUtf8 = (char)aUnicode; |
|
3261 } |
|
3262 else if ((aUnicode & 0xf800) == 0x0000) |
|
3263 { |
|
3264 *aUtf8++ =(char)(0xc0|(aUnicode>>6)); |
|
3265 *aUtf8 =(char)(0x80|(aUnicode&0x3f)); |
|
3266 } |
|
3267 else |
|
3268 { |
|
3269 *aUtf8++ =(char)(0xe0|(aUnicode>>12)); |
|
3270 *aUtf8++ =(char)(0x80|((aUnicode>>6)&0x3f)); |
|
3271 *aUtf8 =(char)(0x80|(aUnicode&0x3f)); |
|
3272 } |
|
3273 *++aUtf8 = '\0'; |
|
3274 } |
|
3275 |
|
3276 |
|
3277 String::CharacterSet CharacterSetID( const String & character_set_name ) |
|
3278 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
3279 // Return a character set ID from a character set name. The value UNKNOWN |
|
3280 // is returned if the name is not recognised. |
|
3281 // ---------------------------------------------------------------------------- |
|
3282 { |
|
3283 String::CharacterSet ids[] = { String::ISOLatin1, String::ASCII, String::CP1252 |
|
3284 , String::CP850, String::ShiftJIS, String::Unicode |
|
3285 , String::UTF8 |
|
3286 , String::UNKNOWN |
|
3287 }; |
|
3288 String names[] = { "ISOLATIN1", "ASCII", "CP1252", "CP850", "SHIFTJIS", "UNICODE", "UTF8" }; |
|
3289 |
|
3290 for ( int i=0; ids[i]!=String::UNKNOWN; i++ ) |
|
3291 { |
|
3292 if ( names[i] == character_set_name ) return ids[i]; |
|
3293 } |
|
3294 |
|
3295 return String::UNKNOWN; |
|
3296 |
|
3297 } // end of CharacterSetID code |
|
3298 |
|
3299 void SetIdFromName( const String & NameStatementValue) |
|
3300 { |
|
3301 // space 0 |
|
3302 // A 1 |
|
3303 // B 2 |
|
3304 // ... |
|
3305 // Z 26 |
|
3306 // |
|
3307 // ABCD corresponds to the number 4321 which becomes ( (4*27 + 3) * 27 + 2) * 27 + 1. |
|
3308 |
|
3309 if(verbose) |
|
3310 { MOFF;cout << "name_statement " << NameStatementValue << endl;MON;} |
|
3311 if ( NameStatementValue.Length() > 4) |
|
3312 { |
|
3313 ErrorHandler::OutputErrorLine( "Name must be no longer than four characters"); |
|
3314 exit( 1); |
|
3315 } |
|
3316 |
|
3317 long NewId = 0; |
|
3318 |
|
3319 for( unsigned long i = 0; i < NameStatementValue.Length(); i++) |
|
3320 { |
|
3321 NewId *= 27; |
|
3322 if ( isalpha( NameStatementValue[i]) ) |
|
3323 NewId += toupper( NameStatementValue[i]) - 'A' + 1; |
|
3324 } |
|
3325 |
|
3326 CurrentId = NewId << 12; |
|
3327 FormatIdAsHex = 1; |
|
3328 if(verbose) |
|
3329 { MOFF;cout << "Current id " << CurrentId << endl;MON;} |
|
3330 } |
|
3331 |
|
3332 void RlsUnusedWarnings() |
|
3333 { |
|
3334 TNameIndex::iterator end = pG->RlsNameIndex.end(); |
|
3335 for (TNameIndex::iterator i = pG->RlsNameIndex.begin(); i != end; ++i) |
|
3336 { |
|
3337 int index = i->second; |
|
3338 RlsValue& v = pG->RlsValues[index]; |
|
3339 if (v.iCitationCount == 0) |
|
3340 { |
|
3341 Message * message = pG->Messages.GetEntry(LT_004); |
|
3342 String fileLine = *(v.iFileName); |
|
3343 if(message->GetActivated()) |
|
3344 { |
|
3345 pGL->AddWarningToStore(fileLine, v.iLineNumber, message->GetMessageOutput()); |
|
3346 } |
|
3347 } |
|
3348 } |
|
3349 } |
|
3350 |
|
3351 int ParseSourceFile(FILE* aFile, unsigned short aYYDebug) |
|
3352 { |
|
3353 // Set up various global pointers which refer to the pG structure |
|
3354 pSHA = & (pG->SHA); |
|
3355 pFileLineHandler = & (pG->FileLineHandler); |
|
3356 pResourceNameIds = & (pG->ResourceNameIds); |
|
3357 |
|
3358 pScan = new rcscan(pG->FileLineHandler, aFile); |
|
3359 |
|
3360 yydebug = aYYDebug; |
|
3361 pCurrentLineNumber = &yylineno; |
|
3362 int ReturnValue = yyparse(); |
|
3363 |
|
3364 RlsUnusedWarnings(); |
|
3365 |
|
3366 int bScanErrorFound = pScan->ErrorWasFound(); |
|
3367 |
|
3368 delete pScan; |
|
3369 pScan = NULL; |
|
3370 |
|
3371 if(ReturnValue != 0) |
|
3372 return ReturnValue; |
|
3373 |
|
3374 if(bScanErrorFound) |
|
3375 return 1; |
|
3376 |
|
3377 return 0; // successful parse - parse tree now in the pG data structure |
|
3378 } |
|
3379 |
|
3380 |
|
3381 void CheckStructUsage() |
|
3382 { |
|
3383 ResourceItemArrayIterator nextRI( *pCurrentRIA); |
|
3384 ResourceItem * pRI; |
|
3385 while ( ( pRI = nextRI() ) != NULL) |
|
3386 { |
|
3387 int resourceItemType = pRI->GetResourceItemType(); |
|
3388 String resourceItemLabel = pRI->GetLabel(); |
|
3389 if( (resourceItemType == EStructTypeResourceItem) || (resourceItemType == EStructArrayResourceItem) ) |
|
3390 { |
|
3391 StringArrayIterator nextLabel( *pUsedLabelsArray); |
|
3392 String * pLabel; |
|
3393 bool flag = false; |
|
3394 while ( ( ( pLabel = nextLabel() ) != NULL ) && (! flag) ) |
|
3395 { |
|
3396 StringLess stringCompare; |
|
3397 if( !stringCompare(resourceItemLabel,*pLabel) && !stringCompare(*pLabel,resourceItemLabel) ) |
|
3398 { |
|
3399 flag = true; |
|
3400 } |
|
3401 } |
|
3402 if(! flag) |
|
3403 { |
|
3404 if(resourceItemType == EStructTypeResourceItem) |
|
3405 { |
|
3406 Message * message = pG->Messages.GetEntry(LT_046); |
|
3407 if(message->GetActivated()) |
|
3408 { |
|
3409 String comment = message->GetMessageOutput(); |
|
3410 comment += "'"; |
|
3411 comment += resourceItemLabel; |
|
3412 comment += "'"; |
|
3413 ErrorHandler::OutputErrorLine(comment); |
|
3414 } |
|
3415 } |
|
3416 else |
|
3417 { |
|
3418 Message * message = pG->Messages.GetEntry(LT_047); |
|
3419 if(message->GetActivated()) |
|
3420 { |
|
3421 String comment = message->GetMessageOutput(); |
|
3422 comment += "'"; |
|
3423 comment += resourceItemLabel; |
|
3424 comment += "'"; |
|
3425 ErrorHandler::OutputErrorLine(comment); |
|
3426 } |
|
3427 } |
|
3428 } |
|
3429 } |
|
3430 } |
|
3431 } |
|
3432 |
|
3433 int yywrap() |
|
3434 { |
|
3435 return 1; |
|
3436 } |
|
3437 |
|
3438 /* Called by yyparse on error */ |
|
3439 #include <stdarg.h> |
|
3440 void yyerror (const char *s, ...) |
|
3441 { |
|
3442 va_list list; |
|
3443 va_start(list, s); |
|
3444 pScan->yyerror(const_cast<char*>(s), list); |
|
3445 va_end(list); |
|
3446 } |
|
3447 |
|
3448 |
|
3449 |