|
Lines 1-9
Link Here
|
| 1 |
/* A Bison parser, made by GNU Bison 2.3. */ |
1 |
/* A Bison parser, made by GNU Bison 2.3. */ |
| 2 |
|
2 |
|
| 3 |
/* Skeleton implementation for Bison's Yacc-like parsers in C |
3 |
/* Skeleton implementation for Bison LALR(1) parsers in C++ |
| 4 |
|
4 |
|
| 5 |
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 |
5 |
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
| 6 |
Free Software Foundation, Inc. |
|
|
| 7 |
|
6 |
|
| 8 |
This program is free software; you can redistribute it and/or modify |
7 |
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 |
8 |
it under the terms of the GNU General Public License as published by |
|
Lines 33-1508
Link Here
|
| 33 |
This special exception was added by the Free Software Foundation in |
32 |
This special exception was added by the Free Software Foundation in |
| 34 |
version 2.2 of Bison. */ |
33 |
version 2.2 of Bison. */ |
| 35 |
|
34 |
|
| 36 |
/* C LALR(1) parser skeleton written by Richard Stallman, by |
35 |
// Take the name prefix into account. |
| 37 |
simplifying the original so-called "semantic" parser. */ |
36 |
#define yylex QMakelex |
| 38 |
|
37 |
|
| 39 |
/* All symbols defined below should begin with yy or YY, to avoid |
38 |
#include "qmake_yacc.hpp" |
| 40 |
infringing on user name space. This should be done even for local |
|
|
| 41 |
variables, as they might otherwise be expanded by user macros. |
| 42 |
There are some unavoidable exceptions within include files to |
| 43 |
define necessary library symbols; they are noted "INFRINGES ON |
| 44 |
USER NAME SPACE" below. */ |
| 45 |
|
| 46 |
/* Identify Bison output. */ |
| 47 |
#define YYBISON 1 |
| 48 |
|
| 49 |
/* Bison version. */ |
| 50 |
#define YYBISON_VERSION "2.3" |
| 51 |
|
| 52 |
/* Skeleton name. */ |
| 53 |
#define YYSKELETON_NAME "yacc.c" |
| 54 |
|
| 55 |
/* Pure parsers. */ |
| 56 |
#define YYPURE 0 |
| 57 |
|
| 58 |
/* Using locations. */ |
| 59 |
#define YYLSP_NEEDED 0 |
| 60 |
|
39 |
|
|
|
40 |
/* User implementation prologue. */ |
| 61 |
|
41 |
|
| 62 |
|
42 |
|
| 63 |
/* Tokens. */ |
43 |
/* Line 317 of lalr1.cc. */ |
| 64 |
#ifndef YYTOKENTYPE |
44 |
#line 45 "qmake_yacc.cpp" |
| 65 |
# define YYTOKENTYPE |
|
|
| 66 |
/* Put the tokens into the symbol table, so that GDB and other debuggers |
| 67 |
know about them. */ |
| 68 |
enum yytokentype { |
| 69 |
ID_SIMPLE = 258, |
| 70 |
EQ = 259, |
| 71 |
PLUSEQ = 260, |
| 72 |
MINUSQE = 261, |
| 73 |
STAREQ = 262, |
| 74 |
TILDEEQ = 263, |
| 75 |
LBRACE = 264, |
| 76 |
RBRACE = 265, |
| 77 |
COLON = 266, |
| 78 |
NUMSIGN = 267, |
| 79 |
NEWLINE = 268, |
| 80 |
NUMBER = 269, |
| 81 |
COMMENT = 270, |
| 82 |
CONT = 271, |
| 83 |
RCURLY = 272, |
| 84 |
LCURLY = 273, |
| 85 |
ID_ARGS = 274, |
| 86 |
LIST_COMMENT = 275, |
| 87 |
LIST_COMMENT_WITHOUT_NEWLINE = 276, |
| 88 |
QUOTED_VARIABLE_VALUE = 277, |
| 89 |
VARIABLE_VALUE = 278, |
| 90 |
INDENT = 279, |
| 91 |
LIST_WS = 280 |
| 92 |
}; |
| 93 |
#endif |
| 94 |
/* Tokens. */ |
| 95 |
#define ID_SIMPLE 258 |
| 96 |
#define EQ 259 |
| 97 |
#define PLUSEQ 260 |
| 98 |
#define MINUSQE 261 |
| 99 |
#define STAREQ 262 |
| 100 |
#define TILDEEQ 263 |
| 101 |
#define LBRACE 264 |
| 102 |
#define RBRACE 265 |
| 103 |
#define COLON 266 |
| 104 |
#define NUMSIGN 267 |
| 105 |
#define NEWLINE 268 |
| 106 |
#define NUMBER 269 |
| 107 |
#define COMMENT 270 |
| 108 |
#define CONT 271 |
| 109 |
#define RCURLY 272 |
| 110 |
#define LCURLY 273 |
| 111 |
#define ID_ARGS 274 |
| 112 |
#define LIST_COMMENT 275 |
| 113 |
#define LIST_COMMENT_WITHOUT_NEWLINE 276 |
| 114 |
#define QUOTED_VARIABLE_VALUE 277 |
| 115 |
#define VARIABLE_VALUE 278 |
| 116 |
#define INDENT 279 |
| 117 |
#define LIST_WS 280 |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
/* Copy the first part of user declarations. */ |
| 123 |
#line 1 "qmake.yy" |
| 124 |
|
| 125 |
/*************************************************************************** |
| 126 |
* Copyright (C) 2005 by Alexander Dymo * |
| 127 |
* adymo@kdevelop.org * |
| 128 |
* * |
| 129 |
* This program is free software; you can redistribute it and/or modify * |
| 130 |
* it under the terms of the GNU Library General Public License as * |
| 131 |
* published by the Free Software Foundation; either version 2 of the * |
| 132 |
* License, or (at your option) any later version. * |
| 133 |
* * |
| 134 |
* This program is distributed in the hope that it will be useful, * |
| 135 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 136 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 137 |
* GNU General Public License for more details. * |
| 138 |
* * |
| 139 |
* You should have received a copy of the GNU Library General Public * |
| 140 |
* License along with this program; if not, write to the * |
| 141 |
* Free Software Foundation, Inc., * |
| 142 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 143 |
***************************************************************************/ |
| 144 |
|
| 145 |
/** |
| 146 |
@file qmake.yy |
| 147 |
QMake Parser |
| 148 |
|
| 149 |
Simple LALR parser which builds the syntax tree (see @ref QMake::AST). |
| 150 |
|
| 151 |
@todo Recognize comments after statements like: |
| 152 |
SOURCES = foo #regognize me |
| 153 |
|
| 154 |
@fixme Parser fails on files that do not end with a newline |
| 155 |
@fixme 1 shift/reduce conflict in "line_body" rule |
| 156 |
*/ |
| 157 |
|
| 158 |
#include <qvaluestack.h> |
| 159 |
#include "qmakeast.h" |
| 160 |
#include <qregexp.h> |
| 161 |
|
| 162 |
#define YYSTYPE_IS_DECLARED |
| 163 |
|
| 164 |
using namespace QMake; |
| 165 |
|
| 166 |
/** |
| 167 |
The yylval type. |
| 168 |
*/ |
| 169 |
struct Result { |
| 170 |
Result(): node(0) {} |
| 171 |
|
| 172 |
/**Type of semantic value for simple grammar rules.*/ |
| 173 |
QString value; |
| 174 |
/**Type of semantic value for grammar rules which are parts of AST.*/ |
| 175 |
AST *node; |
| 176 |
/**Type of semantic value for "multiline_values" grammar rule. |
| 177 |
Each line of multiline value is stored as a string in the list. |
| 178 |
|
| 179 |
For example we have in .pro file: |
| 180 |
@code |
| 181 |
SOURCE = foo1.cpp \ |
| 182 |
foo2.cpp \ |
| 183 |
foo3.cpp foo4.cpp |
| 184 |
@endcode |
| 185 |
The string list will be populated with three strings: |
| 186 |
<pre> |
| 187 |
foo1.cpp |
| 188 |
foo2.cpp |
| 189 |
foo3.cpp foo4.cpp |
| 190 |
</pre> |
| 191 |
*/ |
| 192 |
QStringList values; |
| 193 |
QString indent; |
| 194 |
}; |
| 195 |
|
| 196 |
typedef Result YYSTYPE; |
| 197 |
|
| 198 |
void yyerror(const char *str) { |
| 199 |
printf("%s\n", str); |
| 200 |
} |
| 201 |
|
| 202 |
int yylex(); |
| 203 |
|
| 204 |
/** |
| 205 |
The stack to store ProjectAST pointers when a new child |
| 206 |
ProjectAST is created and filled with statements. |
| 207 |
|
| 208 |
Parser creates root ProjectAST for a .pro file, pushes it onto the stack and starts |
| 209 |
adding statements. Each statement is added as a child StatementAST to the ProjectAST |
| 210 |
currently on the top in the stack. |
| 211 |
|
| 212 |
When a scope or function scope statement is parsed, the child ProjectAST is created |
| 213 |
and pushed onto the stack. Therefore all statements which belong to the scope |
| 214 |
or function scope are added as childs to their direct parent (scope or function scope). |
| 215 |
*/ |
| 216 |
QValueStack<ProjectAST*> projects; |
| 217 |
|
| 218 |
/** |
| 219 |
The current depth of AST node is stored here. |
| 220 |
AST depth is important to know because automatic indentation can |
| 221 |
be easily implemented (the parser itself looses all information |
| 222 |
about indentation). |
| 223 |
*/ |
| 224 |
int depth = 0; |
| 225 |
|
| 226 |
/* |
| 227 |
To debug this parser, put the line below into the next bison file section. |
| 228 |
Don't forget to uncomment "yydebug = 1" line in qmakedriver.cpp. |
| 229 |
%debug |
| 230 |
*/ |
| 231 |
|
| 232 |
|
| 233 |
/* Enabling traces. */ |
| 234 |
#ifndef YYDEBUG |
| 235 |
# define YYDEBUG 0 |
| 236 |
#endif |
| 237 |
|
| 238 |
/* Enabling verbose error messages. */ |
| 239 |
#ifdef YYERROR_VERBOSE |
| 240 |
# undef YYERROR_VERBOSE |
| 241 |
# define YYERROR_VERBOSE 1 |
| 242 |
#else |
| 243 |
# define YYERROR_VERBOSE 0 |
| 244 |
#endif |
| 245 |
|
| 246 |
/* Enabling the token table. */ |
| 247 |
#ifndef YYTOKEN_TABLE |
| 248 |
# define YYTOKEN_TABLE 0 |
| 249 |
#endif |
| 250 |
|
| 251 |
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
| 252 |
typedef int YYSTYPE; |
| 253 |
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
| 254 |
# define YYSTYPE_IS_DECLARED 1 |
| 255 |
# define YYSTYPE_IS_TRIVIAL 1 |
| 256 |
#endif |
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
/* Copy the second part of user declarations. */ |
| 261 |
|
| 262 |
|
| 263 |
/* Line 216 of yacc.c. */ |
| 264 |
#line 265 "qmake_yacc.cpp" |
| 265 |
|
| 266 |
#ifdef short |
| 267 |
# undef short |
| 268 |
#endif |
| 269 |
|
| 270 |
#ifdef YYTYPE_UINT8 |
| 271 |
typedef YYTYPE_UINT8 yytype_uint8; |
| 272 |
#else |
| 273 |
typedef unsigned char yytype_uint8; |
| 274 |
#endif |
| 275 |
|
| 276 |
#ifdef YYTYPE_INT8 |
| 277 |
typedef YYTYPE_INT8 yytype_int8; |
| 278 |
#elif (defined __STDC__ || defined __C99__FUNC__ \ |
| 279 |
|| defined __cplusplus || defined _MSC_VER) |
| 280 |
typedef signed char yytype_int8; |
| 281 |
#else |
| 282 |
typedef short int yytype_int8; |
| 283 |
#endif |
| 284 |
|
| 285 |
#ifdef YYTYPE_UINT16 |
| 286 |
typedef YYTYPE_UINT16 yytype_uint16; |
| 287 |
#else |
| 288 |
typedef unsigned short int yytype_uint16; |
| 289 |
#endif |
| 290 |
|
| 291 |
#ifdef YYTYPE_INT16 |
| 292 |
typedef YYTYPE_INT16 yytype_int16; |
| 293 |
#else |
| 294 |
typedef short int yytype_int16; |
| 295 |
#endif |
| 296 |
|
| 297 |
#ifndef YYSIZE_T |
| 298 |
# ifdef __SIZE_TYPE__ |
| 299 |
# define YYSIZE_T __SIZE_TYPE__ |
| 300 |
# elif defined size_t |
| 301 |
# define YYSIZE_T size_t |
| 302 |
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ |
| 303 |
|| defined __cplusplus || defined _MSC_VER) |
| 304 |
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
| 305 |
# define YYSIZE_T size_t |
| 306 |
# else |
| 307 |
# define YYSIZE_T unsigned int |
| 308 |
# endif |
| 309 |
#endif |
| 310 |
|
| 311 |
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
| 312 |
|
45 |
|
| 313 |
#ifndef YY_ |
46 |
#ifndef YY_ |
| 314 |
# if YYENABLE_NLS |
47 |
# if YYENABLE_NLS |
| 315 |
# if ENABLE_NLS |
48 |
# if ENABLE_NLS |
| 316 |
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
49 |
# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */ |
| 317 |
# define YY_(msgid) dgettext ("bison-runtime", msgid) |
50 |
# define YY_(msgid) dgettext ("bison-runtime", msgid) |
| 318 |
# endif |
51 |
# endif |
| 319 |
# endif |
52 |
# endif |
| 320 |
# ifndef YY_ |
53 |
# ifndef YY_ |
| 321 |
# define YY_(msgid) msgid |
54 |
# define YY_(msgid) msgid |
| 322 |
# endif |
55 |
# endif |
| 323 |
#endif |
|
|
| 324 |
|
| 325 |
/* Suppress unused-variable warnings by "using" E. */ |
| 326 |
#if ! defined lint || defined __GNUC__ |
| 327 |
# define YYUSE(e) ((void) (e)) |
| 328 |
#else |
| 329 |
# define YYUSE(e) /* empty */ |
| 330 |
#endif |
| 331 |
|
| 332 |
/* Identity function, used to suppress warnings about constant conditions. */ |
| 333 |
#ifndef lint |
| 334 |
# define YYID(n) (n) |
| 335 |
#else |
| 336 |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
| 337 |
|| defined __cplusplus || defined _MSC_VER) |
| 338 |
static int |
| 339 |
YYID (int i) |
| 340 |
#else |
| 341 |
static int |
| 342 |
YYID (i) |
| 343 |
int i; |
| 344 |
#endif |
| 345 |
{ |
| 346 |
return i; |
| 347 |
} |
| 348 |
#endif |
| 349 |
|
| 350 |
#if ! defined yyoverflow || YYERROR_VERBOSE |
| 351 |
|
| 352 |
/* The parser invokes alloca or malloc; define the necessary symbols. */ |
| 353 |
|
| 354 |
# ifdef YYSTACK_USE_ALLOCA |
| 355 |
# if YYSTACK_USE_ALLOCA |
| 356 |
# ifdef __GNUC__ |
| 357 |
# define YYSTACK_ALLOC __builtin_alloca |
| 358 |
# elif defined __BUILTIN_VA_ARG_INCR |
| 359 |
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
| 360 |
# elif defined _AIX |
| 361 |
# define YYSTACK_ALLOC __alloca |
| 362 |
# elif defined _MSC_VER |
| 363 |
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
| 364 |
# define alloca _alloca |
| 365 |
# else |
| 366 |
# define YYSTACK_ALLOC alloca |
| 367 |
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
| 368 |
|| defined __cplusplus || defined _MSC_VER) |
| 369 |
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
| 370 |
# ifndef _STDLIB_H |
| 371 |
# define _STDLIB_H 1 |
| 372 |
# endif |
| 373 |
# endif |
| 374 |
# endif |
| 375 |
# endif |
| 376 |
# endif |
| 377 |
|
| 378 |
# ifdef YYSTACK_ALLOC |
| 379 |
/* Pacify GCC's `empty if-body' warning. */ |
| 380 |
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) |
| 381 |
# ifndef YYSTACK_ALLOC_MAXIMUM |
| 382 |
/* The OS might guarantee only one guard page at the bottom of the stack, |
| 383 |
and a page size can be as small as 4096 bytes. So we cannot safely |
| 384 |
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
| 385 |
to allow for a few compiler-allocated temporary stack slots. */ |
| 386 |
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
| 387 |
# endif |
| 388 |
# else |
| 389 |
# define YYSTACK_ALLOC YYMALLOC |
| 390 |
# define YYSTACK_FREE YYFREE |
| 391 |
# ifndef YYSTACK_ALLOC_MAXIMUM |
| 392 |
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
| 393 |
# endif |
| 394 |
# if (defined __cplusplus && ! defined _STDLIB_H \ |
| 395 |
&& ! ((defined YYMALLOC || defined malloc) \ |
| 396 |
&& (defined YYFREE || defined free))) |
| 397 |
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
| 398 |
# ifndef _STDLIB_H |
| 399 |
# define _STDLIB_H 1 |
| 400 |
# endif |
| 401 |
# endif |
| 402 |
# ifndef YYMALLOC |
| 403 |
# define YYMALLOC malloc |
| 404 |
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
| 405 |
|| defined __cplusplus || defined _MSC_VER) |
| 406 |
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
| 407 |
# endif |
| 408 |
# endif |
| 409 |
# ifndef YYFREE |
| 410 |
# define YYFREE free |
| 411 |
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
| 412 |
|| defined __cplusplus || defined _MSC_VER) |
| 413 |
void free (void *); /* INFRINGES ON USER NAME SPACE */ |
| 414 |
# endif |
| 415 |
# endif |
| 416 |
# endif |
| 417 |
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
| 418 |
|
| 419 |
|
| 420 |
#if (! defined yyoverflow \ |
| 421 |
&& (! defined __cplusplus \ |
| 422 |
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
| 423 |
|
| 424 |
/* A type that is properly aligned for any stack member. */ |
| 425 |
union yyalloc |
| 426 |
{ |
| 427 |
yytype_int16 yyss; |
| 428 |
YYSTYPE yyvs; |
| 429 |
}; |
| 430 |
|
| 431 |
/* The size of the maximum gap between one aligned stack and the next. */ |
| 432 |
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
| 433 |
|
| 434 |
/* The size of an array large to enough to hold all stacks, each with |
| 435 |
N elements. */ |
| 436 |
# define YYSTACK_BYTES(N) \ |
| 437 |
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ |
| 438 |
+ YYSTACK_GAP_MAXIMUM) |
| 439 |
|
| 440 |
/* Copy COUNT objects from FROM to TO. The source and destination do |
| 441 |
not overlap. */ |
| 442 |
# ifndef YYCOPY |
| 443 |
# if defined __GNUC__ && 1 < __GNUC__ |
| 444 |
# define YYCOPY(To, From, Count) \ |
| 445 |
__builtin_memcpy (To, From, (Count) * sizeof (*(From))) |
| 446 |
# else |
| 447 |
# define YYCOPY(To, From, Count) \ |
| 448 |
do \ |
| 449 |
{ \ |
| 450 |
YYSIZE_T yyi; \ |
| 451 |
for (yyi = 0; yyi < (Count); yyi++) \ |
| 452 |
(To)[yyi] = (From)[yyi]; \ |
| 453 |
} \ |
| 454 |
while (YYID (0)) |
| 455 |
# endif |
| 456 |
# endif |
| 457 |
|
| 458 |
/* Relocate STACK from its old location to the new one. The |
| 459 |
local variables YYSIZE and YYSTACKSIZE give the old and new number of |
| 460 |
elements in the stack, and YYPTR gives the new location of the |
| 461 |
stack. Advance YYPTR to a properly aligned location for the next |
| 462 |
stack. */ |
| 463 |
# define YYSTACK_RELOCATE(Stack) \ |
| 464 |
do \ |
| 465 |
{ \ |
| 466 |
YYSIZE_T yynewbytes; \ |
| 467 |
YYCOPY (&yyptr->Stack, Stack, yysize); \ |
| 468 |
Stack = &yyptr->Stack; \ |
| 469 |
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
| 470 |
yyptr += yynewbytes / sizeof (*yyptr); \ |
| 471 |
} \ |
| 472 |
while (YYID (0)) |
| 473 |
|
| 474 |
#endif |
| 475 |
|
| 476 |
/* YYFINAL -- State number of the termination state. */ |
| 477 |
#define YYFINAL 3 |
| 478 |
/* YYLAST -- Last index in YYTABLE. */ |
| 479 |
#define YYLAST 37 |
| 480 |
|
| 481 |
/* YYNTOKENS -- Number of terminals. */ |
| 482 |
#define YYNTOKENS 27 |
| 483 |
/* YYNNTS -- Number of nonterminals. */ |
| 484 |
#define YYNNTS 21 |
| 485 |
/* YYNRULES -- Number of rules. */ |
| 486 |
#define YYNRULES 44 |
| 487 |
/* YYNRULES -- Number of states. */ |
| 488 |
#define YYNSTATES 54 |
| 489 |
|
| 490 |
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
| 491 |
#define YYUNDEFTOK 2 |
| 492 |
#define YYMAXUTOK 281 |
| 493 |
|
| 494 |
#define YYTRANSLATE(YYX) \ |
| 495 |
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
| 496 |
|
| 497 |
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ |
| 498 |
static const yytype_uint8 yytranslate[] = |
| 499 |
{ |
| 500 |
0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 501 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 502 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 503 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 504 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 505 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 506 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 507 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 508 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 509 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 510 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 511 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 512 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 513 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 514 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 515 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 516 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 517 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 518 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 519 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 520 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 521 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 522 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 523 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 524 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 525 |
2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
| 526 |
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
| 527 |
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 528 |
25, 26 |
| 529 |
}; |
| 530 |
|
| 531 |
#if YYDEBUG |
| 532 |
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
| 533 |
YYRHS. */ |
| 534 |
static const yytype_uint8 yyprhs[] = |
| 535 |
{ |
| 536 |
0, 0, 3, 4, 7, 10, 11, 13, 15, 17, |
| 537 |
19, 21, 25, 29, 30, 33, 35, 37, 39, 41, |
| 538 |
43, 45, 47, 49, 50, 52, 54, 56, 58, 60, |
| 539 |
62, 64, 65, 69, 70, 78, 80, 81, 85, 88, |
| 540 |
89, 90, 96, 97, 100 |
| 541 |
}; |
| 542 |
|
| 543 |
/* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
| 544 |
static const yytype_int8 yyrhs[] = |
| 545 |
{ |
| 546 |
28, 0, -1, -1, 29, 30, -1, 30, 31, -1, |
| 547 |
-1, 32, -1, 38, -1, 40, -1, 46, -1, 47, |
| 548 |
-1, 3, 37, 33, -1, 33, 34, 35, -1, -1, |
| 549 |
34, 36, -1, 36, -1, 16, -1, 13, -1, 25, |
| 550 |
-1, 24, -1, 20, -1, 10, -1, 21, -1, -1, |
| 551 |
23, -1, 22, -1, 4, -1, 5, -1, 6, -1, |
| 552 |
7, -1, 8, -1, -1, 3, 39, 43, -1, -1, |
| 553 |
3, 9, 42, 10, 41, 43, 44, -1, 19, -1, |
| 554 |
-1, 18, 30, 17, -1, 11, 31, -1, -1, -1, |
| 555 |
26, 18, 45, 43, 17, -1, -1, 15, 13, -1, |
| 556 |
13, -1 |
| 557 |
}; |
| 558 |
|
| 559 |
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
| 560 |
static const yytype_uint16 yyrline[] = |
| 561 |
{ |
| 562 |
0, 136, 136, 136, 143, 148, 151, 155, 159, 163, |
| 563 |
167, 173, 185, 193, 200, 201, 202, 203, 204, 205, |
| 564 |
211, 212, 215, 222, 227, 228, 231, 231, 231, 231, |
| 565 |
231, 235, 234, 249, 248, 273, 274, 277, 278, 283, |
| 566 |
287, 286, 300, 305, 313 |
| 567 |
}; |
| 568 |
#endif |
| 569 |
|
| 570 |
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE |
| 571 |
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
| 572 |
First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
| 573 |
static const char *const yytname[] = |
| 574 |
{ |
| 575 |
"$end", "error", "$undefined", "ID_SIMPLE", "EQ", "PLUSEQ", "MINUSQE", |
| 576 |
"STAREQ", "TILDEEQ", "LBRACE", "RBRACE", "COLON", "NUMSIGN", "NEWLINE", |
| 577 |
"NUMBER", "COMMENT", "CONT", "RCURLY", "LCURLY", "ID_ARGS", |
| 578 |
"LIST_COMMENT", "LIST_COMMENT_WITHOUT_NEWLINE", "QUOTED_VARIABLE_VALUE", |
| 579 |
"VARIABLE_VALUE", "INDENT", "LIST_WS", "\"else\"", "$accept", "project", |
| 580 |
"@1", "statements", "statement", "variable_assignment", |
| 581 |
"multiline_values", "line_body", "opt_comment", "variable_value", |
| 582 |
"operator", "scope", "@2", "function_call", "@3", "function_args", |
| 583 |
"scope_body", "else_statement", "@4", "comment", "emptyline", 0 |
| 584 |
}; |
| 585 |
#endif |
| 586 |
|
| 587 |
# ifdef YYPRINT |
| 588 |
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to |
| 589 |
token YYLEX-NUM. */ |
| 590 |
static const yytype_uint16 yytoknum[] = |
| 591 |
{ |
| 592 |
0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
| 593 |
265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
| 594 |
275, 276, 277, 278, 279, 280, 281 |
| 595 |
}; |
| 596 |
# endif |
| 597 |
|
| 598 |
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
| 599 |
static const yytype_uint8 yyr1[] = |
| 600 |
{ |
| 601 |
0, 27, 29, 28, 30, 30, 31, 31, 31, 31, |
| 602 |
31, 32, 33, 33, 34, 34, 34, 34, 34, 34, |
| 603 |
34, 34, 35, 35, 36, 36, 37, 37, 37, 37, |
| 604 |
37, 39, 38, 41, 40, 42, 42, 43, 43, 43, |
| 605 |
45, 44, 44, 46, 47 |
| 606 |
}; |
| 607 |
|
| 608 |
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
| 609 |
static const yytype_uint8 yyr2[] = |
| 610 |
{ |
| 611 |
0, 2, 0, 2, 2, 0, 1, 1, 1, 1, |
| 612 |
1, 3, 3, 0, 2, 1, 1, 1, 1, 1, |
| 613 |
1, 1, 1, 0, 1, 1, 1, 1, 1, 1, |
| 614 |
1, 0, 3, 0, 7, 1, 0, 3, 2, 0, |
| 615 |
0, 5, 0, 2, 1 |
| 616 |
}; |
| 617 |
|
| 618 |
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state |
| 619 |
STATE-NUM when YYTABLE doesn't specify something else to do. Zero |
| 620 |
means the default is an error. */ |
| 621 |
static const yytype_uint8 yydefact[] = |
| 622 |
{ |
| 623 |
2, 0, 5, 1, 3, 31, 44, 0, 4, 6, |
| 624 |
7, 8, 9, 10, 26, 27, 28, 29, 30, 36, |
| 625 |
13, 39, 43, 35, 0, 11, 0, 5, 32, 33, |
| 626 |
21, 17, 16, 20, 25, 24, 19, 18, 23, 15, |
| 627 |
38, 0, 39, 22, 12, 14, 37, 42, 0, 34, |
| 628 |
40, 39, 0, 41 |
| 629 |
}; |
| 630 |
|
| 631 |
/* YYDEFGOTO[NTERM-NUM]. */ |
| 632 |
static const yytype_int8 yydefgoto[] = |
| 633 |
{ |
| 634 |
-1, 1, 2, 4, 8, 9, 25, 38, 44, 39, |
| 635 |
20, 10, 21, 11, 42, 24, 28, 49, 51, 12, |
| 636 |
13 |
| 637 |
}; |
| 638 |
|
| 639 |
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
| 640 |
STATE-NUM. */ |
| 641 |
#define YYPACT_NINF -41 |
| 642 |
static const yytype_int8 yypact[] = |
| 643 |
{ |
| 644 |
-41, 1, -41, -41, 5, 18, -41, -9, -41, -41, |
| 645 |
-41, -41, -41, -41, -41, -41, -41, -41, -41, -14, |
| 646 |
-41, -2, -41, -41, 21, -10, 5, -41, -41, -41, |
| 647 |
-41, -41, -41, -41, -41, -41, -41, -41, 7, -41, |
| 648 |
-41, 4, -2, -41, -41, -41, -41, 6, 15, -41, |
| 649 |
-41, -2, 17, -41 |
| 650 |
}; |
| 651 |
|
| 652 |
/* YYPGOTO[NTERM-NUM]. */ |
| 653 |
static const yytype_int8 yypgoto[] = |
| 654 |
{ |
| 655 |
-41, -41, -41, 8, 10, -41, -41, -41, -41, -1, |
| 656 |
-41, -41, -41, -41, -41, -41, -40, -41, -41, -41, |
| 657 |
-41 |
| 658 |
}; |
| 659 |
|
| 660 |
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
| 661 |
positive, shift that token. If negative, reduce the rule which |
| 662 |
number is the opposite. If zero, do what YYDEFACT says. |
| 663 |
If YYTABLE_NINF, syntax error. */ |
| 664 |
#define YYTABLE_NINF -1 |
| 665 |
static const yytype_uint8 yytable[] = |
| 666 |
{ |
| 667 |
30, 3, 47, 31, 22, 23, 32, 5, 5, 26, |
| 668 |
33, 52, 34, 35, 36, 37, 27, 6, 6, 7, |
| 669 |
7, 46, 14, 15, 16, 17, 18, 19, 43, 34, |
| 670 |
35, 29, 48, 50, 53, 41, 40, 45 |
| 671 |
}; |
| 672 |
|
| 673 |
static const yytype_uint8 yycheck[] = |
| 674 |
{ |
| 675 |
10, 0, 42, 13, 13, 19, 16, 3, 3, 11, |
| 676 |
20, 51, 22, 23, 24, 25, 18, 13, 13, 15, |
| 677 |
15, 17, 4, 5, 6, 7, 8, 9, 21, 22, |
| 678 |
23, 10, 26, 18, 17, 27, 26, 38 |
| 679 |
}; |
| 680 |
|
| 681 |
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
| 682 |
symbol of state STATE-NUM. */ |
| 683 |
static const yytype_uint8 yystos[] = |
| 684 |
{ |
| 685 |
0, 28, 29, 0, 30, 3, 13, 15, 31, 32, |
| 686 |
38, 40, 46, 47, 4, 5, 6, 7, 8, 9, |
| 687 |
37, 39, 13, 19, 42, 33, 11, 18, 43, 10, |
| 688 |
10, 13, 16, 20, 22, 23, 24, 25, 34, 36, |
| 689 |
31, 30, 41, 21, 35, 36, 17, 43, 26, 44, |
| 690 |
18, 45, 43, 17 |
| 691 |
}; |
| 692 |
|
| 693 |
#define yyerrok (yyerrstatus = 0) |
| 694 |
#define yyclearin (yychar = YYEMPTY) |
| 695 |
#define YYEMPTY (-2) |
| 696 |
#define YYEOF 0 |
| 697 |
|
| 698 |
#define YYACCEPT goto yyacceptlab |
| 699 |
#define YYABORT goto yyabortlab |
| 700 |
#define YYERROR goto yyerrorlab |
| 701 |
|
| 702 |
|
| 703 |
/* Like YYERROR except do call yyerror. This remains here temporarily |
| 704 |
to ease the transition to the new meaning of YYERROR, for GCC. |
| 705 |
Once GCC version 2 has supplanted version 1, this can go. */ |
| 706 |
|
| 707 |
#define YYFAIL goto yyerrlab |
| 708 |
|
| 709 |
#define YYRECOVERING() (!!yyerrstatus) |
| 710 |
|
| 711 |
#define YYBACKUP(Token, Value) \ |
| 712 |
do \ |
| 713 |
if (yychar == YYEMPTY && yylen == 1) \ |
| 714 |
{ \ |
| 715 |
yychar = (Token); \ |
| 716 |
yylval = (Value); \ |
| 717 |
yytoken = YYTRANSLATE (yychar); \ |
| 718 |
YYPOPSTACK (1); \ |
| 719 |
goto yybackup; \ |
| 720 |
} \ |
| 721 |
else \ |
| 722 |
{ \ |
| 723 |
yyerror (YY_("syntax error: cannot back up")); \ |
| 724 |
YYERROR; \ |
| 725 |
} \ |
| 726 |
while (YYID (0)) |
| 727 |
|
| 728 |
|
| 729 |
#define YYTERROR 1 |
| 730 |
#define YYERRCODE 256 |
| 731 |
|
| 732 |
|
| 733 |
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. |
| 734 |
If N is 0, then set CURRENT to the empty location which ends |
| 735 |
the previous symbol: RHS[0] (always defined). */ |
| 736 |
|
| 737 |
#define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
| 738 |
#ifndef YYLLOC_DEFAULT |
| 739 |
# define YYLLOC_DEFAULT(Current, Rhs, N) \ |
| 740 |
do \ |
| 741 |
if (YYID (N)) \ |
| 742 |
{ \ |
| 743 |
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ |
| 744 |
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ |
| 745 |
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \ |
| 746 |
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \ |
| 747 |
} \ |
| 748 |
else \ |
| 749 |
{ \ |
| 750 |
(Current).first_line = (Current).last_line = \ |
| 751 |
YYRHSLOC (Rhs, 0).last_line; \ |
| 752 |
(Current).first_column = (Current).last_column = \ |
| 753 |
YYRHSLOC (Rhs, 0).last_column; \ |
| 754 |
} \ |
| 755 |
while (YYID (0)) |
| 756 |
#endif |
| 757 |
|
| 758 |
|
| 759 |
/* YY_LOCATION_PRINT -- Print the location on the stream. |
| 760 |
This macro was not mandated originally: define only if we know |
| 761 |
we won't break user code: when these are the locations we know. */ |
| 762 |
|
| 763 |
#ifndef YY_LOCATION_PRINT |
| 764 |
# if YYLTYPE_IS_TRIVIAL |
| 765 |
# define YY_LOCATION_PRINT(File, Loc) \ |
| 766 |
fprintf (File, "%d.%d-%d.%d", \ |
| 767 |
(Loc).first_line, (Loc).first_column, \ |
| 768 |
(Loc).last_line, (Loc).last_column) |
| 769 |
# else |
| 770 |
# define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
| 771 |
# endif |
| 772 |
#endif |
| 773 |
|
| 774 |
|
| 775 |
/* YYLEX -- calling `yylex' with the right arguments. */ |
| 776 |
|
| 777 |
#ifdef YYLEX_PARAM |
| 778 |
# define YYLEX yylex (YYLEX_PARAM) |
| 779 |
#else |
| 780 |
# define YYLEX yylex () |
| 781 |
#endif |
| 782 |
|
| 783 |
/* Enable debugging if requested. */ |
| 784 |
#if YYDEBUG |
| 785 |
|
| 786 |
# ifndef YYFPRINTF |
| 787 |
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
| 788 |
# define YYFPRINTF fprintf |
| 789 |
# endif |
| 790 |
|
| 791 |
# define YYDPRINTF(Args) \ |
| 792 |
do { \ |
| 793 |
if (yydebug) \ |
| 794 |
YYFPRINTF Args; \ |
| 795 |
} while (YYID (0)) |
| 796 |
|
| 797 |
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
| 798 |
do { \ |
| 799 |
if (yydebug) \ |
| 800 |
{ \ |
| 801 |
YYFPRINTF (stderr, "%s ", Title); \ |
| 802 |
yy_symbol_print (stderr, \ |
| 803 |
Type, Value); \ |
| 804 |
YYFPRINTF (stderr, "\n"); \ |
| 805 |
} \ |
| 806 |
} while (YYID (0)) |
| 807 |
|
| 808 |
|
| 809 |
/*--------------------------------. |
| 810 |
| Print this symbol on YYOUTPUT. | |
| 811 |
`--------------------------------*/ |
| 812 |
|
| 813 |
/*ARGSUSED*/ |
| 814 |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
| 815 |
|| defined __cplusplus || defined _MSC_VER) |
| 816 |
static void |
| 817 |
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
| 818 |
#else |
| 819 |
static void |
| 820 |
yy_symbol_value_print (yyoutput, yytype, yyvaluep) |
| 821 |
FILE *yyoutput; |
| 822 |
int yytype; |
| 823 |
YYSTYPE const * const yyvaluep; |
| 824 |
#endif |
| 825 |
{ |
| 826 |
if (!yyvaluep) |
| 827 |
return; |
| 828 |
# ifdef YYPRINT |
| 829 |
if (yytype < YYNTOKENS) |
| 830 |
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
| 831 |
# else |
| 832 |
YYUSE (yyoutput); |
| 833 |
# endif |
| 834 |
switch (yytype) |
| 835 |
{ |
| 836 |
default: |
| 837 |
break; |
| 838 |
} |
| 839 |
} |
| 840 |
|
| 841 |
|
| 842 |
/*--------------------------------. |
| 843 |
| Print this symbol on YYOUTPUT. | |
| 844 |
`--------------------------------*/ |
| 845 |
|
| 846 |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
| 847 |
|| defined __cplusplus || defined _MSC_VER) |
| 848 |
static void |
| 849 |
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
| 850 |
#else |
| 851 |
static void |
| 852 |
yy_symbol_print (yyoutput, yytype, yyvaluep) |
| 853 |
FILE *yyoutput; |
| 854 |
int yytype; |
| 855 |
YYSTYPE const * const yyvaluep; |
| 856 |
#endif |
| 857 |
{ |
| 858 |
if (yytype < YYNTOKENS) |
| 859 |
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
| 860 |
else |
| 861 |
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
| 862 |
|
| 863 |
yy_symbol_value_print (yyoutput, yytype, yyvaluep); |
| 864 |
YYFPRINTF (yyoutput, ")"); |
| 865 |
} |
| 866 |
|
| 867 |
/*------------------------------------------------------------------. |
| 868 |
| yy_stack_print -- Print the state stack from its BOTTOM up to its | |
| 869 |
| TOP (included). | |
| 870 |
`------------------------------------------------------------------*/ |
| 871 |
|
| 872 |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
| 873 |
|| defined __cplusplus || defined _MSC_VER) |
| 874 |
static void |
| 875 |
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) |
| 876 |
#else |
| 877 |
static void |
| 878 |
yy_stack_print (bottom, top) |
| 879 |
yytype_int16 *bottom; |
| 880 |
yytype_int16 *top; |
| 881 |
#endif |
| 882 |
{ |
| 883 |
YYFPRINTF (stderr, "Stack now"); |
| 884 |
for (; bottom <= top; ++bottom) |
| 885 |
YYFPRINTF (stderr, " %d", *bottom); |
| 886 |
YYFPRINTF (stderr, "\n"); |
| 887 |
} |
| 888 |
|
| 889 |
# define YY_STACK_PRINT(Bottom, Top) \ |
| 890 |
do { \ |
| 891 |
if (yydebug) \ |
| 892 |
yy_stack_print ((Bottom), (Top)); \ |
| 893 |
} while (YYID (0)) |
| 894 |
|
| 895 |
|
| 896 |
/*------------------------------------------------. |
| 897 |
| Report that the YYRULE is going to be reduced. | |
| 898 |
`------------------------------------------------*/ |
| 899 |
|
| 900 |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
| 901 |
|| defined __cplusplus || defined _MSC_VER) |
| 902 |
static void |
| 903 |
yy_reduce_print (YYSTYPE *yyvsp, int yyrule) |
| 904 |
#else |
| 905 |
static void |
| 906 |
yy_reduce_print (yyvsp, yyrule) |
| 907 |
YYSTYPE *yyvsp; |
| 908 |
int yyrule; |
| 909 |
#endif |
| 910 |
{ |
| 911 |
int yynrhs = yyr2[yyrule]; |
| 912 |
int yyi; |
| 913 |
unsigned long int yylno = yyrline[yyrule]; |
| 914 |
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
| 915 |
yyrule - 1, yylno); |
| 916 |
/* The symbols being reduced. */ |
| 917 |
for (yyi = 0; yyi < yynrhs; yyi++) |
| 918 |
{ |
| 919 |
fprintf (stderr, " $%d = ", yyi + 1); |
| 920 |
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], |
| 921 |
&(yyvsp[(yyi + 1) - (yynrhs)]) |
| 922 |
); |
| 923 |
fprintf (stderr, "\n"); |
| 924 |
} |
| 925 |
} |
| 926 |
|
| 927 |
# define YY_REDUCE_PRINT(Rule) \ |
| 928 |
do { \ |
| 929 |
if (yydebug) \ |
| 930 |
yy_reduce_print (yyvsp, Rule); \ |
| 931 |
} while (YYID (0)) |
| 932 |
|
| 933 |
/* Nonzero means print parse trace. It is left uninitialized so that |
| 934 |
multiple parsers can coexist. */ |
| 935 |
int yydebug; |
| 936 |
#else /* !YYDEBUG */ |
| 937 |
# define YYDPRINTF(Args) |
| 938 |
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
| 939 |
# define YY_STACK_PRINT(Bottom, Top) |
| 940 |
# define YY_REDUCE_PRINT(Rule) |
| 941 |
#endif /* !YYDEBUG */ |
| 942 |
|
| 943 |
|
| 944 |
/* YYINITDEPTH -- initial size of the parser's stacks. */ |
| 945 |
#ifndef YYINITDEPTH |
| 946 |
# define YYINITDEPTH 200 |
| 947 |
#endif |
| 948 |
|
| 949 |
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
| 950 |
if the built-in stack extension method is used). |
| 951 |
|
| 952 |
Do not make this value too large; the results are undefined if |
| 953 |
YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
| 954 |
evaluated with infinite-precision integer arithmetic. */ |
| 955 |
|
| 956 |
#ifndef YYMAXDEPTH |
| 957 |
# define YYMAXDEPTH 10000 |
| 958 |
#endif |
| 959 |
|
| 960 |
|
| 961 |
|
| 962 |
#if YYERROR_VERBOSE |
| 963 |
|
| 964 |
# ifndef yystrlen |
| 965 |
# if defined __GLIBC__ && defined _STRING_H |
| 966 |
# define yystrlen strlen |
| 967 |
# else |
| 968 |
/* Return the length of YYSTR. */ |
| 969 |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
| 970 |
|| defined __cplusplus || defined _MSC_VER) |
| 971 |
static YYSIZE_T |
| 972 |
yystrlen (const char *yystr) |
| 973 |
#else |
| 974 |
static YYSIZE_T |
| 975 |
yystrlen (yystr) |
| 976 |
const char *yystr; |
| 977 |
#endif |
| 978 |
{ |
| 979 |
YYSIZE_T yylen; |
| 980 |
for (yylen = 0; yystr[yylen]; yylen++) |
| 981 |
continue; |
| 982 |
return yylen; |
| 983 |
} |
| 984 |
# endif |
| 985 |
# endif |
| 986 |
|
| 987 |
# ifndef yystpcpy |
| 988 |
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
| 989 |
# define yystpcpy stpcpy |
| 990 |
# else |
| 991 |
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
| 992 |
YYDEST. */ |
| 993 |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
| 994 |
|| defined __cplusplus || defined _MSC_VER) |
| 995 |
static char * |
| 996 |
yystpcpy (char *yydest, const char *yysrc) |
| 997 |
#else |
| 998 |
static char * |
| 999 |
yystpcpy (yydest, yysrc) |
| 1000 |
char *yydest; |
| 1001 |
const char *yysrc; |
| 1002 |
#endif |
| 1003 |
{ |
| 1004 |
char *yyd = yydest; |
| 1005 |
const char *yys = yysrc; |
| 1006 |
|
| 1007 |
while ((*yyd++ = *yys++) != '\0') |
| 1008 |
continue; |
| 1009 |
|
| 1010 |
return yyd - 1; |
| 1011 |
} |
| 1012 |
# endif |
| 1013 |
# endif |
| 1014 |
|
| 1015 |
# ifndef yytnamerr |
| 1016 |
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
| 1017 |
quotes and backslashes, so that it's suitable for yyerror. The |
| 1018 |
heuristic is that double-quoting is unnecessary unless the string |
| 1019 |
contains an apostrophe, a comma, or backslash (other than |
| 1020 |
backslash-backslash). YYSTR is taken from yytname. If YYRES is |
| 1021 |
null, do not copy; instead, return the length of what the result |
| 1022 |
would have been. */ |
| 1023 |
static YYSIZE_T |
| 1024 |
yytnamerr (char *yyres, const char *yystr) |
| 1025 |
{ |
| 1026 |
if (*yystr == '"') |
| 1027 |
{ |
| 1028 |
YYSIZE_T yyn = 0; |
| 1029 |
char const *yyp = yystr; |
| 1030 |
|
| 1031 |
for (;;) |
| 1032 |
switch (*++yyp) |
| 1033 |
{ |
| 1034 |
case '\'': |
| 1035 |
case ',': |
| 1036 |
goto do_not_strip_quotes; |
| 1037 |
|
| 1038 |
case '\\': |
| 1039 |
if (*++yyp != '\\') |
| 1040 |
goto do_not_strip_quotes; |
| 1041 |
/* Fall through. */ |
| 1042 |
default: |
| 1043 |
if (yyres) |
| 1044 |
yyres[yyn] = *yyp; |
| 1045 |
yyn++; |
| 1046 |
break; |
| 1047 |
|
| 1048 |
case '"': |
| 1049 |
if (yyres) |
| 1050 |
yyres[yyn] = '\0'; |
| 1051 |
return yyn; |
| 1052 |
} |
| 1053 |
do_not_strip_quotes: ; |
| 1054 |
} |
| 1055 |
|
| 1056 |
if (! yyres) |
| 1057 |
return yystrlen (yystr); |
| 1058 |
|
| 1059 |
return yystpcpy (yyres, yystr) - yyres; |
| 1060 |
} |
| 1061 |
# endif |
| 1062 |
|
| 1063 |
/* Copy into YYRESULT an error message about the unexpected token |
| 1064 |
YYCHAR while in state YYSTATE. Return the number of bytes copied, |
| 1065 |
including the terminating null byte. If YYRESULT is null, do not |
| 1066 |
copy anything; just return the number of bytes that would be |
| 1067 |
copied. As a special case, return 0 if an ordinary "syntax error" |
| 1068 |
message will do. Return YYSIZE_MAXIMUM if overflow occurs during |
| 1069 |
size calculation. */ |
| 1070 |
static YYSIZE_T |
| 1071 |
yysyntax_error (char *yyresult, int yystate, int yychar) |
| 1072 |
{ |
| 1073 |
int yyn = yypact[yystate]; |
| 1074 |
|
| 1075 |
if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) |
| 1076 |
return 0; |
| 1077 |
else |
| 1078 |
{ |
| 1079 |
int yytype = YYTRANSLATE (yychar); |
| 1080 |
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); |
| 1081 |
YYSIZE_T yysize = yysize0; |
| 1082 |
YYSIZE_T yysize1; |
| 1083 |
int yysize_overflow = 0; |
| 1084 |
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
| 1085 |
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
| 1086 |
int yyx; |
| 1087 |
|
| 1088 |
# if 0 |
| 1089 |
/* This is so xgettext sees the translatable formats that are |
| 1090 |
constructed on the fly. */ |
| 1091 |
YY_("syntax error, unexpected %s"); |
| 1092 |
YY_("syntax error, unexpected %s, expecting %s"); |
| 1093 |
YY_("syntax error, unexpected %s, expecting %s or %s"); |
| 1094 |
YY_("syntax error, unexpected %s, expecting %s or %s or %s"); |
| 1095 |
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); |
| 1096 |
# endif |
| 1097 |
char *yyfmt; |
| 1098 |
char const *yyf; |
| 1099 |
static char const yyunexpected[] = "syntax error, unexpected %s"; |
| 1100 |
static char const yyexpecting[] = ", expecting %s"; |
| 1101 |
static char const yyor[] = " or %s"; |
| 1102 |
char yyformat[sizeof yyunexpected |
| 1103 |
+ sizeof yyexpecting - 1 |
| 1104 |
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) |
| 1105 |
* (sizeof yyor - 1))]; |
| 1106 |
char const *yyprefix = yyexpecting; |
| 1107 |
|
| 1108 |
/* Start YYX at -YYN if negative to avoid negative indexes in |
| 1109 |
YYCHECK. */ |
| 1110 |
int yyxbegin = yyn < 0 ? -yyn : 0; |
| 1111 |
|
| 1112 |
/* Stay within bounds of both yycheck and yytname. */ |
| 1113 |
int yychecklim = YYLAST - yyn + 1; |
| 1114 |
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
| 1115 |
int yycount = 1; |
| 1116 |
|
| 1117 |
yyarg[0] = yytname[yytype]; |
| 1118 |
yyfmt = yystpcpy (yyformat, yyunexpected); |
| 1119 |
|
| 1120 |
for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
| 1121 |
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) |
| 1122 |
{ |
| 1123 |
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
| 1124 |
{ |
| 1125 |
yycount = 1; |
| 1126 |
yysize = yysize0; |
| 1127 |
yyformat[sizeof yyunexpected - 1] = '\0'; |
| 1128 |
break; |
| 1129 |
} |
| 1130 |
yyarg[yycount++] = yytname[yyx]; |
| 1131 |
yysize1 = yysize + yytnamerr (0, yytname[yyx]); |
| 1132 |
yysize_overflow |= (yysize1 < yysize); |
| 1133 |
yysize = yysize1; |
| 1134 |
yyfmt = yystpcpy (yyfmt, yyprefix); |
| 1135 |
yyprefix = yyor; |
| 1136 |
} |
| 1137 |
|
| 1138 |
yyf = YY_(yyformat); |
| 1139 |
yysize1 = yysize + yystrlen (yyf); |
| 1140 |
yysize_overflow |= (yysize1 < yysize); |
| 1141 |
yysize = yysize1; |
| 1142 |
|
| 1143 |
if (yysize_overflow) |
| 1144 |
return YYSIZE_MAXIMUM; |
| 1145 |
|
| 1146 |
if (yyresult) |
| 1147 |
{ |
| 1148 |
/* Avoid sprintf, as that infringes on the user's name space. |
| 1149 |
Don't have undefined behavior even if the translation |
| 1150 |
produced a string with the wrong number of "%s"s. */ |
| 1151 |
char *yyp = yyresult; |
| 1152 |
int yyi = 0; |
| 1153 |
while ((*yyp = *yyf) != '\0') |
| 1154 |
{ |
| 1155 |
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) |
| 1156 |
{ |
| 1157 |
yyp += yytnamerr (yyp, yyarg[yyi++]); |
| 1158 |
yyf += 2; |
| 1159 |
} |
| 1160 |
else |
| 1161 |
{ |
| 1162 |
yyp++; |
| 1163 |
yyf++; |
| 1164 |
} |
| 1165 |
} |
| 1166 |
} |
| 1167 |
return yysize; |
| 1168 |
} |
| 1169 |
} |
| 1170 |
#endif /* YYERROR_VERBOSE */ |
| 1171 |
|
| 1172 |
|
| 1173 |
/*-----------------------------------------------. |
| 1174 |
| Release the memory associated to this symbol. | |
| 1175 |
`-----------------------------------------------*/ |
| 1176 |
|
| 1177 |
/*ARGSUSED*/ |
| 1178 |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1179 |
|| defined __cplusplus || defined _MSC_VER) |
| 1180 |
static void |
| 1181 |
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) |
| 1182 |
#else |
| 1183 |
static void |
| 1184 |
yydestruct (yymsg, yytype, yyvaluep) |
| 1185 |
const char *yymsg; |
| 1186 |
int yytype; |
| 1187 |
YYSTYPE *yyvaluep; |
| 1188 |
#endif |
| 1189 |
{ |
| 1190 |
YYUSE (yyvaluep); |
| 1191 |
|
| 1192 |
if (!yymsg) |
| 1193 |
yymsg = "Deleting"; |
| 1194 |
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
| 1195 |
|
| 1196 |
switch (yytype) |
| 1197 |
{ |
| 1198 |
|
| 1199 |
default: |
| 1200 |
break; |
| 1201 |
} |
| 1202 |
} |
| 1203 |
|
| 1204 |
|
| 1205 |
/* Prevent warnings from -Wmissing-prototypes. */ |
| 1206 |
|
| 1207 |
#ifdef YYPARSE_PARAM |
| 1208 |
#if defined __STDC__ || defined __cplusplus |
| 1209 |
int yyparse (void *YYPARSE_PARAM); |
| 1210 |
#else |
| 1211 |
int yyparse (); |
| 1212 |
#endif |
| 1213 |
#else /* ! YYPARSE_PARAM */ |
| 1214 |
#if defined __STDC__ || defined __cplusplus |
| 1215 |
int yyparse (void); |
| 1216 |
#else |
| 1217 |
int yyparse (); |
| 1218 |
#endif |
| 1219 |
#endif /* ! YYPARSE_PARAM */ |
| 1220 |
|
| 1221 |
|
| 1222 |
|
| 1223 |
/* The look-ahead symbol. */ |
| 1224 |
int yychar; |
| 1225 |
|
| 1226 |
/* The semantic value of the look-ahead symbol. */ |
| 1227 |
YYSTYPE yylval; |
| 1228 |
|
| 1229 |
/* Number of syntax errors so far. */ |
| 1230 |
int yynerrs; |
| 1231 |
|
| 1232 |
|
| 1233 |
|
| 1234 |
/*----------. |
| 1235 |
| yyparse. | |
| 1236 |
`----------*/ |
| 1237 |
|
| 1238 |
#ifdef YYPARSE_PARAM |
| 1239 |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1240 |
|| defined __cplusplus || defined _MSC_VER) |
| 1241 |
int |
| 1242 |
yyparse (void *YYPARSE_PARAM) |
| 1243 |
#else |
| 1244 |
int |
| 1245 |
yyparse (YYPARSE_PARAM) |
| 1246 |
void *YYPARSE_PARAM; |
| 1247 |
#endif |
| 1248 |
#else /* ! YYPARSE_PARAM */ |
| 1249 |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1250 |
|| defined __cplusplus || defined _MSC_VER) |
| 1251 |
int |
| 1252 |
yyparse (void) |
| 1253 |
#else |
| 1254 |
int |
| 1255 |
yyparse () |
| 1256 |
|
| 1257 |
#endif |
| 1258 |
#endif |
| 1259 |
{ |
| 1260 |
|
| 1261 |
int yystate; |
| 1262 |
int yyn; |
| 1263 |
int yyresult; |
| 1264 |
/* Number of tokens to shift before error messages enabled. */ |
| 1265 |
int yyerrstatus; |
| 1266 |
/* Look-ahead token as an internal (translated) token number. */ |
| 1267 |
int yytoken = 0; |
| 1268 |
#if YYERROR_VERBOSE |
| 1269 |
/* Buffer for error messages, and its allocated size. */ |
| 1270 |
char yymsgbuf[128]; |
| 1271 |
char *yymsg = yymsgbuf; |
| 1272 |
YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
| 1273 |
#endif |
56 |
#endif |
| 1274 |
|
57 |
|
| 1275 |
/* Three stacks and their tools: |
58 |
/* Suppress unused-variable warnings by "using" E. */ |
| 1276 |
`yyss': related to states, |
59 |
#define YYUSE(e) ((void) (e)) |
| 1277 |
`yyvs': related to semantic values, |
|
|
| 1278 |
`yyls': related to locations. |
| 1279 |
|
| 1280 |
Refer to the stacks thru separate pointers, to allow yyoverflow |
| 1281 |
to reallocate them elsewhere. */ |
| 1282 |
|
60 |
|
| 1283 |
/* The state stack. */ |
61 |
/* A pseudo ostream that takes yydebug_ into account. */ |
| 1284 |
yytype_int16 yyssa[YYINITDEPTH]; |
62 |
# define YYCDEBUG \ |
| 1285 |
yytype_int16 *yyss = yyssa; |
63 |
for (bool yydebugcond_ = yydebug_; yydebugcond_; yydebugcond_ = false) \ |
| 1286 |
yytype_int16 *yyssp; |
64 |
(*yycdebug_) |
| 1287 |
|
65 |
|
| 1288 |
/* The semantic value stack. */ |
66 |
/* Enable debugging if requested. */ |
| 1289 |
YYSTYPE yyvsa[YYINITDEPTH]; |
67 |
#if YYDEBUG |
| 1290 |
YYSTYPE *yyvs = yyvsa; |
|
|
| 1291 |
YYSTYPE *yyvsp; |
| 1292 |
|
68 |
|
|
|
69 |
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
| 70 |
do { \ |
| 71 |
if (yydebug_) \ |
| 72 |
{ \ |
| 73 |
*yycdebug_ << Title << ' '; \ |
| 74 |
yy_symbol_print_ ((Type), (Value), (Location)); \ |
| 75 |
*yycdebug_ << std::endl; \ |
| 76 |
} \ |
| 77 |
} while (false) |
| 1293 |
|
78 |
|
|
|
79 |
# define YY_REDUCE_PRINT(Rule) \ |
| 80 |
do { \ |
| 81 |
if (yydebug_) \ |
| 82 |
yy_reduce_print_ (Rule); \ |
| 83 |
} while (false) |
| 1294 |
|
84 |
|
| 1295 |
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
85 |
# define YY_STACK_PRINT() \ |
|
|
86 |
do { \ |
| 87 |
if (yydebug_) \ |
| 88 |
yystack_print_ (); \ |
| 89 |
} while (false) |
| 1296 |
|
90 |
|
| 1297 |
YYSIZE_T yystacksize = YYINITDEPTH; |
91 |
#else /* !YYDEBUG */ |
| 1298 |
|
92 |
|
| 1299 |
/* The variables used to return semantic value and location from the |
93 |
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
| 1300 |
action routines. */ |
94 |
# define YY_REDUCE_PRINT(Rule) |
| 1301 |
YYSTYPE yyval; |
95 |
# define YY_STACK_PRINT() |
| 1302 |
|
96 |
|
|
|
97 |
#endif /* !YYDEBUG */ |
| 1303 |
|
98 |
|
| 1304 |
/* The number of symbols on the RHS of the reduced rule. |
99 |
#define YYACCEPT goto yyacceptlab |
| 1305 |
Keep to zero when no symbol should be popped. */ |
100 |
#define YYABORT goto yyabortlab |
| 1306 |
int yylen = 0; |
101 |
#define YYERROR goto yyerrorlab |
| 1307 |
|
102 |
|
| 1308 |
YYDPRINTF ((stderr, "Starting parse\n")); |
103 |
namespace QMake |
|
|
104 |
{ |
| 105 |
#if YYERROR_VERBOSE |
| 1309 |
|
106 |
|
| 1310 |
yystate = 0; |
107 |
/* Return YYSTR after stripping away unnecessary quotes and |
| 1311 |
yyerrstatus = 0; |
108 |
backslashes, so that it's suitable for yyerror. The heuristic is |
| 1312 |
yynerrs = 0; |
109 |
that double-quoting is unnecessary unless the string contains an |
| 1313 |
yychar = YYEMPTY; /* Cause a token to be read. */ |
110 |
apostrophe, a comma, or backslash (other than backslash-backslash). |
|
|
111 |
YYSTR is taken from yytname. */ |
| 112 |
std::string |
| 113 |
Parser::yytnamerr_ (const char *yystr) |
| 114 |
{ |
| 115 |
if (*yystr == '"') |
| 116 |
{ |
| 117 |
std::string yyr = ""; |
| 118 |
char const *yyp = yystr; |
| 1314 |
|
119 |
|
| 1315 |
/* Initialize stack pointers. |
120 |
for (;;) |
| 1316 |
Waste one element of value and location stack |
121 |
switch (*++yyp) |
| 1317 |
so that they stay on the same level as the state stack. |
122 |
{ |
| 1318 |
The wasted elements are never initialized. */ |
123 |
case '\'': |
|
|
124 |
case ',': |
| 125 |
goto do_not_strip_quotes; |
| 1319 |
|
126 |
|
| 1320 |
yyssp = yyss; |
127 |
case '\\': |
| 1321 |
yyvsp = yyvs; |
128 |
if (*++yyp != '\\') |
|
|
129 |
goto do_not_strip_quotes; |
| 130 |
/* Fall through. */ |
| 131 |
default: |
| 132 |
yyr += *yyp; |
| 133 |
break; |
| 1322 |
|
134 |
|
| 1323 |
goto yysetstate; |
135 |
case '"': |
|
|
136 |
return yyr; |
| 137 |
} |
| 138 |
do_not_strip_quotes: ; |
| 139 |
} |
| 1324 |
|
140 |
|
| 1325 |
/*------------------------------------------------------------. |
141 |
return yystr; |
| 1326 |
| yynewstate -- Push a new state, which is found in yystate. | |
142 |
} |
| 1327 |
`------------------------------------------------------------*/ |
|
|
| 1328 |
yynewstate: |
| 1329 |
/* In all cases, when you get here, the value and location stacks |
| 1330 |
have just been pushed. So pushing a state here evens the stacks. */ |
| 1331 |
yyssp++; |
| 1332 |
|
143 |
|
| 1333 |
yysetstate: |
144 |
#endif |
| 1334 |
*yyssp = yystate; |
|
|
| 1335 |
|
145 |
|
| 1336 |
if (yyss + yystacksize - 1 <= yyssp) |
146 |
/// Build a parser object. |
|
|
147 |
Parser::Parser (QMake::Lexer* lexer_yyarg, QValueStack<ProjectAST*>& projects_yyarg, int depth_yyarg) |
| 148 |
: yydebug_ (false), |
| 149 |
yycdebug_ (&std::cerr), |
| 150 |
lexer (lexer_yyarg), |
| 151 |
projects (projects_yyarg), |
| 152 |
depth (depth_yyarg) |
| 1337 |
{ |
153 |
{ |
| 1338 |
/* Get the current used size of the three stacks, in elements. */ |
154 |
} |
| 1339 |
YYSIZE_T yysize = yyssp - yyss + 1; |
|
|
| 1340 |
|
155 |
|
| 1341 |
#ifdef yyoverflow |
156 |
Parser::~Parser () |
| 1342 |
{ |
157 |
{ |
| 1343 |
/* Give user a chance to reallocate the stack. Use copies of |
158 |
} |
| 1344 |
these so that the &'s don't force the real ones into |
|
|
| 1345 |
memory. */ |
| 1346 |
YYSTYPE *yyvs1 = yyvs; |
| 1347 |
yytype_int16 *yyss1 = yyss; |
| 1348 |
|
| 1349 |
|
| 1350 |
/* Each stack pointer address is followed by the size of the |
| 1351 |
data in use in that stack, in bytes. This used to be a |
| 1352 |
conditional around just the two extra args, but that might |
| 1353 |
be undefined if yyoverflow is a macro. */ |
| 1354 |
yyoverflow (YY_("memory exhausted"), |
| 1355 |
&yyss1, yysize * sizeof (*yyssp), |
| 1356 |
&yyvs1, yysize * sizeof (*yyvsp), |
| 1357 |
|
| 1358 |
&yystacksize); |
| 1359 |
|
| 1360 |
yyss = yyss1; |
| 1361 |
yyvs = yyvs1; |
| 1362 |
} |
| 1363 |
#else /* no yyoverflow */ |
| 1364 |
# ifndef YYSTACK_RELOCATE |
| 1365 |
goto yyexhaustedlab; |
| 1366 |
# else |
| 1367 |
/* Extend the stack our own way. */ |
| 1368 |
if (YYMAXDEPTH <= yystacksize) |
| 1369 |
goto yyexhaustedlab; |
| 1370 |
yystacksize *= 2; |
| 1371 |
if (YYMAXDEPTH < yystacksize) |
| 1372 |
yystacksize = YYMAXDEPTH; |
| 1373 |
|
159 |
|
| 1374 |
{ |
160 |
#if YYDEBUG |
| 1375 |
yytype_int16 *yyss1 = yyss; |
161 |
/*--------------------------------. |
| 1376 |
union yyalloc *yyptr = |
162 |
| Print this symbol on YYOUTPUT. | |
| 1377 |
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
163 |
`--------------------------------*/ |
| 1378 |
if (! yyptr) |
164 |
|
| 1379 |
goto yyexhaustedlab; |
165 |
inline void |
| 1380 |
YYSTACK_RELOCATE (yyss); |
166 |
Parser::yy_symbol_value_print_ (int yytype, |
| 1381 |
YYSTACK_RELOCATE (yyvs); |
167 |
const semantic_type* yyvaluep, const location_type* yylocationp) |
| 1382 |
|
168 |
{ |
| 1383 |
# undef YYSTACK_RELOCATE |
169 |
YYUSE (yylocationp); |
| 1384 |
if (yyss1 != yyssa) |
170 |
YYUSE (yyvaluep); |
| 1385 |
YYSTACK_FREE (yyss1); |
171 |
switch (yytype) |
| 1386 |
} |
172 |
{ |
| 1387 |
# endif |
173 |
default: |
| 1388 |
#endif /* no yyoverflow */ |
174 |
break; |
|
|
175 |
} |
| 176 |
} |
| 177 |
|
| 1389 |
|
178 |
|
| 1390 |
yyssp = yyss + yysize - 1; |
179 |
void |
| 1391 |
yyvsp = yyvs + yysize - 1; |
180 |
Parser::yy_symbol_print_ (int yytype, |
|
|
181 |
const semantic_type* yyvaluep, const location_type* yylocationp) |
| 182 |
{ |
| 183 |
*yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") |
| 184 |
<< ' ' << yytname_[yytype] << " (" |
| 185 |
<< *yylocationp << ": "; |
| 186 |
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); |
| 187 |
*yycdebug_ << ')'; |
| 188 |
} |
| 189 |
#endif /* ! YYDEBUG */ |
| 190 |
|
| 191 |
void |
| 192 |
Parser::yydestruct_ (const char* yymsg, |
| 193 |
int yytype, semantic_type* yyvaluep, location_type* yylocationp) |
| 194 |
{ |
| 195 |
YYUSE (yylocationp); |
| 196 |
YYUSE (yymsg); |
| 197 |
YYUSE (yyvaluep); |
| 1392 |
|
198 |
|
|
|
199 |
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
| 1393 |
|
200 |
|
| 1394 |
YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
201 |
switch (yytype) |
| 1395 |
(unsigned long int) yystacksize)); |
202 |
{ |
| 1396 |
|
203 |
|
| 1397 |
if (yyss + yystacksize - 1 <= yyssp) |
204 |
default: |
| 1398 |
YYABORT; |
205 |
break; |
| 1399 |
} |
206 |
} |
|
|
207 |
} |
| 1400 |
|
208 |
|
| 1401 |
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
209 |
void |
|
|
210 |
Parser::yypop_ (unsigned int n) |
| 211 |
{ |
| 212 |
yystate_stack_.pop (n); |
| 213 |
yysemantic_stack_.pop (n); |
| 214 |
yylocation_stack_.pop (n); |
| 215 |
} |
| 216 |
|
| 217 |
std::ostream& |
| 218 |
Parser::debug_stream () const |
| 219 |
{ |
| 220 |
return *yycdebug_; |
| 221 |
} |
| 222 |
|
| 223 |
void |
| 224 |
Parser::set_debug_stream (std::ostream& o) |
| 225 |
{ |
| 226 |
yycdebug_ = &o; |
| 227 |
} |
| 228 |
|
| 229 |
|
| 230 |
Parser::debug_level_type |
| 231 |
Parser::debug_level () const |
| 232 |
{ |
| 233 |
return yydebug_; |
| 234 |
} |
| 235 |
|
| 236 |
void |
| 237 |
Parser::set_debug_level (debug_level_type l) |
| 238 |
{ |
| 239 |
yydebug_ = l; |
| 240 |
} |
| 241 |
|
| 242 |
|
| 243 |
int |
| 244 |
Parser::parse () |
| 245 |
{ |
| 246 |
/// Look-ahead and look-ahead in internal form. |
| 247 |
int yychar = yyempty_; |
| 248 |
int yytoken = 0; |
| 249 |
|
| 250 |
/* State. */ |
| 251 |
int yyn; |
| 252 |
int yylen = 0; |
| 253 |
int yystate = 0; |
| 1402 |
|
254 |
|
|
|
255 |
/* Error handling. */ |
| 256 |
int yynerrs_ = 0; |
| 257 |
int yyerrstatus_ = 0; |
| 258 |
|
| 259 |
/// Semantic value of the look-ahead. |
| 260 |
semantic_type yylval; |
| 261 |
/// Location of the look-ahead. |
| 262 |
location_type yylloc; |
| 263 |
/// The locations where the error started and ended. |
| 264 |
location yyerror_range[2]; |
| 265 |
|
| 266 |
/// $$. |
| 267 |
semantic_type yyval; |
| 268 |
/// @$. |
| 269 |
location_type yyloc; |
| 270 |
|
| 271 |
int yyresult; |
| 272 |
|
| 273 |
YYCDEBUG << "Starting parse" << std::endl; |
| 274 |
|
| 275 |
|
| 276 |
/* Initialize the stacks. The initial state will be pushed in |
| 277 |
yynewstate, since the latter expects the semantical and the |
| 278 |
location values to have been already stored, initialize these |
| 279 |
stacks with a primary value. */ |
| 280 |
yystate_stack_ = state_stack_type (0); |
| 281 |
yysemantic_stack_ = semantic_stack_type (0); |
| 282 |
yylocation_stack_ = location_stack_type (0); |
| 283 |
yysemantic_stack_.push (yylval); |
| 284 |
yylocation_stack_.push (yylloc); |
| 285 |
|
| 286 |
/* New state. */ |
| 287 |
yynewstate: |
| 288 |
yystate_stack_.push (yystate); |
| 289 |
YYCDEBUG << "Entering state " << yystate << std::endl; |
| 1403 |
goto yybackup; |
290 |
goto yybackup; |
| 1404 |
|
291 |
|
| 1405 |
/*-----------. |
292 |
/* Backup. */ |
| 1406 |
| yybackup. | |
293 |
yybackup: |
| 1407 |
`-----------*/ |
|
|
| 1408 |
yybackup: |
| 1409 |
|
| 1410 |
/* Do appropriate processing given the current state. Read a |
| 1411 |
look-ahead token if we need one and don't already have one. */ |
| 1412 |
|
| 1413 |
/* First try to decide what to do without reference to look-ahead token. */ |
| 1414 |
yyn = yypact[yystate]; |
| 1415 |
if (yyn == YYPACT_NINF) |
| 1416 |
goto yydefault; |
| 1417 |
|
294 |
|
| 1418 |
/* Not known => get a look-ahead token if don't already have one. */ |
295 |
/* Try to take a decision without look-ahead. */ |
|
|
296 |
yyn = yypact_[yystate]; |
| 297 |
if (yyn == yypact_ninf_) |
| 298 |
goto yydefault; |
| 1419 |
|
299 |
|
| 1420 |
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ |
300 |
/* Read a look-ahead token. */ |
| 1421 |
if (yychar == YYEMPTY) |
301 |
if (yychar == yyempty_) |
| 1422 |
{ |
302 |
{ |
| 1423 |
YYDPRINTF ((stderr, "Reading a token: ")); |
303 |
YYCDEBUG << "Reading a token: "; |
| 1424 |
yychar = YYLEX; |
304 |
yychar = yylex (&yylval, lexer); |
| 1425 |
} |
305 |
} |
| 1426 |
|
306 |
|
| 1427 |
if (yychar <= YYEOF) |
307 |
|
|
|
308 |
/* Convert token to internal form. */ |
| 309 |
if (yychar <= yyeof_) |
| 1428 |
{ |
310 |
{ |
| 1429 |
yychar = yytoken = YYEOF; |
311 |
yychar = yytoken = yyeof_; |
| 1430 |
YYDPRINTF ((stderr, "Now at end of input.\n")); |
312 |
YYCDEBUG << "Now at end of input." << std::endl; |
| 1431 |
} |
313 |
} |
| 1432 |
else |
314 |
else |
| 1433 |
{ |
315 |
{ |
| 1434 |
yytoken = YYTRANSLATE (yychar); |
316 |
yytoken = yytranslate_ (yychar); |
| 1435 |
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
317 |
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
| 1436 |
} |
318 |
} |
| 1437 |
|
319 |
|
| 1438 |
/* If the proper action on seeing token YYTOKEN is to reduce or to |
320 |
/* If the proper action on seeing token YYTOKEN is to reduce or to |
| 1439 |
detect an error, take that action. */ |
321 |
detect an error, take that action. */ |
| 1440 |
yyn += yytoken; |
322 |
yyn += yytoken; |
| 1441 |
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
323 |
if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) |
| 1442 |
goto yydefault; |
324 |
goto yydefault; |
| 1443 |
yyn = yytable[yyn]; |
325 |
|
|
|
326 |
/* Reduce or error. */ |
| 327 |
yyn = yytable_[yyn]; |
| 1444 |
if (yyn <= 0) |
328 |
if (yyn <= 0) |
| 1445 |
{ |
329 |
{ |
| 1446 |
if (yyn == 0 || yyn == YYTABLE_NINF) |
330 |
if (yyn == 0 || yyn == yytable_ninf_) |
| 1447 |
goto yyerrlab; |
331 |
goto yyerrlab; |
| 1448 |
yyn = -yyn; |
332 |
yyn = -yyn; |
| 1449 |
goto yyreduce; |
333 |
goto yyreduce; |
| 1450 |
} |
334 |
} |
| 1451 |
|
335 |
|
| 1452 |
if (yyn == YYFINAL) |
336 |
/* Accept? */ |
| 1453 |
YYACCEPT; |
337 |
if (yyn == yyfinal_) |
| 1454 |
|
338 |
goto yyacceptlab; |
| 1455 |
/* Count tokens shifted since error; after three, turn off error |
|
|
| 1456 |
status. */ |
| 1457 |
if (yyerrstatus) |
| 1458 |
yyerrstatus--; |
| 1459 |
|
339 |
|
| 1460 |
/* Shift the look-ahead token. */ |
340 |
/* Shift the look-ahead token. */ |
| 1461 |
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
341 |
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
| 1462 |
|
342 |
|
| 1463 |
/* Discard the shifted token unless it is eof. */ |
343 |
/* Discard the token being shifted unless it is eof. */ |
| 1464 |
if (yychar != YYEOF) |
344 |
if (yychar != yyeof_) |
| 1465 |
yychar = YYEMPTY; |
345 |
yychar = yyempty_; |
| 1466 |
|
346 |
|
| 1467 |
yystate = yyn; |
347 |
yysemantic_stack_.push (yylval); |
| 1468 |
*++yyvsp = yylval; |
348 |
yylocation_stack_.push (yylloc); |
| 1469 |
|
349 |
|
| 1470 |
goto yynewstate; |
350 |
/* Count tokens shifted since error; after three, turn off error |
| 1471 |
|
351 |
status. */ |
| 1472 |
|
352 |
if (yyerrstatus_) |
| 1473 |
/*-----------------------------------------------------------. |
353 |
--yyerrstatus_; |
| 1474 |
| yydefault -- do the default action for the current state. | |
354 |
|
| 1475 |
`-----------------------------------------------------------*/ |
355 |
yystate = yyn; |
| 1476 |
yydefault: |
356 |
goto yynewstate; |
| 1477 |
yyn = yydefact[yystate]; |
357 |
|
|
|
358 |
/*-----------------------------------------------------------. |
| 359 |
| yydefault -- do the default action for the current state. | |
| 360 |
`-----------------------------------------------------------*/ |
| 361 |
yydefault: |
| 362 |
yyn = yydefact_[yystate]; |
| 1478 |
if (yyn == 0) |
363 |
if (yyn == 0) |
| 1479 |
goto yyerrlab; |
364 |
goto yyerrlab; |
| 1480 |
goto yyreduce; |
365 |
goto yyreduce; |
| 1481 |
|
366 |
|
| 1482 |
|
367 |
/*-----------------------------. |
| 1483 |
/*-----------------------------. |
368 |
| yyreduce -- Do a reduction. | |
| 1484 |
| yyreduce -- Do a reduction. | |
369 |
`-----------------------------*/ |
| 1485 |
`-----------------------------*/ |
370 |
yyreduce: |
| 1486 |
yyreduce: |
371 |
yylen = yyr2_[yyn]; |
| 1487 |
/* yyn is the number of a rule to reduce with. */ |
|
|
| 1488 |
yylen = yyr2[yyn]; |
| 1489 |
|
| 1490 |
/* If YYLEN is nonzero, implement the default value of the action: |
372 |
/* If YYLEN is nonzero, implement the default value of the action: |
| 1491 |
`$$ = $1'. |
373 |
`$$ = $1'. Otherwise, use the top of the stack. |
| 1492 |
|
374 |
|
| 1493 |
Otherwise, the following line sets YYVAL to garbage. |
375 |
Otherwise, the following line sets YYVAL to garbage. |
| 1494 |
This behavior is undocumented and Bison |
376 |
This behavior is undocumented and Bison |
| 1495 |
users should not rely upon it. Assigning to YYVAL |
377 |
users should not rely upon it. */ |
| 1496 |
unconditionally makes the parser a bit smaller, and it avoids a |
378 |
if (yylen) |
| 1497 |
GCC warning that YYVAL may be used uninitialized. */ |
379 |
yyval = yysemantic_stack_[yylen - 1]; |
| 1498 |
yyval = yyvsp[1-yylen]; |
380 |
else |
| 1499 |
|
381 |
yyval = yysemantic_stack_[0]; |
| 1500 |
|
382 |
|
|
|
383 |
{ |
| 384 |
slice<location_type, location_stack_type> slice (yylocation_stack_, yylen); |
| 385 |
YYLLOC_DEFAULT (yyloc, slice, yylen); |
| 386 |
} |
| 1501 |
YY_REDUCE_PRINT (yyn); |
387 |
YY_REDUCE_PRINT (yyn); |
| 1502 |
switch (yyn) |
388 |
switch (yyn) |
| 1503 |
{ |
389 |
{ |
| 1504 |
case 2: |
390 |
case 2: |
| 1505 |
#line 136 "qmake.yy" |
391 |
#line 147 "qmake.yy" |
| 1506 |
{ |
392 |
{ |
| 1507 |
ProjectAST *projectAST = new ProjectAST(); |
393 |
ProjectAST *projectAST = new ProjectAST(); |
| 1508 |
projects.push(projectAST); |
394 |
projects.push(projectAST); |
|
Lines 1510-1582
Link Here
|
| 1510 |
break; |
396 |
break; |
| 1511 |
|
397 |
|
| 1512 |
case 4: |
398 |
case 4: |
| 1513 |
#line 144 "qmake.yy" |
399 |
#line 155 "qmake.yy" |
| 1514 |
{ |
400 |
{ |
| 1515 |
projects.top()->addChildAST((yyvsp[(2) - (2)].node)); |
401 |
projects.top()->addChildAST((yysemantic_stack_[(2) - (2)].node)); |
| 1516 |
(yyvsp[(2) - (2)].node)->setDepth(depth); |
402 |
(yysemantic_stack_[(2) - (2)].node)->setDepth(depth); |
| 1517 |
;} |
403 |
;} |
| 1518 |
break; |
404 |
break; |
| 1519 |
|
405 |
|
| 1520 |
case 6: |
406 |
case 6: |
| 1521 |
#line 152 "qmake.yy" |
407 |
#line 163 "qmake.yy" |
| 1522 |
{ |
408 |
{ |
| 1523 |
(yyval.node) = (yyvsp[(1) - (1)].node); |
409 |
(yyval.node) = (yysemantic_stack_[(1) - (1)].node); |
| 1524 |
;} |
410 |
;} |
| 1525 |
break; |
411 |
break; |
| 1526 |
|
412 |
|
| 1527 |
case 7: |
413 |
case 7: |
| 1528 |
#line 156 "qmake.yy" |
414 |
#line 167 "qmake.yy" |
| 1529 |
{ |
415 |
{ |
| 1530 |
(yyval.node) = (yyvsp[(1) - (1)].node); |
416 |
(yyval.node) = (yysemantic_stack_[(1) - (1)].node); |
| 1531 |
;} |
417 |
;} |
| 1532 |
break; |
418 |
break; |
| 1533 |
|
419 |
|
| 1534 |
case 8: |
420 |
case 8: |
| 1535 |
#line 160 "qmake.yy" |
421 |
#line 171 "qmake.yy" |
| 1536 |
{ |
422 |
{ |
| 1537 |
(yyval.node) = (yyvsp[(1) - (1)].node); |
423 |
(yyval.node) = (yysemantic_stack_[(1) - (1)].node); |
| 1538 |
;} |
424 |
;} |
| 1539 |
break; |
425 |
break; |
| 1540 |
|
426 |
|
| 1541 |
case 9: |
427 |
case 9: |
| 1542 |
#line 164 "qmake.yy" |
428 |
#line 175 "qmake.yy" |
| 1543 |
{ |
429 |
{ |
| 1544 |
(yyval.node) = (yyvsp[(1) - (1)].node); |
430 |
(yyval.node) = (yysemantic_stack_[(1) - (1)].node); |
| 1545 |
;} |
431 |
;} |
| 1546 |
break; |
432 |
break; |
| 1547 |
|
433 |
|
| 1548 |
case 10: |
434 |
case 10: |
| 1549 |
#line 168 "qmake.yy" |
435 |
#line 179 "qmake.yy" |
| 1550 |
{ |
436 |
{ |
| 1551 |
(yyval.node) = new NewLineAST(); |
437 |
(yyval.node) = new NewLineAST(); |
| 1552 |
;} |
438 |
;} |
| 1553 |
break; |
439 |
break; |
| 1554 |
|
440 |
|
| 1555 |
case 11: |
441 |
case 11: |
| 1556 |
#line 174 "qmake.yy" |
442 |
#line 185 "qmake.yy" |
| 1557 |
{ |
443 |
{ |
| 1558 |
AssignmentAST *node = new AssignmentAST(); |
444 |
AssignmentAST *node = new AssignmentAST(); |
| 1559 |
node->scopedID = (yyvsp[(1) - (3)].value); |
445 |
node->scopedID = (yysemantic_stack_[(3) - (1)].value); |
| 1560 |
node->op = (yyvsp[(2) - (3)].value); |
446 |
node->op = (yysemantic_stack_[(3) - (2)].value); |
| 1561 |
node->values = (yyvsp[(3) - (3)].values); |
447 |
node->values = (yysemantic_stack_[(3) - (3)].values); |
| 1562 |
node->indent = (yyvsp[(3) - (3)].indent); |
448 |
node->indent = (yysemantic_stack_[(3) - (3)].indent); |
| 1563 |
node->commentnode = (yyvsp[(3) - (3)].node); |
449 |
node->commentnode = (yysemantic_stack_[(3) - (3)].node); |
| 1564 |
(yyval.node) = node; |
450 |
(yyval.node) = node; |
| 1565 |
;} |
451 |
;} |
| 1566 |
break; |
452 |
break; |
| 1567 |
|
453 |
|
| 1568 |
case 12: |
454 |
case 12: |
| 1569 |
#line 186 "qmake.yy" |
455 |
#line 197 "qmake.yy" |
| 1570 |
{ |
456 |
{ |
| 1571 |
(yyval.values) += (yyvsp[(2) - (3)].values); |
457 |
(yyval.values) += (yysemantic_stack_[(3) - (2)].values); |
| 1572 |
if( (yyvsp[(2) - (3)].indent) != "" && (yyval.indent) == "" ) |
458 |
if( (yysemantic_stack_[(3) - (2)].indent) != "" && (yyval.indent) == "" ) |
| 1573 |
(yyval.indent) = (yyvsp[(2) - (3)].indent); |
459 |
(yyval.indent) = (yysemantic_stack_[(3) - (2)].indent); |
| 1574 |
(yyval.node) = (yyvsp[(3) - (3)].node); |
460 |
(yyval.node) = (yysemantic_stack_[(3) - (3)].node); |
| 1575 |
;} |
461 |
;} |
| 1576 |
break; |
462 |
break; |
| 1577 |
|
463 |
|
| 1578 |
case 13: |
464 |
case 13: |
| 1579 |
#line 193 "qmake.yy" |
465 |
#line 204 "qmake.yy" |
| 1580 |
{ |
466 |
{ |
| 1581 |
(yyval.values).clear(); |
467 |
(yyval.values).clear(); |
| 1582 |
(yyval.indent) = ""; |
468 |
(yyval.indent) = ""; |
|
Lines 1585-1661
Link Here
|
| 1585 |
break; |
471 |
break; |
| 1586 |
|
472 |
|
| 1587 |
case 14: |
473 |
case 14: |
| 1588 |
#line 200 "qmake.yy" |
474 |
#line 211 "qmake.yy" |
| 1589 |
{ (yyval.values).append( (yyvsp[(2) - (2)].value) ); ;} |
475 |
{ (yyval.values).append( (yysemantic_stack_[(2) - (2)].value) ); ;} |
| 1590 |
break; |
476 |
break; |
| 1591 |
|
477 |
|
| 1592 |
case 15: |
478 |
case 15: |
| 1593 |
#line 201 "qmake.yy" |
479 |
#line 212 "qmake.yy" |
| 1594 |
{ (yyval.values).append( (yyvsp[(1) - (1)].value) ); ;} |
480 |
{ (yyval.values).append( (yysemantic_stack_[(1) - (1)].value) ); ;} |
| 1595 |
break; |
481 |
break; |
| 1596 |
|
482 |
|
| 1597 |
case 16: |
483 |
case 16: |
| 1598 |
#line 202 "qmake.yy" |
484 |
#line 213 "qmake.yy" |
| 1599 |
{ (yyval.values).append("\\\n"); ;} |
485 |
{ (yyval.values).append("\\\n"); ;} |
| 1600 |
break; |
486 |
break; |
| 1601 |
|
487 |
|
| 1602 |
case 17: |
488 |
case 17: |
| 1603 |
#line 203 "qmake.yy" |
489 |
#line 214 "qmake.yy" |
| 1604 |
{ (yyval.values).append("\n"); ;} |
490 |
{ (yyval.values).append("\n"); ;} |
| 1605 |
break; |
491 |
break; |
| 1606 |
|
492 |
|
| 1607 |
case 18: |
493 |
case 18: |
| 1608 |
#line 204 "qmake.yy" |
494 |
#line 215 "qmake.yy" |
| 1609 |
{ (yyval.values).append((yyvsp[(1) - (1)].value)); ;} |
495 |
{ (yyval.values).append((yysemantic_stack_[(1) - (1)].value)); ;} |
| 1610 |
break; |
496 |
break; |
| 1611 |
|
497 |
|
| 1612 |
case 19: |
498 |
case 19: |
| 1613 |
#line 206 "qmake.yy" |
499 |
#line 217 "qmake.yy" |
| 1614 |
{ |
500 |
{ |
| 1615 |
(yyval.values).append((yyvsp[(1) - (1)].value)); |
501 |
(yyval.values).append((yysemantic_stack_[(1) - (1)].value)); |
| 1616 |
if( (yyval.indent) == "" && (yyvsp[(1) - (1)].value) != "" ) |
502 |
if( (yyval.indent) == "" && (yysemantic_stack_[(1) - (1)].value) != "" ) |
| 1617 |
(yyval.indent) = (yyvsp[(1) - (1)].value); |
503 |
(yyval.indent) = (yysemantic_stack_[(1) - (1)].value); |
| 1618 |
;} |
504 |
;} |
| 1619 |
break; |
505 |
break; |
| 1620 |
|
506 |
|
| 1621 |
case 22: |
507 |
case 22: |
| 1622 |
#line 216 "qmake.yy" |
508 |
#line 227 "qmake.yy" |
| 1623 |
{ |
509 |
{ |
| 1624 |
CommentAST* node = new CommentAST(); |
510 |
CommentAST* node = new CommentAST(); |
| 1625 |
node->comment = (yyvsp[(1) - (1)].value) + "\n"; |
511 |
node->comment = (yysemantic_stack_[(1) - (1)].value) + "\n"; |
| 1626 |
(yyval.node) = node; |
512 |
(yyval.node) = node; |
| 1627 |
;} |
513 |
;} |
| 1628 |
break; |
514 |
break; |
| 1629 |
|
515 |
|
| 1630 |
case 23: |
516 |
case 23: |
| 1631 |
#line 222 "qmake.yy" |
517 |
#line 233 "qmake.yy" |
| 1632 |
{ |
518 |
{ |
| 1633 |
(yyval.node) = 0; |
519 |
(yyval.node) = 0; |
| 1634 |
;} |
520 |
;} |
| 1635 |
break; |
521 |
break; |
| 1636 |
|
522 |
|
| 1637 |
case 24: |
523 |
case 24: |
| 1638 |
#line 227 "qmake.yy" |
524 |
#line 238 "qmake.yy" |
| 1639 |
{ (yyval.value) = (yyvsp[(1) - (1)].value); ;} |
525 |
{ (yyval.value) = (yysemantic_stack_[(1) - (1)].value); ;} |
| 1640 |
break; |
526 |
break; |
| 1641 |
|
527 |
|
| 1642 |
case 25: |
528 |
case 25: |
| 1643 |
#line 228 "qmake.yy" |
529 |
#line 239 "qmake.yy" |
| 1644 |
{ (yyval.value) = (yyvsp[(1) - (1)].value); ;} |
530 |
{ (yyval.value) = (yysemantic_stack_[(1) - (1)].value); ;} |
| 1645 |
break; |
531 |
break; |
| 1646 |
|
532 |
|
| 1647 |
case 31: |
533 |
case 31: |
| 1648 |
#line 235 "qmake.yy" |
534 |
#line 246 "qmake.yy" |
| 1649 |
{ |
535 |
{ |
| 1650 |
ProjectAST *projectAST = new ProjectAST(ProjectAST::Scope); |
536 |
ProjectAST *projectAST = new ProjectAST(ProjectAST::Scope); |
| 1651 |
projects.push(projectAST); |
537 |
projects.push(projectAST); |
| 1652 |
projects.top()->scopedID = (yyvsp[(1) - (1)].value); |
538 |
projects.top()->scopedID = (yysemantic_stack_[(1) - (1)].value); |
| 1653 |
depth++; |
539 |
depth++; |
| 1654 |
;} |
540 |
;} |
| 1655 |
break; |
541 |
break; |
| 1656 |
|
542 |
|
| 1657 |
case 32: |
543 |
case 32: |
| 1658 |
#line 242 "qmake.yy" |
544 |
#line 253 "qmake.yy" |
| 1659 |
{ |
545 |
{ |
| 1660 |
(yyval.node) = projects.pop(); |
546 |
(yyval.node) = projects.pop(); |
| 1661 |
depth--; |
547 |
depth--; |
|
Lines 1663-1681
Link Here
|
| 1663 |
break; |
549 |
break; |
| 1664 |
|
550 |
|
| 1665 |
case 33: |
551 |
case 33: |
| 1666 |
#line 249 "qmake.yy" |
552 |
#line 260 "qmake.yy" |
| 1667 |
{ |
553 |
{ |
| 1668 |
ProjectAST *projectAST = new ProjectAST(ProjectAST::FunctionScope); |
554 |
ProjectAST *projectAST = new ProjectAST(ProjectAST::FunctionScope); |
| 1669 |
projects.push(projectAST); |
555 |
projects.push(projectAST); |
| 1670 |
projects.top()->scopedID = (yyvsp[(1) - (4)].value); |
556 |
projects.top()->scopedID = (yysemantic_stack_[(4) - (1)].value); |
| 1671 |
projects.top()->args = (yyvsp[(3) - (4)].value); |
557 |
projects.top()->args = (yysemantic_stack_[(4) - (3)].value); |
| 1672 |
depth++; |
558 |
depth++; |
| 1673 |
|
559 |
|
| 1674 |
//qWarning("%s", $<value>1.ascii()); |
560 |
//qWarning("%s", $<value>1.ascii()); |
| 1675 |
if ((yyvsp[(1) - (4)].value).contains("include")) |
561 |
if ((yysemantic_stack_[(4) - (1)].value).contains("include")) |
| 1676 |
{ |
562 |
{ |
| 1677 |
IncludeAST *includeAST = new IncludeAST(); |
563 |
IncludeAST *includeAST = new IncludeAST(); |
| 1678 |
includeAST->projectName = (yyvsp[(3) - (4)].value); |
564 |
includeAST->projectName = (yysemantic_stack_[(4) - (3)].value); |
| 1679 |
projects.top()->addChildAST(includeAST); |
565 |
projects.top()->addChildAST(includeAST); |
| 1680 |
includeAST->setDepth(depth); |
566 |
includeAST->setDepth(depth); |
| 1681 |
} |
567 |
} |
|
Lines 1683-1689
Link Here
|
| 1683 |
break; |
569 |
break; |
| 1684 |
|
570 |
|
| 1685 |
case 34: |
571 |
case 34: |
| 1686 |
#line 267 "qmake.yy" |
572 |
#line 278 "qmake.yy" |
| 1687 |
{ |
573 |
{ |
| 1688 |
(yyval.node) = projects.pop(); |
574 |
(yyval.node) = projects.pop(); |
| 1689 |
depth--; |
575 |
depth--; |
|
Lines 1691-1715
Link Here
|
| 1691 |
break; |
577 |
break; |
| 1692 |
|
578 |
|
| 1693 |
case 35: |
579 |
case 35: |
| 1694 |
#line 273 "qmake.yy" |
580 |
#line 284 "qmake.yy" |
| 1695 |
{ (yyval.value) = (yyvsp[(1) - (1)].value); ;} |
581 |
{ (yyval.value) = (yysemantic_stack_[(1) - (1)].value); ;} |
| 1696 |
break; |
582 |
break; |
| 1697 |
|
583 |
|
| 1698 |
case 36: |
584 |
case 36: |
| 1699 |
#line 274 "qmake.yy" |
585 |
#line 285 "qmake.yy" |
| 1700 |
{ (yyval.value) = ""; ;} |
586 |
{ (yyval.value) = ""; ;} |
| 1701 |
break; |
587 |
break; |
| 1702 |
|
588 |
|
| 1703 |
case 38: |
589 |
case 38: |
| 1704 |
#line 279 "qmake.yy" |
590 |
#line 290 "qmake.yy" |
| 1705 |
{ |
591 |
{ |
| 1706 |
projects.top()->addChildAST((yyvsp[(2) - (2)].node)); |
592 |
projects.top()->addChildAST((yysemantic_stack_[(2) - (2)].node)); |
| 1707 |
(yyvsp[(2) - (2)].node)->setDepth(depth); |
593 |
(yysemantic_stack_[(2) - (2)].node)->setDepth(depth); |
| 1708 |
;} |
594 |
;} |
| 1709 |
break; |
595 |
break; |
| 1710 |
|
596 |
|
| 1711 |
case 40: |
597 |
case 40: |
| 1712 |
#line 287 "qmake.yy" |
598 |
#line 298 "qmake.yy" |
| 1713 |
{ |
599 |
{ |
| 1714 |
ProjectAST *projectAST = new ProjectAST(ProjectAST::FunctionScope); |
600 |
ProjectAST *projectAST = new ProjectAST(ProjectAST::FunctionScope); |
| 1715 |
projects.push(projectAST); |
601 |
projects.push(projectAST); |
|
Lines 1720-1726
Link Here
|
| 1720 |
break; |
606 |
break; |
| 1721 |
|
607 |
|
| 1722 |
case 41: |
608 |
case 41: |
| 1723 |
#line 295 "qmake.yy" |
609 |
#line 306 "qmake.yy" |
| 1724 |
{ |
610 |
{ |
| 1725 |
(yyval.node) = projects.pop(); |
611 |
(yyval.node) = projects.pop(); |
| 1726 |
depth--; |
612 |
depth--; |
|
Lines 1728-1840
Link Here
|
| 1728 |
break; |
614 |
break; |
| 1729 |
|
615 |
|
| 1730 |
case 42: |
616 |
case 42: |
| 1731 |
#line 300 "qmake.yy" |
617 |
#line 311 "qmake.yy" |
| 1732 |
{ |
618 |
{ |
| 1733 |
(yyval.node) = new ProjectAST(); |
619 |
(yyval.node) = new ProjectAST(); |
| 1734 |
;} |
620 |
;} |
| 1735 |
break; |
621 |
break; |
| 1736 |
|
622 |
|
| 1737 |
case 43: |
623 |
case 43: |
| 1738 |
#line 306 "qmake.yy" |
624 |
#line 317 "qmake.yy" |
| 1739 |
{ |
625 |
{ |
| 1740 |
CommentAST *node = new CommentAST(); |
626 |
CommentAST *node = new CommentAST(); |
| 1741 |
node->comment = (yyvsp[(1) - (2)].value) + "\n"; |
627 |
node->comment = (yysemantic_stack_[(2) - (1)].value) + "\n"; |
| 1742 |
(yyval.node) = node; |
628 |
(yyval.node) = node; |
| 1743 |
;} |
629 |
;} |
| 1744 |
break; |
630 |
break; |
| 1745 |
|
631 |
|
| 1746 |
|
632 |
|
| 1747 |
/* Line 1267 of yacc.c. */ |
633 |
/* Line 675 of lalr1.cc. */ |
| 1748 |
#line 1749 "qmake_yacc.cpp" |
634 |
#line 635 "qmake_yacc.cpp" |
| 1749 |
default: break; |
635 |
default: break; |
| 1750 |
} |
636 |
} |
| 1751 |
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
637 |
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); |
| 1752 |
|
638 |
|
| 1753 |
YYPOPSTACK (yylen); |
639 |
yypop_ (yylen); |
| 1754 |
yylen = 0; |
640 |
yylen = 0; |
| 1755 |
YY_STACK_PRINT (yyss, yyssp); |
641 |
YY_STACK_PRINT (); |
| 1756 |
|
|
|
| 1757 |
*++yyvsp = yyval; |
| 1758 |
|
| 1759 |
|
| 1760 |
/* Now `shift' the result of the reduction. Determine what state |
| 1761 |
that goes to, based on the state we popped back to and the rule |
| 1762 |
number reduced by. */ |
| 1763 |
|
642 |
|
| 1764 |
yyn = yyr1[yyn]; |
643 |
yysemantic_stack_.push (yyval); |
|
|
644 |
yylocation_stack_.push (yyloc); |
| 1765 |
|
645 |
|
| 1766 |
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
646 |
/* Shift the result of the reduction. */ |
| 1767 |
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
647 |
yyn = yyr1_[yyn]; |
| 1768 |
yystate = yytable[yystate]; |
648 |
yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0]; |
|
|
649 |
if (0 <= yystate && yystate <= yylast_ |
| 650 |
&& yycheck_[yystate] == yystate_stack_[0]) |
| 651 |
yystate = yytable_[yystate]; |
| 1769 |
else |
652 |
else |
| 1770 |
yystate = yydefgoto[yyn - YYNTOKENS]; |
653 |
yystate = yydefgoto_[yyn - yyntokens_]; |
| 1771 |
|
|
|
| 1772 |
goto yynewstate; |
654 |
goto yynewstate; |
| 1773 |
|
655 |
|
| 1774 |
|
656 |
/*------------------------------------. |
| 1775 |
/*------------------------------------. |
657 |
| yyerrlab -- here on detecting error | |
| 1776 |
| yyerrlab -- here on detecting error | |
658 |
`------------------------------------*/ |
| 1777 |
`------------------------------------*/ |
659 |
yyerrlab: |
| 1778 |
yyerrlab: |
|
|
| 1779 |
/* If not already recovering from an error, report this error. */ |
660 |
/* If not already recovering from an error, report this error. */ |
| 1780 |
if (!yyerrstatus) |
661 |
if (!yyerrstatus_) |
| 1781 |
{ |
|
|
| 1782 |
++yynerrs; |
| 1783 |
#if ! YYERROR_VERBOSE |
| 1784 |
yyerror (YY_("syntax error")); |
| 1785 |
#else |
| 1786 |
{ |
| 1787 |
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); |
| 1788 |
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) |
| 1789 |
{ |
662 |
{ |
| 1790 |
YYSIZE_T yyalloc = 2 * yysize; |
663 |
++yynerrs_; |
| 1791 |
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) |
664 |
error (yylloc, yysyntax_error_ (yystate)); |
| 1792 |
yyalloc = YYSTACK_ALLOC_MAXIMUM; |
|
|
| 1793 |
if (yymsg != yymsgbuf) |
| 1794 |
YYSTACK_FREE (yymsg); |
| 1795 |
yymsg = (char *) YYSTACK_ALLOC (yyalloc); |
| 1796 |
if (yymsg) |
| 1797 |
yymsg_alloc = yyalloc; |
| 1798 |
else |
| 1799 |
{ |
| 1800 |
yymsg = yymsgbuf; |
| 1801 |
yymsg_alloc = sizeof yymsgbuf; |
| 1802 |
} |
| 1803 |
} |
| 1804 |
|
| 1805 |
if (0 < yysize && yysize <= yymsg_alloc) |
| 1806 |
{ |
| 1807 |
(void) yysyntax_error (yymsg, yystate, yychar); |
| 1808 |
yyerror (yymsg); |
| 1809 |
} |
| 1810 |
else |
| 1811 |
{ |
| 1812 |
yyerror (YY_("syntax error")); |
| 1813 |
if (yysize != 0) |
| 1814 |
goto yyexhaustedlab; |
| 1815 |
} |
665 |
} |
| 1816 |
} |
|
|
| 1817 |
#endif |
| 1818 |
} |
| 1819 |
|
| 1820 |
|
| 1821 |
|
666 |
|
| 1822 |
if (yyerrstatus == 3) |
667 |
yyerror_range[0] = yylloc; |
|
|
668 |
if (yyerrstatus_ == 3) |
| 1823 |
{ |
669 |
{ |
| 1824 |
/* If just tried and failed to reuse look-ahead token after an |
670 |
/* If just tried and failed to reuse look-ahead token after an |
| 1825 |
error, discard it. */ |
671 |
error, discard it. */ |
| 1826 |
|
672 |
|
| 1827 |
if (yychar <= YYEOF) |
673 |
if (yychar <= yyeof_) |
| 1828 |
{ |
674 |
{ |
| 1829 |
/* Return failure if at end of input. */ |
675 |
/* Return failure if at end of input. */ |
| 1830 |
if (yychar == YYEOF) |
676 |
if (yychar == yyeof_) |
| 1831 |
YYABORT; |
677 |
YYABORT; |
| 1832 |
} |
678 |
} |
| 1833 |
else |
679 |
else |
| 1834 |
{ |
680 |
{ |
| 1835 |
yydestruct ("Error: discarding", |
681 |
yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); |
| 1836 |
yytoken, &yylval); |
682 |
yychar = yyempty_; |
| 1837 |
yychar = YYEMPTY; |
|
|
| 1838 |
} |
683 |
} |
| 1839 |
} |
684 |
} |
| 1840 |
|
685 |
|
|
Lines 1843-1966
Link Here
|
| 1843 |
goto yyerrlab1; |
688 |
goto yyerrlab1; |
| 1844 |
|
689 |
|
| 1845 |
|
690 |
|
| 1846 |
/*---------------------------------------------------. |
691 |
/*---------------------------------------------------. |
| 1847 |
| yyerrorlab -- error raised explicitly by YYERROR. | |
692 |
| yyerrorlab -- error raised explicitly by YYERROR. | |
| 1848 |
`---------------------------------------------------*/ |
693 |
`---------------------------------------------------*/ |
| 1849 |
yyerrorlab: |
694 |
yyerrorlab: |
| 1850 |
|
695 |
|
| 1851 |
/* Pacify compilers like GCC when the user code never invokes |
696 |
/* Pacify compilers like GCC when the user code never invokes |
| 1852 |
YYERROR and the label yyerrorlab therefore never appears in user |
697 |
YYERROR and the label yyerrorlab therefore never appears in user |
| 1853 |
code. */ |
698 |
code. */ |
| 1854 |
if (/*CONSTCOND*/ 0) |
699 |
if (false) |
| 1855 |
goto yyerrorlab; |
700 |
goto yyerrorlab; |
| 1856 |
|
701 |
|
|
|
702 |
yyerror_range[0] = yylocation_stack_[yylen - 1]; |
| 1857 |
/* Do not reclaim the symbols of the rule which action triggered |
703 |
/* Do not reclaim the symbols of the rule which action triggered |
| 1858 |
this YYERROR. */ |
704 |
this YYERROR. */ |
| 1859 |
YYPOPSTACK (yylen); |
705 |
yypop_ (yylen); |
| 1860 |
yylen = 0; |
706 |
yylen = 0; |
| 1861 |
YY_STACK_PRINT (yyss, yyssp); |
707 |
yystate = yystate_stack_[0]; |
| 1862 |
yystate = *yyssp; |
|
|
| 1863 |
goto yyerrlab1; |
708 |
goto yyerrlab1; |
| 1864 |
|
709 |
|
| 1865 |
|
710 |
/*-------------------------------------------------------------. |
| 1866 |
/*-------------------------------------------------------------. |
711 |
| yyerrlab1 -- common code for both syntax error and YYERROR. | |
| 1867 |
| yyerrlab1 -- common code for both syntax error and YYERROR. | |
712 |
`-------------------------------------------------------------*/ |
| 1868 |
`-------------------------------------------------------------*/ |
713 |
yyerrlab1: |
| 1869 |
yyerrlab1: |
714 |
yyerrstatus_ = 3; /* Each real token shifted decrements this. */ |
| 1870 |
yyerrstatus = 3; /* Each real token shifted decrements this. */ |
|
|
| 1871 |
|
715 |
|
| 1872 |
for (;;) |
716 |
for (;;) |
| 1873 |
{ |
717 |
{ |
| 1874 |
yyn = yypact[yystate]; |
718 |
yyn = yypact_[yystate]; |
| 1875 |
if (yyn != YYPACT_NINF) |
719 |
if (yyn != yypact_ninf_) |
| 1876 |
{ |
720 |
{ |
| 1877 |
yyn += YYTERROR; |
721 |
yyn += yyterror_; |
| 1878 |
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
722 |
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) |
| 1879 |
{ |
723 |
{ |
| 1880 |
yyn = yytable[yyn]; |
724 |
yyn = yytable_[yyn]; |
| 1881 |
if (0 < yyn) |
725 |
if (0 < yyn) |
| 1882 |
break; |
726 |
break; |
| 1883 |
} |
727 |
} |
| 1884 |
} |
728 |
} |
| 1885 |
|
729 |
|
| 1886 |
/* Pop the current state because it cannot handle the error token. */ |
730 |
/* Pop the current state because it cannot handle the error token. */ |
| 1887 |
if (yyssp == yyss) |
731 |
if (yystate_stack_.height () == 1) |
| 1888 |
YYABORT; |
732 |
YYABORT; |
| 1889 |
|
733 |
|
|
|
734 |
yyerror_range[0] = yylocation_stack_[0]; |
| 735 |
yydestruct_ ("Error: popping", |
| 736 |
yystos_[yystate], |
| 737 |
&yysemantic_stack_[0], &yylocation_stack_[0]); |
| 738 |
yypop_ (); |
| 739 |
yystate = yystate_stack_[0]; |
| 740 |
YY_STACK_PRINT (); |
| 741 |
} |
| 1890 |
|
742 |
|
| 1891 |
yydestruct ("Error: popping", |
743 |
if (yyn == yyfinal_) |
| 1892 |
yystos[yystate], yyvsp); |
744 |
goto yyacceptlab; |
| 1893 |
YYPOPSTACK (1); |
|
|
| 1894 |
yystate = *yyssp; |
| 1895 |
YY_STACK_PRINT (yyss, yyssp); |
| 1896 |
} |
| 1897 |
|
| 1898 |
if (yyn == YYFINAL) |
| 1899 |
YYACCEPT; |
| 1900 |
|
| 1901 |
*++yyvsp = yylval; |
| 1902 |
|
745 |
|
|
|
746 |
yyerror_range[1] = yylloc; |
| 747 |
// Using YYLLOC is tempting, but would change the location of |
| 748 |
// the look-ahead. YYLOC is available though. |
| 749 |
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); |
| 750 |
yysemantic_stack_.push (yylval); |
| 751 |
yylocation_stack_.push (yyloc); |
| 1903 |
|
752 |
|
| 1904 |
/* Shift the error token. */ |
753 |
/* Shift the error token. */ |
| 1905 |
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
754 |
YY_SYMBOL_PRINT ("Shifting", yystos_[yyn], |
|
|
755 |
&yysemantic_stack_[0], &yylocation_stack_[0]); |
| 1906 |
|
756 |
|
| 1907 |
yystate = yyn; |
757 |
yystate = yyn; |
| 1908 |
goto yynewstate; |
758 |
goto yynewstate; |
| 1909 |
|
759 |
|
| 1910 |
|
760 |
/* Accept. */ |
| 1911 |
/*-------------------------------------. |
761 |
yyacceptlab: |
| 1912 |
| yyacceptlab -- YYACCEPT comes here. | |
|
|
| 1913 |
`-------------------------------------*/ |
| 1914 |
yyacceptlab: |
| 1915 |
yyresult = 0; |
762 |
yyresult = 0; |
| 1916 |
goto yyreturn; |
763 |
goto yyreturn; |
| 1917 |
|
764 |
|
| 1918 |
/*-----------------------------------. |
765 |
/* Abort. */ |
| 1919 |
| yyabortlab -- YYABORT comes here. | |
766 |
yyabortlab: |
| 1920 |
`-----------------------------------*/ |
|
|
| 1921 |
yyabortlab: |
| 1922 |
yyresult = 1; |
767 |
yyresult = 1; |
| 1923 |
goto yyreturn; |
768 |
goto yyreturn; |
| 1924 |
|
769 |
|
| 1925 |
#ifndef yyoverflow |
770 |
yyreturn: |
| 1926 |
/*-------------------------------------------------. |
771 |
if (yychar != yyeof_ && yychar != yyempty_) |
| 1927 |
| yyexhaustedlab -- memory exhaustion comes here. | |
772 |
yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); |
| 1928 |
`-------------------------------------------------*/ |
|
|
| 1929 |
yyexhaustedlab: |
| 1930 |
yyerror (YY_("memory exhausted")); |
| 1931 |
yyresult = 2; |
| 1932 |
/* Fall through. */ |
| 1933 |
#endif |
| 1934 |
|
773 |
|
| 1935 |
yyreturn: |
|
|
| 1936 |
if (yychar != YYEOF && yychar != YYEMPTY) |
| 1937 |
yydestruct ("Cleanup: discarding lookahead", |
| 1938 |
yytoken, &yylval); |
| 1939 |
/* Do not reclaim the symbols of the rule which action triggered |
774 |
/* Do not reclaim the symbols of the rule which action triggered |
| 1940 |
this YYABORT or YYACCEPT. */ |
775 |
this YYABORT or YYACCEPT. */ |
| 1941 |
YYPOPSTACK (yylen); |
776 |
yypop_ (yylen); |
| 1942 |
YY_STACK_PRINT (yyss, yyssp); |
777 |
while (yystate_stack_.height () != 1) |
| 1943 |
while (yyssp != yyss) |
778 |
{ |
| 1944 |
{ |
779 |
yydestruct_ ("Cleanup: popping", |
| 1945 |
yydestruct ("Cleanup: popping", |
780 |
yystos_[yystate_stack_[0]], |
| 1946 |
yystos[*yyssp], yyvsp); |
781 |
&yysemantic_stack_[0], |
| 1947 |
YYPOPSTACK (1); |
782 |
&yylocation_stack_[0]); |
| 1948 |
} |
783 |
yypop_ (); |
| 1949 |
#ifndef yyoverflow |
784 |
} |
| 1950 |
if (yyss != yyssa) |
785 |
|
| 1951 |
YYSTACK_FREE (yyss); |
786 |
return yyresult; |
| 1952 |
#endif |
787 |
} |
|
|
788 |
|
| 789 |
// Generate an error message. |
| 790 |
std::string |
| 791 |
Parser::yysyntax_error_ (int yystate) |
| 792 |
{ |
| 793 |
std::string res; |
| 794 |
YYUSE (yystate); |
| 1953 |
#if YYERROR_VERBOSE |
795 |
#if YYERROR_VERBOSE |
| 1954 |
if (yymsg != yymsgbuf) |
796 |
int yyn = yypact_[yystate]; |
| 1955 |
YYSTACK_FREE (yymsg); |
797 |
if (yypact_ninf_ < yyn && yyn <= yylast_) |
|
|
798 |
{ |
| 799 |
/* Start YYX at -YYN if negative to avoid negative indexes in |
| 800 |
YYCHECK. */ |
| 801 |
int yyxbegin = yyn < 0 ? -yyn : 0; |
| 802 |
|
| 803 |
/* Stay within bounds of both yycheck and yytname. */ |
| 804 |
int yychecklim = yylast_ - yyn + 1; |
| 805 |
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; |
| 806 |
int count = 0; |
| 807 |
for (int x = yyxbegin; x < yyxend; ++x) |
| 808 |
if (yycheck_[x + yyn] == x && x != yyterror_) |
| 809 |
++count; |
| 810 |
|
| 811 |
// FIXME: This method of building the message is not compatible |
| 812 |
// with internationalization. It should work like yacc.c does it. |
| 813 |
// That is, first build a string that looks like this: |
| 814 |
// "syntax error, unexpected %s or %s or %s" |
| 815 |
// Then, invoke YY_ on this string. |
| 816 |
// Finally, use the string as a format to output |
| 817 |
// yytname_[tok], etc. |
| 818 |
// Until this gets fixed, this message appears in English only. |
| 819 |
res = "syntax error, unexpected "; |
| 820 |
res += yytnamerr_ (yytname_[tok]); |
| 821 |
if (count < 5) |
| 822 |
{ |
| 823 |
count = 0; |
| 824 |
for (int x = yyxbegin; x < yyxend; ++x) |
| 825 |
if (yycheck_[x + yyn] == x && x != yyterror_) |
| 826 |
{ |
| 827 |
res += (!count++) ? ", expecting " : " or "; |
| 828 |
res += yytnamerr_ (yytname_[x]); |
| 829 |
} |
| 830 |
} |
| 831 |
} |
| 832 |
else |
| 1956 |
#endif |
833 |
#endif |
| 1957 |
/* Make sure YYID is used. */ |
834 |
res = YY_("syntax error"); |
| 1958 |
return YYID (yyresult); |
835 |
return res; |
| 1959 |
} |
836 |
} |
| 1960 |
|
837 |
|
| 1961 |
|
838 |
|
| 1962 |
#line 316 "qmake.yy" |
839 |
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
|
|
840 |
STATE-NUM. */ |
| 841 |
const signed char Parser::yypact_ninf_ = -41; |
| 842 |
const signed char |
| 843 |
Parser::yypact_[] = |
| 844 |
{ |
| 845 |
-41, 1, -41, -41, 5, 18, -41, -9, -41, -41, |
| 846 |
-41, -41, -41, -41, -41, -41, -41, -41, -41, -14, |
| 847 |
-41, -2, -41, -41, 21, -10, 5, -41, -41, -41, |
| 848 |
-41, -41, -41, -41, -41, -41, -41, -41, 7, -41, |
| 849 |
-41, 4, -2, -41, -41, -41, -41, 6, 15, -41, |
| 850 |
-41, -2, 17, -41 |
| 851 |
}; |
| 852 |
|
| 853 |
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE |
| 854 |
doesn't specify something else to do. Zero means the default is an |
| 855 |
error. */ |
| 856 |
const unsigned char |
| 857 |
Parser::yydefact_[] = |
| 858 |
{ |
| 859 |
2, 0, 5, 1, 3, 31, 44, 0, 4, 6, |
| 860 |
7, 8, 9, 10, 26, 27, 28, 29, 30, 36, |
| 861 |
13, 39, 43, 35, 0, 11, 0, 5, 32, 33, |
| 862 |
21, 17, 16, 20, 25, 24, 19, 18, 23, 15, |
| 863 |
38, 0, 39, 22, 12, 14, 37, 42, 0, 34, |
| 864 |
40, 39, 0, 41 |
| 865 |
}; |
| 866 |
|
| 867 |
/* YYPGOTO[NTERM-NUM]. */ |
| 868 |
const signed char |
| 869 |
Parser::yypgoto_[] = |
| 870 |
{ |
| 871 |
-41, -41, -41, 8, 10, -41, -41, -41, -41, -1, |
| 872 |
-41, -41, -41, -41, -41, -41, -40, -41, -41, -41, |
| 873 |
-41 |
| 874 |
}; |
| 875 |
|
| 876 |
/* YYDEFGOTO[NTERM-NUM]. */ |
| 877 |
const signed char |
| 878 |
Parser::yydefgoto_[] = |
| 879 |
{ |
| 880 |
-1, 1, 2, 4, 8, 9, 25, 38, 44, 39, |
| 881 |
20, 10, 21, 11, 42, 24, 28, 49, 51, 12, |
| 882 |
13 |
| 883 |
}; |
| 884 |
|
| 885 |
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
| 886 |
positive, shift that token. If negative, reduce the rule which |
| 887 |
number is the opposite. If zero, do what YYDEFACT says. */ |
| 888 |
const signed char Parser::yytable_ninf_ = -1; |
| 889 |
const unsigned char |
| 890 |
Parser::yytable_[] = |
| 891 |
{ |
| 892 |
30, 3, 47, 31, 22, 23, 32, 5, 5, 26, |
| 893 |
33, 52, 34, 35, 36, 37, 27, 6, 6, 7, |
| 894 |
7, 46, 14, 15, 16, 17, 18, 19, 43, 34, |
| 895 |
35, 29, 48, 50, 53, 41, 40, 45 |
| 896 |
}; |
| 897 |
|
| 898 |
/* YYCHECK. */ |
| 899 |
const unsigned char |
| 900 |
Parser::yycheck_[] = |
| 901 |
{ |
| 902 |
10, 0, 42, 13, 13, 19, 16, 3, 3, 11, |
| 903 |
20, 51, 22, 23, 24, 25, 18, 13, 13, 15, |
| 904 |
15, 17, 4, 5, 6, 7, 8, 9, 21, 22, |
| 905 |
23, 10, 26, 18, 17, 27, 26, 38 |
| 906 |
}; |
| 907 |
|
| 908 |
/* STOS_[STATE-NUM] -- The (internal number of the) accessing |
| 909 |
symbol of state STATE-NUM. */ |
| 910 |
const unsigned char |
| 911 |
Parser::yystos_[] = |
| 912 |
{ |
| 913 |
0, 28, 29, 0, 30, 3, 13, 15, 31, 32, |
| 914 |
38, 40, 46, 47, 4, 5, 6, 7, 8, 9, |
| 915 |
37, 39, 13, 19, 42, 33, 11, 18, 43, 10, |
| 916 |
10, 13, 16, 20, 22, 23, 24, 25, 34, 36, |
| 917 |
31, 30, 41, 21, 35, 36, 17, 43, 26, 44, |
| 918 |
18, 45, 43, 17 |
| 919 |
}; |
| 920 |
|
| 921 |
#if YYDEBUG |
| 922 |
/* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding |
| 923 |
to YYLEX-NUM. */ |
| 924 |
const unsigned short int |
| 925 |
Parser::yytoken_number_[] = |
| 926 |
{ |
| 927 |
0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
| 928 |
265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
| 929 |
275, 276, 277, 278, 279, 280, 281 |
| 930 |
}; |
| 931 |
#endif |
| 932 |
|
| 933 |
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
| 934 |
const unsigned char |
| 935 |
Parser::yyr1_[] = |
| 936 |
{ |
| 937 |
0, 27, 29, 28, 30, 30, 31, 31, 31, 31, |
| 938 |
31, 32, 33, 33, 34, 34, 34, 34, 34, 34, |
| 939 |
34, 34, 35, 35, 36, 36, 37, 37, 37, 37, |
| 940 |
37, 39, 38, 41, 40, 42, 42, 43, 43, 43, |
| 941 |
45, 44, 44, 46, 47 |
| 942 |
}; |
| 943 |
|
| 944 |
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
| 945 |
const unsigned char |
| 946 |
Parser::yyr2_[] = |
| 947 |
{ |
| 948 |
0, 2, 0, 2, 2, 0, 1, 1, 1, 1, |
| 949 |
1, 3, 3, 0, 2, 1, 1, 1, 1, 1, |
| 950 |
1, 1, 1, 0, 1, 1, 1, 1, 1, 1, |
| 951 |
1, 0, 3, 0, 7, 1, 0, 3, 2, 0, |
| 952 |
0, 5, 0, 2, 1 |
| 953 |
}; |
| 954 |
|
| 955 |
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE |
| 956 |
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
| 957 |
First, the terminals, then, starting at \a yyntokens_, nonterminals. */ |
| 958 |
const char* |
| 959 |
const Parser::yytname_[] = |
| 960 |
{ |
| 961 |
"$end", "error", "$undefined", "ID_SIMPLE", "EQ", "PLUSEQ", "MINUSEQ", |
| 962 |
"STAREQ", "TILDEEQ", "LBRACE", "RBRACE", "COLON", "NUMSIGN", "NEWLINE", |
| 963 |
"NUMBER", "COMMENT", "CONT", "RCURLY", "LCURLY", "ID_ARGS", |
| 964 |
"LIST_COMMENT", "LIST_COMMENT_WITHOUT_NEWLINE", "QUOTED_VARIABLE_VALUE", |
| 965 |
"VARIABLE_VALUE", "INDENT", "LIST_WS", "\"else\"", "$accept", "project", |
| 966 |
"@1", "statements", "statement", "variable_assignment", |
| 967 |
"multiline_values", "line_body", "opt_comment", "variable_value", |
| 968 |
"operator", "scope", "@2", "function_call", "@3", "function_args", |
| 969 |
"scope_body", "else_statement", "@4", "comment", "emptyline", 0 |
| 970 |
}; |
| 971 |
#endif |
| 972 |
|
| 973 |
#if YYDEBUG |
| 974 |
/* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
| 975 |
const Parser::rhs_number_type |
| 976 |
Parser::yyrhs_[] = |
| 977 |
{ |
| 978 |
28, 0, -1, -1, 29, 30, -1, 30, 31, -1, |
| 979 |
-1, 32, -1, 38, -1, 40, -1, 46, -1, 47, |
| 980 |
-1, 3, 37, 33, -1, 33, 34, 35, -1, -1, |
| 981 |
34, 36, -1, 36, -1, 16, -1, 13, -1, 25, |
| 982 |
-1, 24, -1, 20, -1, 10, -1, 21, -1, -1, |
| 983 |
23, -1, 22, -1, 4, -1, 5, -1, 6, -1, |
| 984 |
7, -1, 8, -1, -1, 3, 39, 43, -1, -1, |
| 985 |
3, 9, 42, 10, 41, 43, 44, -1, 19, -1, |
| 986 |
-1, 18, 30, 17, -1, 11, 31, -1, -1, -1, |
| 987 |
26, 18, 45, 43, 17, -1, -1, 15, 13, -1, |
| 988 |
13, -1 |
| 989 |
}; |
| 990 |
|
| 991 |
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
| 992 |
YYRHS. */ |
| 993 |
const unsigned char |
| 994 |
Parser::yyprhs_[] = |
| 995 |
{ |
| 996 |
0, 0, 3, 4, 7, 10, 11, 13, 15, 17, |
| 997 |
19, 21, 25, 29, 30, 33, 35, 37, 39, 41, |
| 998 |
43, 45, 47, 49, 50, 52, 54, 56, 58, 60, |
| 999 |
62, 64, 65, 69, 70, 78, 80, 81, 85, 88, |
| 1000 |
89, 90, 96, 97, 100 |
| 1001 |
}; |
| 1002 |
|
| 1003 |
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
| 1004 |
const unsigned short int |
| 1005 |
Parser::yyrline_[] = |
| 1006 |
{ |
| 1007 |
0, 147, 147, 147, 154, 159, 162, 166, 170, 174, |
| 1008 |
178, 184, 196, 204, 211, 212, 213, 214, 215, 216, |
| 1009 |
222, 223, 226, 233, 238, 239, 242, 242, 242, 242, |
| 1010 |
242, 246, 245, 260, 259, 284, 285, 288, 289, 294, |
| 1011 |
298, 297, 311, 316, 324 |
| 1012 |
}; |
| 1013 |
|
| 1014 |
// Print the state stack on the debug stream. |
| 1015 |
void |
| 1016 |
Parser::yystack_print_ () |
| 1017 |
{ |
| 1018 |
*yycdebug_ << "Stack now"; |
| 1019 |
for (state_stack_type::const_iterator i = yystate_stack_.begin (); |
| 1020 |
i != yystate_stack_.end (); ++i) |
| 1021 |
*yycdebug_ << ' ' << *i; |
| 1022 |
*yycdebug_ << std::endl; |
| 1023 |
} |
| 1024 |
|
| 1025 |
// Report on the debug stream that the rule \a yyrule is going to be reduced. |
| 1026 |
void |
| 1027 |
Parser::yy_reduce_print_ (int yyrule) |
| 1028 |
{ |
| 1029 |
unsigned int yylno = yyrline_[yyrule]; |
| 1030 |
int yynrhs = yyr2_[yyrule]; |
| 1031 |
/* Print the symbols being reduced, and their result. */ |
| 1032 |
*yycdebug_ << "Reducing stack by rule " << yyrule - 1 |
| 1033 |
<< " (line " << yylno << "), "; |
| 1034 |
/* The symbols being reduced. */ |
| 1035 |
for (int yyi = 0; yyi < yynrhs; yyi++) |
| 1036 |
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", |
| 1037 |
yyrhs_[yyprhs_[yyrule] + yyi], |
| 1038 |
&(yysemantic_stack_[(yynrhs) - (yyi + 1)]), |
| 1039 |
&(yylocation_stack_[(yynrhs) - (yyi + 1)])); |
| 1040 |
} |
| 1041 |
#endif // YYDEBUG |
| 1042 |
|
| 1043 |
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
| 1044 |
Parser::token_number_type |
| 1045 |
Parser::yytranslate_ (int t) |
| 1046 |
{ |
| 1047 |
static |
| 1048 |
const token_number_type |
| 1049 |
translate_table[] = |
| 1050 |
{ |
| 1051 |
0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1052 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1053 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1054 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1055 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1056 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1057 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1058 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1059 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1060 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1061 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1062 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1063 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1064 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1065 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1066 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1067 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1068 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1069 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1070 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1071 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1072 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1073 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1074 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1075 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 1076 |
2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
| 1077 |
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
| 1078 |
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 1079 |
25, 26 |
| 1080 |
}; |
| 1081 |
if ((unsigned int) t <= yyuser_token_number_max_) |
| 1082 |
return translate_table[t]; |
| 1083 |
else |
| 1084 |
return yyundef_token_; |
| 1085 |
} |
| 1086 |
|
| 1087 |
const int Parser::yyeof_ = 0; |
| 1088 |
const int Parser::yylast_ = 37; |
| 1089 |
const int Parser::yynnts_ = 21; |
| 1090 |
const int Parser::yyempty_ = -2; |
| 1091 |
const int Parser::yyfinal_ = 3; |
| 1092 |
const int Parser::yyterror_ = 1; |
| 1093 |
const int Parser::yyerrcode_ = 256; |
| 1094 |
const int Parser::yyntokens_ = 27; |
| 1963 |
|
1095 |
|
|
|
1096 |
const unsigned int Parser::yyuser_token_number_max_ = 281; |
| 1097 |
const Parser::token_number_type Parser::yyundef_token_ = 2; |
| 1964 |
|
1098 |
|
| 1965 |
#include "qmake_lex.cpp" |
1099 |
} // namespace QMake |
|
|
1100 |
|
| 1101 |
#line 327 "qmake.yy" |
| 1102 |
|
| 1103 |
|
| 1104 |
|
| 1105 |
namespace QMake |
| 1106 |
{ |
| 1107 |
void Parser::error(const location_type& /*l*/, const std::string& m) |
| 1108 |
{ |
| 1109 |
std::cerr << m << std::endl; |
| 1110 |
} |
| 1111 |
} |
| 1966 |
|
1112 |
|