• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop AutoTools Parser
 

KDevelop AutoTools Parser

  • buildtools
  • lib
  • parsers
  • autotools
autotools_yacc.cpp
1/* A Bison parser, made by GNU Bison 1.875d. */
2
3/* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
20
21/* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
25
26/* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
28
29/* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
35
36/* Identify Bison output. */
37#define YYBISON 1
38
39/* Skeleton name. */
40#define YYSKELETON_NAME "yacc.c"
41
42/* Pure parsers. */
43#define YYPURE 0
44
45/* Using locations. */
46#define YYLSP_NEEDED 0
47
48
49
50/* Tokens. */
51#ifndef YYTOKENTYPE
52# define YYTOKENTYPE
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
54 know about them. */
55 enum yytokentype {
56 ID_SIMPLE = 258,
57 ID_LIST = 259,
58 LBRACE = 260,
59 EQ = 261,
60 PLUSEQ = 262,
61 MINUSQE = 263,
62 STAREQ = 264,
63 TILDEEQ = 265,
64 RBRACE = 266,
65 COLON = 267,
66 NUMSIGN = 268,
67 NEWLINE = 269,
68 NUMBER = 270,
69 COMMENT = 271,
70 CONT = 272,
71 DOT = 273,
72 RCURLY = 274,
73 LCURLY = 275,
74 ID_ARGS = 276,
75 LIST_COMMENT = 277,
76 ID_LIST_SINGLE = 278,
77 IF_KEYWORD = 279,
78 ELSE_KEYWORD = 280,
79 ENDIF_KEYWORD = 281,
80 KEYWORD = 282,
81 RULE = 283
82 };
83#endif
84#define ID_SIMPLE 258
85#define ID_LIST 259
86#define LBRACE 260
87#define EQ 261
88#define PLUSEQ 262
89#define MINUSQE 263
90#define STAREQ 264
91#define TILDEEQ 265
92#define RBRACE 266
93#define COLON 267
94#define NUMSIGN 268
95#define NEWLINE 269
96#define NUMBER 270
97#define COMMENT 271
98#define CONT 272
99#define DOT 273
100#define RCURLY 274
101#define LCURLY 275
102#define ID_ARGS 276
103#define LIST_COMMENT 277
104#define ID_LIST_SINGLE 278
105#define IF_KEYWORD 279
106#define ELSE_KEYWORD 280
107#define ENDIF_KEYWORD 281
108#define KEYWORD 282
109#define RULE 283
110
111
112
113
114/* Copy the first part of user declarations. */
115#line 1 "autotools.yy"
116
117/***************************************************************************
118 * Copyright (C) 2005 by Alexander Dymo *
119 * adymo@kdevelop.org *
120 * *
121 * Copyright (c) 2005 by Matt Rogers *
122 * mattr@kde.org *
123 * *
124 * This program is free software; you can redistribute it and/or modify *
125 * it under the terms of the GNU Library General Public License as *
126 * published by the Free Software Foundation; either version 2 of the *
127 * License, or (at your option) any later version. *
128 * *
129 * This program is distributed in the hope that it will be useful, *
130 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
131 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
132 * GNU General Public License for more details. *
133 * *
134 * You should have received a copy of the GNU Library General Public *
135 * License along with this program; if not, write to the *
136 * Free Software Foundation, Inc., *
137 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
138 ***************************************************************************/
139
152
153#include <tqvaluestack.h>
154#include "autotoolsast.h"
155
156#define YYSTYPE_IS_DECLARED
157
158using namespace AutoTools;
159
163struct Result {
164 Result(): node(0) {}
165
167 TQString value;
169 AST *node;
186 TQStringList values;
187};
188
189typedef Result YYSTYPE;
190
191void yyerror(const char *str) {
192 printf("bison error: %s\n", str);
193}
194
195int yylex();
196
209TQValueStack<ProjectAST*> projects;
210
217int depth = 0;
218
219/*
220To debug this parser, put the line below into the next bison file section.
221Don't forget to uncomment "yydebug = 1" line in qmakedriver.cpp.
222%debug
223*/
224
225
226/* Enabling traces. */
227#ifndef YYDEBUG
228# define YYDEBUG 0
229#endif
230
231/* Enabling verbose error messages. */
232#ifdef YYERROR_VERBOSE
233# undef YYERROR_VERBOSE
234# define YYERROR_VERBOSE 1
235#else
236# define YYERROR_VERBOSE 0
237#endif
238
239#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
240typedef int YYSTYPE;
241# define yystype YYSTYPE /* obsolescent; will be withdrawn */
242# define YYSTYPE_IS_DECLARED 1
243# define YYSTYPE_IS_TRIVIAL 1
244#endif
245
246
247
248/* Copy the second part of user declarations. */
249
250
251/* Line 214 of yacc.c. */
252#line 253 "autotools_yacc.cpp"
253
254#if ! defined (yyoverflow) || YYERROR_VERBOSE
255
256# ifndef YYFREE
257# define YYFREE free
258# endif
259# ifndef YYMALLOC
260# define YYMALLOC malloc
261# endif
262
263/* The parser invokes alloca or malloc; define the necessary symbols. */
264
265# ifdef YYSTACK_USE_ALLOCA
266# if YYSTACK_USE_ALLOCA
267# define YYSTACK_ALLOC alloca
268# endif
269# else
270# if defined (alloca) || defined (_ALLOCA_H)
271# define YYSTACK_ALLOC alloca
272# else
273# ifdef __GNUC__
274# define YYSTACK_ALLOC __builtin_alloca
275# endif
276# endif
277# endif
278
279# ifdef YYSTACK_ALLOC
280 /* Pacify GCC's `empty if-body' warning. */
281# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
282# else
283# if defined (__STDC__) || defined (__cplusplus)
284# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
285# define YYSIZE_T size_t
286# endif
287# define YYSTACK_ALLOC YYMALLOC
288# define YYSTACK_FREE YYFREE
289# endif
290#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
291
292
293#if (! defined (yyoverflow) \
294 && (! defined (__cplusplus) \
295 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
296
297/* A type that is properly aligned for any stack member. */
298union yyalloc
299{
300 short int yyss;
301 YYSTYPE yyvs;
302 };
303
304/* The size of the maximum gap between one aligned stack and the next. */
305# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
306
307/* The size of an array large to enough to hold all stacks, each with
308 N elements. */
309# define YYSTACK_BYTES(N) \
310 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
311 + YYSTACK_GAP_MAXIMUM)
312
313/* Copy COUNT objects from FROM to TO. The source and destination do
314 not overlap. */
315# ifndef YYCOPY
316# if defined (__GNUC__) && 1 < __GNUC__
317# define YYCOPY(To, From, Count) \
318 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
319# else
320# define YYCOPY(To, From, Count) \
321 do \
322 { \
323 YYSIZE_T yyi; \
324 for (yyi = 0; yyi < (Count); yyi++) \
325 (To)[yyi] = (From)[yyi]; \
326 } \
327 while (0)
328# endif
329# endif
330
331/* Relocate STACK from its old location to the new one. The
332 local variables YYSIZE and YYSTACKSIZE give the old and new number of
333 elements in the stack, and YYPTR gives the new location of the
334 stack. Advance YYPTR to a properly aligned location for the next
335 stack. */
336# define YYSTACK_RELOCATE(Stack) \
337 do \
338 { \
339 YYSIZE_T yynewbytes; \
340 YYCOPY (&yyptr->Stack, Stack, yysize); \
341 Stack = &yyptr->Stack; \
342 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
343 yyptr += yynewbytes / sizeof (*yyptr); \
344 } \
345 while (0)
346
347#endif
348
349#if defined (__STDC__) || defined (__cplusplus)
350 typedef signed char yysigned_char;
351#else
352 typedef short int yysigned_char;
353#endif
354
355/* YYFINAL -- State number of the termination state. */
356#define YYFINAL 3
357/* YYLAST -- Last index in YYTABLE. */
358#define YYLAST 33
359
360/* YYNTOKENS -- Number of terminals. */
361#define YYNTOKENS 29
362/* YYNNTS -- Number of nonterminals. */
363#define YYNNTS 18
364/* YYNRULES -- Number of rules. */
365#define YYNRULES 35
366/* YYNRULES -- Number of states. */
367#define YYNSTATES 43
368
369/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
370#define YYUNDEFTOK 2
371#define YYMAXUTOK 283
372
373#define YYTRANSLATE(YYX) \
374 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
375
376/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
377static const unsigned char yytranslate[] =
378{
379 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
380 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
381 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
398 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
404 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
405 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
406 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
407 25, 26, 27, 28
408};
409
410#if YYDEBUG
411/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
412 YYRHS. */
413static const unsigned char yyprhs[] =
414{
415 0, 0, 3, 4, 7, 10, 11, 13, 15, 17,
416 19, 21, 23, 25, 27, 29, 32, 34, 37, 39,
417 42, 46, 49, 51, 54, 55, 58, 61, 63, 65,
418 69, 71, 74, 76, 78, 81
419};
420
421/* YYRHS -- A `-1'-separated list of the rules' RHS. */
422static const yysigned_char yyrhs[] =
423{
424 30, 0, -1, -1, 31, 32, -1, 32, 33, -1,
425 -1, 37, -1, 34, -1, 36, -1, 35, -1, 41,
426 -1, 42, -1, 43, -1, 45, -1, 46, -1, 24,
427 38, -1, 26, -1, 26, 38, -1, 25, -1, 25,
428 38, -1, 38, 44, 39, -1, 3, 38, -1, 3,
429 -1, 39, 40, -1, -1, 4, 17, -1, 23, 14,
430 -1, 17, -1, 22, -1, 38, 12, 39, -1, 28,
431 -1, 27, 38, -1, 6, -1, 7, -1, 16, 14,
432 -1, 14, -1
433};
434
435/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
436static const unsigned short int yyrline[] =
437{
438 0, 142, 142, 142, 149, 175, 178, 182, 186, 190,
439 194, 198, 202, 206, 210, 216, 224, 230, 239, 245,
440 254, 264, 266, 269, 273, 276, 277, 278, 279, 282,
441 291, 299, 308, 308, 311, 319
442};
443#endif
444
445#if YYDEBUG || YYERROR_VERBOSE
446/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
447 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
448static const char *const yytname[] =
449{
450 "$end", "error", "$undefined", "ID_SIMPLE", "ID_LIST", "LBRACE", "EQ",
451 "PLUSEQ", "MINUSQE", "STAREQ", "TILDEEQ", "RBRACE", "COLON", "NUMSIGN",
452 "NEWLINE", "NUMBER", "COMMENT", "CONT", "DOT", "RCURLY", "LCURLY",
453 "ID_ARGS", "LIST_COMMENT", "ID_LIST_SINGLE", "IF_KEYWORD",
454 "ELSE_KEYWORD", "ENDIF_KEYWORD", "KEYWORD", "RULE", "$accept", "project",
455 "@1", "statements", "statement", "automake_if", "endif_statement",
456 "else_statement", "variable_assignment", "scoped_identifier",
457 "multiline_values", "line_body", "target", "am_rule",
458 "include_directive", "operator", "comment", "emptyline", 0
459};
460#endif
461
462# ifdef YYPRINT
463/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
464 token YYLEX-NUM. */
465static const unsigned short int yytoknum[] =
466{
467 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
468 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
469 275, 276, 277, 278, 279, 280, 281, 282, 283
470};
471# endif
472
473/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
474static const unsigned char yyr1[] =
475{
476 0, 29, 31, 30, 32, 32, 33, 33, 33, 33,
477 33, 33, 33, 33, 33, 34, 35, 35, 36, 36,
478 37, 38, 38, 39, 39, 40, 40, 40, 40, 41,
479 42, 43, 44, 44, 45, 46
480};
481
482/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
483static const unsigned char yyr2[] =
484{
485 0, 2, 0, 2, 2, 0, 1, 1, 1, 1,
486 1, 1, 1, 1, 1, 2, 1, 2, 1, 2,
487 3, 2, 1, 2, 0, 2, 2, 1, 1, 3,
488 1, 2, 1, 1, 2, 1
489};
490
491/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
492 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
493 means the default is an error. */
494static const unsigned char yydefact[] =
495{
496 2, 0, 5, 1, 3, 22, 35, 0, 0, 18,
497 16, 0, 30, 4, 7, 9, 8, 6, 0, 10,
498 11, 12, 13, 14, 21, 34, 15, 19, 17, 31,
499 32, 33, 24, 24, 29, 20, 0, 27, 28, 0,
500 23, 25, 26
501};
502
503/* YYDEFGOTO[NTERM-NUM]. */
504static const yysigned_char yydefgoto[] =
505{
506 -1, 1, 2, 4, 13, 14, 15, 16, 17, 18,
507 34, 40, 19, 20, 21, 33, 22, 23
508};
509
510/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
511 STATE-NUM. */
512#define YYPACT_NINF -18
513static const yysigned_char yypact[] =
514{
515 -18, 2, -18, -18, -3, 0, -18, -6, 0, 0,
516 0, 0, -18, -18, -18, -18, -18, -18, 3, -18,
517 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
518 -18, -18, -18, -18, 10, 10, -5, -18, -18, 4,
519 -18, -18, -18
520};
521
522/* YYPGOTO[NTERM-NUM]. */
523static const yysigned_char yypgoto[] =
524{
525 -18, -18, -18, -18, -18, -18, -18, -18, -18, -4,
526 -17, -18, -18, -18, -18, -18, -18, -18
527};
528
529/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
530 positive, shift that token. If negative, reduce the rule which
531 number is the opposite. If zero, do what YYDEFACT says.
532 If YYTABLE_NINF, syntax error. */
533#define YYTABLE_NINF -1
534static const unsigned char yytable[] =
535{
536 5, 24, 3, 5, 26, 27, 28, 29, 25, 30,
537 31, 6, 41, 7, 36, 32, 35, 0, 42, 0,
538 0, 8, 9, 10, 11, 12, 0, 37, 0, 0,
539 0, 0, 38, 39
540};
541
542static const yysigned_char yycheck[] =
543{
544 3, 5, 0, 3, 8, 9, 10, 11, 14, 6,
545 7, 14, 17, 16, 4, 12, 33, -1, 14, -1,
546 -1, 24, 25, 26, 27, 28, -1, 17, -1, -1,
547 -1, -1, 22, 23
548};
549
550/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
551 symbol of state STATE-NUM. */
552static const unsigned char yystos[] =
553{
554 0, 30, 31, 0, 32, 3, 14, 16, 24, 25,
555 26, 27, 28, 33, 34, 35, 36, 37, 38, 41,
556 42, 43, 45, 46, 38, 14, 38, 38, 38, 38,
557 6, 7, 12, 44, 39, 39, 4, 17, 22, 23,
558 40, 17, 14
559};
560
561#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
562# define YYSIZE_T __SIZE_TYPE__
563#endif
564#if ! defined (YYSIZE_T) && defined (size_t)
565# define YYSIZE_T size_t
566#endif
567#if ! defined (YYSIZE_T)
568# if defined (__STDC__) || defined (__cplusplus)
569# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
570# define YYSIZE_T size_t
571# endif
572#endif
573#if ! defined (YYSIZE_T)
574# define YYSIZE_T unsigned int
575#endif
576
577#define yyerrok (yyerrstatus = 0)
578#define yyclearin (yychar = YYEMPTY)
579#define YYEMPTY (-2)
580#define YYEOF 0
581
582#define YYACCEPT goto yyacceptlab
583#define YYABORT goto yyabortlab
584#define YYERROR goto yyerrorlab
585
586
587/* Like YYERROR except do call yyerror. This remains here temporarily
588 to ease the transition to the new meaning of YYERROR, for GCC.
589 Once GCC version 2 has supplanted version 1, this can go. */
590
591#define YYFAIL goto yyerrlab
592
593#define YYRECOVERING() (!!yyerrstatus)
594
595#define YYBACKUP(Token, Value) \
596do \
597 if (yychar == YYEMPTY && yylen == 1) \
598 { \
599 yychar = (Token); \
600 yylval = (Value); \
601 yytoken = YYTRANSLATE (yychar); \
602 YYPOPSTACK; \
603 goto yybackup; \
604 } \
605 else \
606 { \
607 yyerror ("syntax error: cannot back up");\
608 YYERROR; \
609 } \
610while (0)
611
612#define YYTERROR 1
613#define YYERRCODE 256
614
615/* YYLLOC_DEFAULT -- Compute the default location (before the actions
616 are run). */
617
618#ifndef YYLLOC_DEFAULT
619# define YYLLOC_DEFAULT(Current, Rhs, N) \
620 ((Current).first_line = (Rhs)[1].first_line, \
621 (Current).first_column = (Rhs)[1].first_column, \
622 (Current).last_line = (Rhs)[N].last_line, \
623 (Current).last_column = (Rhs)[N].last_column)
624#endif
625
626/* YYLEX -- calling `yylex' with the right arguments. */
627
628#ifdef YYLEX_PARAM
629# define YYLEX yylex (YYLEX_PARAM)
630#else
631# define YYLEX yylex ()
632#endif
633
634/* Enable debugging if requested. */
635#if YYDEBUG
636
637# ifndef YYFPRINTF
638# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
639# define YYFPRINTF fprintf
640# endif
641
642# define YYDPRINTF(Args) \
643do { \
644 if (yydebug) \
645 YYFPRINTF Args; \
646} while (0)
647
648# define YYDSYMPRINT(Args) \
649do { \
650 if (yydebug) \
651 yysymprint Args; \
652} while (0)
653
654# define YYDSYMPRINTF(Title, Token, Value, Location) \
655do { \
656 if (yydebug) \
657 { \
658 YYFPRINTF (stderr, "%s ", Title); \
659 yysymprint (stderr, \
660 Token, Value); \
661 YYFPRINTF (stderr, "\n"); \
662 } \
663} while (0)
664
665/*------------------------------------------------------------------.
666| yy_stack_print -- Print the state stack from its BOTTOM up to its |
667| TOP (included). |
668`------------------------------------------------------------------*/
669
670#if defined (__STDC__) || defined (__cplusplus)
671static void
672yy_stack_print (short int *bottom, short int *top)
673#else
674static void
675yy_stack_print (bottom, top)
676 short int *bottom;
677 short int *top;
678#endif
679{
680 YYFPRINTF (stderr, "Stack now");
681 for (/* Nothing. */; bottom <= top; ++bottom)
682 YYFPRINTF (stderr, " %d", *bottom);
683 YYFPRINTF (stderr, "\n");
684}
685
686# define YY_STACK_PRINT(Bottom, Top) \
687do { \
688 if (yydebug) \
689 yy_stack_print ((Bottom), (Top)); \
690} while (0)
691
692
693/*------------------------------------------------.
694| Report that the YYRULE is going to be reduced. |
695`------------------------------------------------*/
696
697#if defined (__STDC__) || defined (__cplusplus)
698static void
699yy_reduce_print (int yyrule)
700#else
701static void
702yy_reduce_print (yyrule)
703 int yyrule;
704#endif
705{
706 int yyi;
707 unsigned int yylno = yyrline[yyrule];
708 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
709 yyrule - 1, yylno);
710 /* Print the symbols being reduced, and their result. */
711 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
712 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
713 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
714}
715
716# define YY_REDUCE_PRINT(Rule) \
717do { \
718 if (yydebug) \
719 yy_reduce_print (Rule); \
720} while (0)
721
722/* Nonzero means print parse trace. It is left uninitialized so that
723 multiple parsers can coexist. */
724int yydebug;
725#else /* !YYDEBUG */
726# define YYDPRINTF(Args)
727# define YYDSYMPRINT(Args)
728# define YYDSYMPRINTF(Title, Token, Value, Location)
729# define YY_STACK_PRINT(Bottom, Top)
730# define YY_REDUCE_PRINT(Rule)
731#endif /* !YYDEBUG */
732
733
734/* YYINITDEPTH -- initial size of the parser's stacks. */
735#ifndef YYINITDEPTH
736# define YYINITDEPTH 200
737#endif
738
739/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
740 if the built-in stack extension method is used).
741
742 Do not make this value too large; the results are undefined if
743 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
744 evaluated with infinite-precision integer arithmetic. */
745
746#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
747# undef YYMAXDEPTH
748#endif
749
750#ifndef YYMAXDEPTH
751# define YYMAXDEPTH 10000
752#endif
753
754␌
755
756#if YYERROR_VERBOSE
757
758# ifndef yystrlen
759# if defined (__GLIBC__) && defined (_STRING_H)
760# define yystrlen strlen
761# else
762/* Return the length of YYSTR. */
763static YYSIZE_T
764# if defined (__STDC__) || defined (__cplusplus)
765yystrlen (const char *yystr)
766# else
767yystrlen (yystr)
768 const char *yystr;
769# endif
770{
771 const char *yys = yystr;
772
773 while (*yys++ != '\0')
774 continue;
775
776 return yys - yystr - 1;
777}
778# endif
779# endif
780
781# ifndef yystpcpy
782# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
783# define yystpcpy stpcpy
784# else
785/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
786 YYDEST. */
787static char *
788# if defined (__STDC__) || defined (__cplusplus)
789yystpcpy (char *yydest, const char *yysrc)
790# else
791yystpcpy (yydest, yysrc)
792 char *yydest;
793 const char *yysrc;
794# endif
795{
796 char *yyd = yydest;
797 const char *yys = yysrc;
798
799 while ((*yyd++ = *yys++) != '\0')
800 continue;
801
802 return yyd - 1;
803}
804# endif
805# endif
806
807#endif /* !YYERROR_VERBOSE */
808
809␌
810
811#if YYDEBUG
812/*--------------------------------.
813| Print this symbol on YYOUTPUT. |
814`--------------------------------*/
815
816#if defined (__STDC__) || defined (__cplusplus)
817static void
818yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
819#else
820static void
821yysymprint (yyoutput, yytype, yyvaluep)
822 FILE *yyoutput;
823 int yytype;
824 YYSTYPE *yyvaluep;
825#endif
826{
827 /* Pacify ``unused variable'' warnings. */
828 (void) yyvaluep;
829
830 if (yytype < YYNTOKENS)
831 {
832 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
833# ifdef YYPRINT
834 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
835# endif
836 }
837 else
838 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
839
840 switch (yytype)
841 {
842 default:
843 break;
844 }
845 YYFPRINTF (yyoutput, ")");
846}
847
848#endif /* ! YYDEBUG */
849/*-----------------------------------------------.
850| Release the memory associated to this symbol. |
851`-----------------------------------------------*/
852
853#if defined (__STDC__) || defined (__cplusplus)
854static void
855yydestruct (int yytype, YYSTYPE *yyvaluep)
856#else
857static void
858yydestruct (yytype, yyvaluep)
859 int yytype;
860 YYSTYPE *yyvaluep;
861#endif
862{
863 /* Pacify ``unused variable'' warnings. */
864 (void) yyvaluep;
865
866 switch (yytype)
867 {
868
869 default:
870 break;
871 }
872}
873␌
874
875/* Prevent warnings from -Wmissing-prototypes. */
876
877#ifdef YYPARSE_PARAM
878# if defined (__STDC__) || defined (__cplusplus)
879int yyparse (void *YYPARSE_PARAM);
880# else
881int yyparse ();
882# endif
883#else /* ! YYPARSE_PARAM */
884#if defined (__STDC__) || defined (__cplusplus)
885int yyparse (void);
886#else
887int yyparse ();
888#endif
889#endif /* ! YYPARSE_PARAM */
890
891
892
893/* The lookahead symbol. */
894int yychar;
895
896/* The semantic value of the lookahead symbol. */
897YYSTYPE yylval;
898
899/* Number of syntax errors so far. */
900int yynerrs;
901
902
903
904/*----------.
905| yyparse. |
906`----------*/
907
908#ifdef YYPARSE_PARAM
909# if defined (__STDC__) || defined (__cplusplus)
910int yyparse (void *YYPARSE_PARAM)
911# else
912int yyparse (YYPARSE_PARAM)
913 void *YYPARSE_PARAM;
914# endif
915#else /* ! YYPARSE_PARAM */
916#if defined (__STDC__) || defined (__cplusplus)
917int
918yyparse (void)
919#else
920int
921yyparse ()
922
923#endif
924#endif
925{
926
927 int yystate;
928 int yyn;
929 int yyresult;
930 /* Number of tokens to shift before error messages enabled. */
931 int yyerrstatus;
932 /* Lookahead token as an internal (translated) token number. */
933 int yytoken = 0;
934
935 /* Three stacks and their tools:
936 `yyss': related to states,
937 `yyvs': related to semantic values,
938 `yyls': related to locations.
939
940 Refer to the stacks thru separate pointers, to allow yyoverflow
941 to reallocate them elsewhere. */
942
943 /* The state stack. */
944 short int yyssa[YYINITDEPTH];
945 short int *yyss = yyssa;
946 short int *yyssp;
947
948 /* The semantic value stack. */
949 YYSTYPE yyvsa[YYINITDEPTH];
950 YYSTYPE *yyvs = yyvsa;
951 YYSTYPE *yyvsp;
952
953
954
955#define YYPOPSTACK (yyvsp--, yyssp--)
956
957 YYSIZE_T yystacksize = YYINITDEPTH;
958
959 /* The variables used to return semantic value and location from the
960 action routines. */
961 YYSTYPE yyval;
962
963
964 /* When reducing, the number of symbols on the RHS of the reduced
965 rule. */
966 int yylen;
967
968 YYDPRINTF ((stderr, "Starting parse\n"));
969
970 yystate = 0;
971 yyerrstatus = 0;
972 yynerrs = 0;
973 yychar = YYEMPTY; /* Cause a token to be read. */
974
975 /* Initialize stack pointers.
976 Waste one element of value and location stack
977 so that they stay on the same level as the state stack.
978 The wasted elements are never initialized. */
979
980 yyssp = yyss;
981 yyvsp = yyvs;
982
983
984 goto yysetstate;
985
986/*------------------------------------------------------------.
987| yynewstate -- Push a new state, which is found in yystate. |
988`------------------------------------------------------------*/
989 yynewstate:
990 /* In all cases, when you get here, the value and location stacks
991 have just been pushed. so pushing a state here evens the stacks.
992 */
993 yyssp++;
994
995 yysetstate:
996 *yyssp = yystate;
997
998 if (yyss + yystacksize - 1 <= yyssp)
999 {
1000 /* Get the current used size of the three stacks, in elements. */
1001 YYSIZE_T yysize = yyssp - yyss + 1;
1002
1003#ifdef yyoverflow
1004 {
1005 /* Give user a chance to reallocate the stack. Use copies of
1006 these so that the &'s don't force the real ones into
1007 memory. */
1008 YYSTYPE *yyvs1 = yyvs;
1009 short int *yyss1 = yyss;
1010
1011
1012 /* Each stack pointer address is followed by the size of the
1013 data in use in that stack, in bytes. This used to be a
1014 conditional around just the two extra args, but that might
1015 be undefined if yyoverflow is a macro. */
1016 yyoverflow ("parser stack overflow",
1017 &yyss1, yysize * sizeof (*yyssp),
1018 &yyvs1, yysize * sizeof (*yyvsp),
1019
1020 &yystacksize);
1021
1022 yyss = yyss1;
1023 yyvs = yyvs1;
1024 }
1025#else /* no yyoverflow */
1026# ifndef YYSTACK_RELOCATE
1027 goto yyoverflowlab;
1028# else
1029 /* Extend the stack our own way. */
1030 if (YYMAXDEPTH <= yystacksize)
1031 goto yyoverflowlab;
1032 yystacksize *= 2;
1033 if (YYMAXDEPTH < yystacksize)
1034 yystacksize = YYMAXDEPTH;
1035
1036 {
1037 short int *yyss1 = yyss;
1038 union yyalloc *yyptr =
1039 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1040 if (! yyptr)
1041 goto yyoverflowlab;
1042 YYSTACK_RELOCATE (yyss);
1043 YYSTACK_RELOCATE (yyvs);
1044
1045# undef YYSTACK_RELOCATE
1046 if (yyss1 != yyssa)
1047 YYSTACK_FREE (yyss1);
1048 }
1049# endif
1050#endif /* no yyoverflow */
1051
1052 yyssp = yyss + yysize - 1;
1053 yyvsp = yyvs + yysize - 1;
1054
1055
1056 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1057 (unsigned long int) yystacksize));
1058
1059 if (yyss + yystacksize - 1 <= yyssp)
1060 YYABORT;
1061 }
1062
1063 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1064
1065 goto yybackup;
1066
1067/*-----------.
1068| yybackup. |
1069`-----------*/
1070yybackup:
1071
1072/* Do appropriate processing given the current state. */
1073/* Read a lookahead token if we need one and don't already have one. */
1074/* yyresume: */
1075
1076 /* First try to decide what to do without reference to lookahead token. */
1077
1078 yyn = yypact[yystate];
1079 if (yyn == YYPACT_NINF)
1080 goto yydefault;
1081
1082 /* Not known => get a lookahead token if don't already have one. */
1083
1084 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1085 if (yychar == YYEMPTY)
1086 {
1087 YYDPRINTF ((stderr, "Reading a token: "));
1088 yychar = YYLEX;
1089 }
1090
1091 if (yychar <= YYEOF)
1092 {
1093 yychar = yytoken = YYEOF;
1094 YYDPRINTF ((stderr, "Now at end of input.\n"));
1095 }
1096 else
1097 {
1098 yytoken = YYTRANSLATE (yychar);
1099 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1100 }
1101
1102 /* If the proper action on seeing token YYTOKEN is to reduce or to
1103 detect an error, take that action. */
1104 yyn += yytoken;
1105 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1106 goto yydefault;
1107 yyn = yytable[yyn];
1108 if (yyn <= 0)
1109 {
1110 if (yyn == 0 || yyn == YYTABLE_NINF)
1111 goto yyerrlab;
1112 yyn = -yyn;
1113 goto yyreduce;
1114 }
1115
1116 if (yyn == YYFINAL)
1117 YYACCEPT;
1118
1119 /* Shift the lookahead token. */
1120 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1121
1122 /* Discard the token being shifted unless it is eof. */
1123 if (yychar != YYEOF)
1124 yychar = YYEMPTY;
1125
1126 *++yyvsp = yylval;
1127
1128
1129 /* Count tokens shifted since error; after three, turn off error
1130 status. */
1131 if (yyerrstatus)
1132 yyerrstatus--;
1133
1134 yystate = yyn;
1135 goto yynewstate;
1136
1137
1138/*-----------------------------------------------------------.
1139| yydefault -- do the default action for the current state. |
1140`-----------------------------------------------------------*/
1141yydefault:
1142 yyn = yydefact[yystate];
1143 if (yyn == 0)
1144 goto yyerrlab;
1145 goto yyreduce;
1146
1147
1148/*-----------------------------.
1149| yyreduce -- Do a reduction. |
1150`-----------------------------*/
1151yyreduce:
1152 /* yyn is the number of a rule to reduce with. */
1153 yylen = yyr2[yyn];
1154
1155 /* If YYLEN is nonzero, implement the default value of the action:
1156 `$$ = $1'.
1157
1158 Otherwise, the following line sets YYVAL to garbage.
1159 This behavior is undocumented and Bison
1160 users should not rely upon it. Assigning to YYVAL
1161 unconditionally makes the parser a bit smaller, and it avoids a
1162 GCC warning that YYVAL may be used uninitialized. */
1163 yyval = yyvsp[1-yylen];
1164
1165
1166 YY_REDUCE_PRINT (yyn);
1167 switch (yyn)
1168 {
1169 case 2:
1170#line 142 "autotools.yy"
1171 {
1172 ProjectAST *projectAST = new ProjectAST();
1173 projects.push(projectAST);
1174;}
1175 break;
1176
1177 case 4:
1178#line 150 "autotools.yy"
1179 {
1180 projects.top()->addChildAST(yyvsp[0].node);
1181
1182 if ( yyvsp[0].node->nodeType() == AST::ProjectAST &&
1183 static_cast<ProjectAST*>( yyvsp[0].node )->scopedID == "if" )
1184 {
1185 yyvsp[0].node->setDepth(depth);
1186 depth++;
1187 }
1188 else if ( yyvsp[0].node->nodeType() == AST::ProjectAST &&
1189 static_cast<ProjectAST*>( yyvsp[0].node )->scopedID == "else" )
1190 {
1191 --depth;
1192 yyvsp[0].node->setDepth(depth);
1193 ++depth;
1194 }
1195 else if ( yyvsp[0].node->nodeType() == AST::ProjectAST &&
1196 static_cast<ProjectAST*>( yyvsp[0].node )->scopedID == "endif" )
1197 {
1198 --depth;
1199 yyvsp[0].node->setDepth(depth);
1200 }
1201 else
1202 yyvsp[0].node->setDepth(depth);
1203;}
1204 break;
1205
1206 case 6:
1207#line 179 "autotools.yy"
1208 {
1209 yyval.node = yyvsp[0].node;
1210;}
1211 break;
1212
1213 case 7:
1214#line 183 "autotools.yy"
1215 {
1216 yyval.node = yyvsp[0].node;
1217;}
1218 break;
1219
1220 case 8:
1221#line 187 "autotools.yy"
1222 {
1223 yyval.node = yyvsp[0].node;
1224;}
1225 break;
1226
1227 case 9:
1228#line 191 "autotools.yy"
1229 {
1230 yyval.node = yyvsp[0].node;
1231;}
1232 break;
1233
1234 case 10:
1235#line 195 "autotools.yy"
1236 {
1237 yyval.node = yyvsp[0].node;
1238;}
1239 break;
1240
1241 case 11:
1242#line 199 "autotools.yy"
1243 {
1244 yyval.node = yyvsp[0].node;
1245;}
1246 break;
1247
1248 case 12:
1249#line 203 "autotools.yy"
1250 {
1251 yyval.node = yyvsp[0].node;
1252;}
1253 break;
1254
1255 case 13:
1256#line 207 "autotools.yy"
1257 {
1258 yyval.node = yyvsp[0].node;
1259;}
1260 break;
1261
1262 case 14:
1263#line 211 "autotools.yy"
1264 {
1265 yyval.node = new NewLineAST();
1266;}
1267 break;
1268
1269 case 15:
1270#line 217 "autotools.yy"
1271 {
1272 ConditionAST* projectAST = new ConditionAST();
1273 projectAST->type = "if";
1274 projectAST->conditionName = yyvsp[0].value;
1275 yyval.node = projectAST;
1276;}
1277 break;
1278
1279 case 16:
1280#line 225 "autotools.yy"
1281 {
1282 ConditionAST* past = new ConditionAST();
1283 past->type= "endif";
1284 yyval.node = past;
1285;}
1286 break;
1287
1288 case 17:
1289#line 231 "autotools.yy"
1290 {
1291 ConditionAST* past = new ConditionAST();
1292 past->type= "endif";
1293 past->conditionName = yyvsp[0].value;
1294 yyval.node = past;
1295;}
1296 break;
1297
1298 case 18:
1299#line 240 "autotools.yy"
1300 {
1301 ConditionAST* past = new ConditionAST();
1302 past->type = "else";
1303 yyval.node = past;
1304;}
1305 break;
1306
1307 case 19:
1308#line 246 "autotools.yy"
1309 {
1310 ConditionAST* past = new ConditionAST();
1311 past->type = "else";
1312 past->conditionName = yyvsp[0].value;
1313 yyval.node = past;
1314;}
1315 break;
1316
1317 case 20:
1318#line 255 "autotools.yy"
1319 {
1320 AssignmentAST *node = new AssignmentAST();
1321 node->scopedID = yyvsp[-2].value;
1322 node->op = yyvsp[-1].value;
1323 node->values = yyvsp[0].values;
1324 yyval.node = node;
1325;}
1326 break;
1327
1328 case 21:
1329#line 265 "autotools.yy"
1330 { yyval.value = yyvsp[-1].value + yyvsp[0].value; ;}
1331 break;
1332
1333 case 23:
1334#line 270 "autotools.yy"
1335 {
1336 yyval.values.append(yyvsp[0].value);
1337;}
1338 break;
1339
1340 case 24:
1341#line 273 "autotools.yy"
1342 { yyval.values.clear(); ;}
1343 break;
1344
1345 case 25:
1346#line 276 "autotools.yy"
1347 { yyval.value = yyvsp[-1].value + " \\\n"; ;}
1348 break;
1349
1350 case 26:
1351#line 277 "autotools.yy"
1352 { yyval.value = yyvsp[-1].value + "\n"; ;}
1353 break;
1354
1355 case 27:
1356#line 278 "autotools.yy"
1357 { yyval.value = "\\\n"; ;}
1358 break;
1359
1360 case 29:
1361#line 283 "autotools.yy"
1362 {
1363 AutomakeTargetAST *node = new AutomakeTargetAST();
1364 node->target = yyvsp[-2].value;
1365 node->deps = yyvsp[0].values;
1366 yyval.node = node;
1367;}
1368 break;
1369
1370 case 30:
1371#line 292 "autotools.yy"
1372 {
1373 ProjectAST* node = new ProjectAST(ProjectAST::Rule);
1374 node->scopedID = yyvsp[0].value;
1375 yyval.node = node;
1376;}
1377 break;
1378
1379 case 31:
1380#line 300 "autotools.yy"
1381 {
1382 AssignmentAST *node = new AssignmentAST();
1383 node->scopedID = yyvsp[-1].value;
1384 node->values = TQStringList(yyvsp[0].value);
1385 yyval.node = node;
1386;}
1387 break;
1388
1389 case 34:
1390#line 312 "autotools.yy"
1391 {
1392 CommentAST *node = new CommentAST();
1393 node->comment = yyvsp[-1].value + "\n";
1394 yyval.node = node;
1395;}
1396 break;
1397
1398
1399 }
1400
1401/* Line 1010 of yacc.c. */
1402#line 1403 "autotools_yacc.cpp"
1403␌
1404 yyvsp -= yylen;
1405 yyssp -= yylen;
1406
1407
1408 YY_STACK_PRINT (yyss, yyssp);
1409
1410 *++yyvsp = yyval;
1411
1412
1413 /* Now `shift' the result of the reduction. Determine what state
1414 that goes to, based on the state we popped back to and the rule
1415 number reduced by. */
1416
1417 yyn = yyr1[yyn];
1418
1419 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1420 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1421 yystate = yytable[yystate];
1422 else
1423 yystate = yydefgoto[yyn - YYNTOKENS];
1424
1425 goto yynewstate;
1426
1427
1428/*------------------------------------.
1429| yyerrlab -- here on detecting error |
1430`------------------------------------*/
1431yyerrlab:
1432 /* If not already recovering from an error, report this error. */
1433 if (!yyerrstatus)
1434 {
1435 ++yynerrs;
1436#if YYERROR_VERBOSE
1437 yyn = yypact[yystate];
1438
1439 if (YYPACT_NINF < yyn && yyn < YYLAST)
1440 {
1441 YYSIZE_T yysize = 0;
1442 int yytype = YYTRANSLATE (yychar);
1443 const char* yyprefix;
1444 char *yymsg;
1445 int yyx;
1446
1447 /* Start YYX at -YYN if negative to avoid negative indexes in
1448 YYCHECK. */
1449 int yyxbegin = yyn < 0 ? -yyn : 0;
1450
1451 /* Stay within bounds of both yycheck and yytname. */
1452 int yychecklim = YYLAST - yyn;
1453 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1454 int yycount = 0;
1455
1456 yyprefix = ", expecting ";
1457 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1458 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1459 {
1460 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
1461 yycount += 1;
1462 if (yycount == 5)
1463 {
1464 yysize = 0;
1465 break;
1466 }
1467 }
1468 yysize += (sizeof ("syntax error, unexpected ")
1469 + yystrlen (yytname[yytype]));
1470 yymsg = (char *) YYSTACK_ALLOC (yysize);
1471 if (yymsg != 0)
1472 {
1473 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1474 yyp = yystpcpy (yyp, yytname[yytype]);
1475
1476 if (yycount < 5)
1477 {
1478 yyprefix = ", expecting ";
1479 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1480 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1481 {
1482 yyp = yystpcpy (yyp, yyprefix);
1483 yyp = yystpcpy (yyp, yytname[yyx]);
1484 yyprefix = " or ";
1485 }
1486 }
1487 yyerror (yymsg);
1488 YYSTACK_FREE (yymsg);
1489 }
1490 else
1491 yyerror ("syntax error; also virtual memory exhausted");
1492 }
1493 else
1494#endif /* YYERROR_VERBOSE */
1495 yyerror ("syntax error");
1496 }
1497
1498
1499
1500 if (yyerrstatus == 3)
1501 {
1502 /* If just tried and failed to reuse lookahead token after an
1503 error, discard it. */
1504
1505 if (yychar <= YYEOF)
1506 {
1507 /* If at end of input, pop the error token,
1508 then the rest of the stack, then return failure. */
1509 if (yychar == YYEOF)
1510 for (;;)
1511 {
1512 YYPOPSTACK;
1513 if (yyssp == yyss)
1514 YYABORT;
1515 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1516 yydestruct (yystos[*yyssp], yyvsp);
1517 }
1518 }
1519 else
1520 {
1521 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1522 yydestruct (yytoken, &yylval);
1523 yychar = YYEMPTY;
1524
1525 }
1526 }
1527
1528 /* Else will try to reuse lookahead token after shifting the error
1529 token. */
1530 goto yyerrlab1;
1531
1532
1533/*---------------------------------------------------.
1534| yyerrorlab -- error raised explicitly by YYERROR. |
1535`---------------------------------------------------*/
1536yyerrorlab:
1537
1538#ifdef __GNUC__
1539 /* Pacify GCC when the user code never invokes YYERROR and the label
1540 yyerrorlab therefore never appears in user code. */
1541 if (0)
1542 goto yyerrorlab;
1543#endif
1544
1545 yyvsp -= yylen;
1546 yyssp -= yylen;
1547 yystate = *yyssp;
1548 goto yyerrlab1;
1549
1550
1551/*-------------------------------------------------------------.
1552| yyerrlab1 -- common code for both syntax error and YYERROR. |
1553`-------------------------------------------------------------*/
1554yyerrlab1:
1555 yyerrstatus = 3; /* Each real token shifted decrements this. */
1556
1557 for (;;)
1558 {
1559 yyn = yypact[yystate];
1560 if (yyn != YYPACT_NINF)
1561 {
1562 yyn += YYTERROR;
1563 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1564 {
1565 yyn = yytable[yyn];
1566 if (0 < yyn)
1567 break;
1568 }
1569 }
1570
1571 /* Pop the current state because it cannot handle the error token. */
1572 if (yyssp == yyss)
1573 YYABORT;
1574
1575 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1576 yydestruct (yystos[yystate], yyvsp);
1577 YYPOPSTACK;
1578 yystate = *yyssp;
1579 YY_STACK_PRINT (yyss, yyssp);
1580 }
1581
1582 if (yyn == YYFINAL)
1583 YYACCEPT;
1584
1585 YYDPRINTF ((stderr, "Shifting error token, "));
1586
1587 *++yyvsp = yylval;
1588
1589
1590 yystate = yyn;
1591 goto yynewstate;
1592
1593
1594/*-------------------------------------.
1595| yyacceptlab -- YYACCEPT comes here. |
1596`-------------------------------------*/
1597yyacceptlab:
1598 yyresult = 0;
1599 goto yyreturn;
1600
1601/*-----------------------------------.
1602| yyabortlab -- YYABORT comes here. |
1603`-----------------------------------*/
1604yyabortlab:
1605 yyresult = 1;
1606 goto yyreturn;
1607
1608#ifndef yyoverflow
1609/*----------------------------------------------.
1610| yyoverflowlab -- parser overflow comes here. |
1611`----------------------------------------------*/
1612yyoverflowlab:
1613 yyerror ("parser stack overflow");
1614 yyresult = 2;
1615 /* Fall through. */
1616#endif
1617
1618yyreturn:
1619#ifndef yyoverflow
1620 if (yyss != yyssa)
1621 YYSTACK_FREE (yyss);
1622#endif
1623 return yyresult;
1624}
1625
1626
1627#line 321 "autotools.yy"
1628
1629
1630#include "autotools_lex.cpp"
1631
AutoTools::AST::ProjectAST
@ ProjectAST
Project, scope or function scope.
Definition autotoolsast.h:51
AutoTools::AST::setDepth
void setDepth(int depth)
Sets the depth of the node in AST.
Definition autotoolsast.h:80
AutoTools::AssignmentAST
Assignment AST node.
Definition autotoolsast.h:191
AutoTools::AssignmentAST::values
TQStringList values
List of values.
Definition autotoolsast.h:204
AutoTools::AssignmentAST::scopedID
TQString scopedID
Scoped name of the variable.
Definition autotoolsast.h:198
AutoTools::AssignmentAST::op
TQString op
Operator.
Definition autotoolsast.h:201
AutoTools::CommentAST
Comment AST node.
Definition autotoolsast.h:254
AutoTools::CommentAST::comment
TQString comment
Comment text.
Definition autotoolsast.h:261
AutoTools::NewLineAST
New line AST node.
Definition autotoolsast.h:240
AutoTools::ProjectAST
Project AST node.
Definition autotoolsast.h:123
AutoTools::ProjectAST::Rule
@ Rule
Automake Rule.
Definition autotoolsast.h:131
AutoTools::ProjectAST::scopedID
TQString scopedID
Scoped identifier (scope name or rule).
Definition autotoolsast.h:153

KDevelop AutoTools Parser

Skip menu "KDevelop AutoTools Parser"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDevelop AutoTools Parser

Skip menu "KDevelop AutoTools Parser"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop AutoTools Parser by doxygen 1.15.0
This website is maintained by Timothy Pearson.