]>
Dogcows Code - chaz/openbox/blob - util/epist/yacc_parser.cc
2 /* A Bison parser, made from epist.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
22 # include "../../config.h"
23 #endif // HAVE_CONFIG_H
29 #define YYPARSE_PARAM parser_obj
39 void yyerror ( const char * c
) {
40 printf ( "ERROR: %s \n " , c
);
61 #define YYTRANSLATE(x) ((unsigned)(x) <= 267 ? yytranslate[x] : 28)
63 static const char yytranslate
[] = { 0 ,
64 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
65 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
66 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
67 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
68 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
69 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
70 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
71 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
72 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
73 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
74 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
75 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
76 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
77 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
78 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
79 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
80 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
81 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
82 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
83 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
84 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
85 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
86 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
87 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
88 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
89 2 , 2 , 2 , 2 , 2 , 1 , 3 , 4 , 5 , 6 ,
90 7 , 8 , 9 , 10 , 11 , 12 , 13
94 static const short yyprhs
[] = { 0 ,
95 0 , 1 , 4 , 7 , 9 , 11 , 16 , 21 , 26 , 29 ,
96 31 , 33 , 34 , 38 , 40 , 42 , 44 , 46 , 48 , 50 ,
97 51 , 53 , 56 , 58 , 60 , 62 , 64 , 65 , 68
100 static const short yyrhs
[] = { - 1 ,
101 14 , 15 , 0 , 14 , 18 , 0 , 16 , 0 , 17 , 0 ,
102 19 , 9 , 24 , 5 , 0 , 19 , 20 , 14 , 21 , 0 ,
103 25 , 3 , 26 , 4 , 0 , 22 , 23 , 0 , 3 , 0 ,
104 4 , 0 , 0 , 10 , 6 , 22 , 0 , 3 , 0 , 4 ,
105 0 , 6 , 0 , 5 , 0 , 7 , 0 , 9 , 0 , 0 ,
106 7 , 0 , 6 , 7 , 0 , 8 , 0 , 12 , 0 , 13 ,
107 0 , 11 , 0 , 0 , 26 , 27 , 0 , 9 , 24 , 5 ,
114 static const short yyrline
[] = { 0 ,
115 31 , 32 , 33 , 36 , 37 , 40 , 49 , 56 , 60 , 64 ,
116 68 , 72 , 73 , 76 , 78 , 79 , 80 , 81 , 82 , 85 ,
117 86 , 87 , 88 , 89 , 90 , 93 , 97 , 98 , 101
122 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
124 static const char * const yytname
[] = { "$" , "error" , "$undefined." , "OBRACE" ,
125 "EBRACE" , "SEMICOLON" , "DASH" , "NUMBER" , "QUOTES" , "WORD" , "BINDING" , "OPTIONS" , "TRUE" ,
126 "FALSE" , "commands" , "command" , "action_command" , "chain_command" , "options_block" ,
127 "binding" , "obrace" , "ebrace" , "binding_w_modifier" , "bind_key" , "parameter" , "options_keyword" ,
128 "options" , "option" , NULL
132 static const short yyr1
[] = { 0 ,
133 14 , 14 , 14 , 15 , 15 , 16 , 17 , 18 , 19 , 20 ,
134 21 , 22 , 22 , 23 , 23 , 23 , 23 , 23 , 23 , 24 ,
135 24 , 24 , 24 , 24 , 24 , 25 , 26 , 26 , 27
138 static const short yyr2
[] = { 0 ,
139 0 , 2 , 2 , 1 , 1 , 4 , 4 , 4 , 2 , 1 ,
140 1 , 0 , 3 , 1 , 1 , 1 , 1 , 1 , 1 , 0 ,
141 1 , 2 , 1 , 1 , 1 , 1 , 0 , 2 , 3
144 static const short yydefact
[] = { 1 ,
145 12 , 0 , 26 , 2 , 4 , 5 , 3 , 0 , 0 , 0 ,
146 12 , 10 , 20 , 1 , 14 , 15 , 17 , 16 , 18 , 19 ,
147 9 , 27 , 13 , 0 , 21 , 23 , 24 , 25 , 0 , 12 ,
148 0 , 22 , 6 , 11 , 7 , 8 , 20 , 28 , 0 , 29 ,
152 static const short yydefgoto
[] = { 1 ,
153 4 , 5 , 6 , 7 , 8 , 14 , 35 , 9 , 21 , 29 ,
157 static const short yypact
[] = {- 32768 ,
158 0 , - 2 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 , 16 , 11 , 6 ,
159 12 ,- 32768 , - 5 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,
160 - 32768 ,- 32768 ,- 32768 , 20 ,- 32768 ,- 32768 ,- 32768 ,- 32768 , 18 , 2 ,
161 17 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 , - 5 ,- 32768 , 19 ,- 32768 ,
165 static const short yypgoto
[] = { 14 ,
166 - 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 , 21 ,- 32768 , - 8 ,
174 static const short yytable
[] = { 41 ,
175 24 , 25 , 26 , 11 , 42 , 34 , 27 , 28 , 22 , 2 ,
176 3 , 2 , 3 , 15 , 16 , 17 , 18 , 19 , 12 , 20 ,
177 36 , 2 , 33 , 40 , 13 , 37 , 32 , 30 , 39 , 0 ,
181 static const short yycheck
[] = { 0 ,
182 6 , 7 , 8 , 6 , 0 , 4 , 12 , 13 , 3 , 10 ,
183 11 , 10 , 11 , 3 , 4 , 5 , 6 , 7 , 3 , 9 ,
184 4 , 10 , 5 , 5 , 9 , 9 , 7 , 14 , 37 , - 1 ,
187 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
188 #line 3 "/usr/share/misc/bison.simple"
189 /* This file comes from bison-1.28. */
191 /* Skeleton output parser for bison,
192 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
194 This program is free software; you can redistribute it and/or modify
195 it under the terms of the GNU General Public License as published by
196 the Free Software Foundation; either version 2, or (at your option)
199 This program is distributed in the hope that it will be useful,
200 but WITHOUT ANY WARRANTY; without even the implied warranty of
201 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
202 GNU General Public License for more details.
204 You should have received a copy of the GNU General Public License
205 along with this program; if not, write to the Free Software
206 Foundation, Inc., 59 Temple Place - Suite 330,
207 Boston, MA 02111-1307, USA. */
209 /* As a special exception, when this file is copied by Bison into a
210 Bison output file, you may use that output file without restriction.
211 This special exception was added by the Free Software Foundation
212 in version 1.24 of Bison. */
214 /* This is the parser code that is written into each bison parser
215 when the %semantic_parser declaration is not specified in the grammar.
216 It was written by Richard Stallman by simplifying the hairy parser
217 used when %semantic_parser is specified. */
219 #ifndef YYSTACK_USE_ALLOCA
221 #define YYSTACK_USE_ALLOCA
222 #else /* alloca not defined */
224 #define YYSTACK_USE_ALLOCA
225 #define alloca __builtin_alloca
226 #else /* not GNU C. */
227 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
228 #define YYSTACK_USE_ALLOCA
230 #else /* not sparc */
231 /* We think this test detects Watcom and Microsoft C. */
232 /* This used to test MSDOS, but that is a bad idea
233 since that symbol is in the user namespace. */
234 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
235 #if 0 /* No need for malloc.h, which pollutes the namespace;
236 instead, just don't use alloca. */
239 #else /* not MSDOS, or __TURBOC__ */
241 /* I don't know what this was needed for, but it pollutes the namespace.
242 So I turned it off. rms, 2 May 1997. */
243 /* #include <malloc.h> */
245 #define YYSTACK_USE_ALLOCA
246 #else /* not MSDOS, or __TURBOC__, or _AIX */
248 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
249 and on HPUX 10. Eventually we can turn this on. */
250 #define YYSTACK_USE_ALLOCA
251 #define alloca __builtin_alloca
254 #endif /* not _AIX */
255 #endif /* not MSDOS, or __TURBOC__ */
256 #endif /* not sparc */
257 #endif /* not GNU C */
258 #endif /* alloca not defined */
259 #endif /* YYSTACK_USE_ALLOCA not defined */
261 #ifdef YYSTACK_USE_ALLOCA
262 #define YYSTACK_ALLOC alloca
264 #define YYSTACK_ALLOC malloc
267 /* Note: there must be only one dollar sign in this file.
268 It is replaced by the list of actions, each action
269 as one case of the switch. */
271 #define yyerrok (yyerrstatus = 0)
272 #define yyclearin (yychar = YYEMPTY)
275 #define YYACCEPT goto yyacceptlab
276 #define YYABORT goto yyabortlab
277 #define YYERROR goto yyerrlab1
278 /* Like YYERROR except do call yyerror.
279 This remains here temporarily to ease the
280 transition to the new meaning of YYERROR, for GCC.
281 Once GCC version 2 has supplanted version 1, this can go. */
282 #define YYFAIL goto yyerrlab
283 #define YYRECOVERING() (!!yyerrstatus)
284 #define YYBACKUP(token, value) \
286 if (yychar == YYEMPTY && yylen == 1) \
287 { yychar = (token), yylval = (value); \
288 yychar1 = YYTRANSLATE (yychar); \
293 { yyerror ( "syntax error: cannot back up" ); YYERROR; } \
297 #define YYERRCODE 256
300 #define YYLEX yylex()
306 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
308 #define YYLEX yylex(&yylval, &yylloc)
310 #else /* not YYLSP_NEEDED */
312 #define YYLEX yylex(&yylval, YYLEX_PARAM)
314 #define YYLEX yylex(&yylval)
316 #endif /* not YYLSP_NEEDED */
319 /* If nonreentrant, generate the variables here */
323 int yychar
; /* the lookahead symbol */
324 YYSTYPE yylval
; /* the semantic value of the */
325 /* lookahead symbol */
328 YYLTYPE yylloc
; /* location data for the lookahead */
332 int yynerrs
; /* number of parse errors so far */
333 #endif /* not YYPURE */
336 int yydebug
; /* nonzero means print parse trace */
337 /* Since this is uninitialized, it does not stop multiple parsers
341 /* YYINITDEPTH indicates the initial size of the parser's stacks */
344 #define YYINITDEPTH 200
347 /* YYMAXDEPTH is the maximum size the stacks can grow to
348 (effective only if the built-in stack extension method is used). */
355 #define YYMAXDEPTH 10000
358 /* Define __yy_memcpy. Note that the size argument
359 should be passed with type unsigned int, because that is what the non-GCC
360 definitions require. With GCC, __builtin_memcpy takes an arg
361 of type size_t, but it can handle unsigned int. */
363 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
364 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
365 #else /* not GNU C or C++ */
368 /* This is the most reliable way to avoid incompatibilities
369 in available built-in functions on various systems. */
371 __yy_memcpy ( to
, from
, count
)
376 register char * f
= from
;
377 register char * t
= to
;
378 register int i
= count
;
384 #else /* __cplusplus */
386 /* This is the most reliable way to avoid incompatibilities
387 in available built-in functions on various systems. */
389 __yy_memcpy ( char * to
, char * from
, unsigned int count
)
391 register char * t
= to
;
392 register char * f
= from
;
393 register int i
= count
;
402 #line 217 "/usr/share/misc/bison.simple"
404 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
405 into yyparse. The argument should have type void *.
406 It should actually point to an object.
407 Grammar actions can access the variable by casting it
408 to the proper pointer type. */
412 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
413 #define YYPARSE_PARAM_DECL
414 #else /* not __cplusplus */
415 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
416 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
417 #endif /* not __cplusplus */
418 #else /* not YYPARSE_PARAM */
419 #define YYPARSE_PARAM_ARG
420 #define YYPARSE_PARAM_DECL
421 #endif /* not YYPARSE_PARAM */
423 /* Prevent warning if -Wstrict-prototypes. */
426 int yyparse ( void *);
433 yyparse ( YYPARSE_PARAM_ARG
)
436 register int yystate
;
438 register short * yyssp
;
439 register YYSTYPE
* yyvsp
;
440 int yyerrstatus
; /* number of tokens to shift before error messages enabled */
441 int yychar1
= 0 ; /* lookahead token as an internal (translated) token number */
443 short yyssa
[ YYINITDEPTH
]; /* the state stack */
444 YYSTYPE yyvsa
[ YYINITDEPTH
]; /* the semantic value stack */
446 short * yyss
= yyssa
; /* refer to the stacks thru separate pointers */
447 YYSTYPE
* yyvs
= yyvsa
; /* to allow yyoverflow to reallocate them elsewhere */
450 YYLTYPE yylsa
[ YYINITDEPTH
]; /* the location stack */
451 YYLTYPE
* yyls
= yylsa
;
454 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
456 #define YYPOPSTACK (yyvsp--, yyssp--)
459 int yystacksize
= YYINITDEPTH
;
460 int yyfree_stacks
= 0 ;
471 YYSTYPE yyval
; /* the variable used to return */
472 /* semantic values from the action */
479 fprintf ( stderr
, "Starting parse \n " );
485 yychar
= YYEMPTY
; /* Cause a token to be read. */
487 /* Initialize stack pointers.
488 Waste one element of value and location stack
489 so that they stay on the same level as the state stack.
490 The wasted elements are never initialized. */
498 /* Push a new state, which is found in yystate . */
499 /* In all cases, when you get here, the value and location stacks
500 have just been pushed. so pushing a state here evens the stacks. */
505 if ( yyssp
>= yyss
+ yystacksize
- 1 )
507 /* Give user a chance to reallocate the stack */
508 /* Use copies of these so that the &'s don't force the real ones into memory. */
509 YYSTYPE
* yyvs1
= yyvs
;
512 YYLTYPE
* yyls1
= yyls
;
515 /* Get the current used size of the three stacks, in elements. */
516 int size
= yyssp
- yyss
+ 1 ;
519 /* Each stack pointer address is followed by the size of
520 the data in use in that stack, in bytes. */
522 /* This used to be a conditional around just the two extra args,
523 but that might be undefined if yyoverflow is a macro. */
524 yyoverflow ( "parser stack overflow" ,
525 & yyss1
, size
* sizeof (* yyssp
),
526 & yyvs1
, size
* sizeof (* yyvsp
),
527 & yyls1
, size
* sizeof (* yylsp
),
530 yyoverflow ( "parser stack overflow" ,
531 & yyss1
, size
* sizeof (* yyssp
),
532 & yyvs1
, size
* sizeof (* yyvsp
),
536 yyss
= yyss1
; yyvs
= yyvs1
;
540 #else /* no yyoverflow */
541 /* Extend the stack our own way. */
542 if ( yystacksize
>= YYMAXDEPTH
)
544 yyerror ( "parser stack overflow" );
556 if ( yystacksize
> YYMAXDEPTH
)
557 yystacksize
= YYMAXDEPTH
;
558 #ifndef YYSTACK_USE_ALLOCA
561 yyss
= ( short *) YYSTACK_ALLOC ( yystacksize
* sizeof (* yyssp
));
562 __yy_memcpy (( char *) yyss
, ( char *) yyss1
,
563 size
* ( unsigned int ) sizeof (* yyssp
));
564 yyvs
= ( YYSTYPE
*) YYSTACK_ALLOC ( yystacksize
* sizeof (* yyvsp
));
565 __yy_memcpy (( char *) yyvs
, ( char *) yyvs1
,
566 size
* ( unsigned int ) sizeof (* yyvsp
));
568 yyls
= ( YYLTYPE
*) YYSTACK_ALLOC ( yystacksize
* sizeof (* yylsp
));
569 __yy_memcpy (( char *) yyls
, ( char *) yyls1
,
570 size
* ( unsigned int ) sizeof (* yylsp
));
572 #endif /* no yyoverflow */
574 yyssp
= yyss
+ size
- 1 ;
575 yyvsp
= yyvs
+ size
- 1 ;
577 yylsp
= yyls
+ size
- 1 ;
582 fprintf ( stderr
, "Stack size increased to %d \n " , yystacksize
);
585 if ( yyssp
>= yyss
+ yystacksize
- 1 )
591 fprintf ( stderr
, "Entering state %d \n " , yystate
);
597 /* Do appropriate processing given the current state. */
598 /* Read a lookahead token if we need one and don't already have one. */
601 /* First try to decide what to do without reference to lookahead token. */
603 yyn
= yypact
[ yystate
];
607 /* Not known => get a lookahead token if don't already have one. */
609 /* yychar is either YYEMPTY or YYEOF
610 or a valid token in external form. */
612 if ( yychar
== YYEMPTY
)
616 fprintf ( stderr
, "Reading a token: " );
621 /* Convert token to internal form (in yychar1) for indexing tables with */
623 if ( yychar
<= 0 ) /* This means end of input. */
626 yychar
= YYEOF
; /* Don't call YYLEX any more */
630 fprintf ( stderr
, "Now at end of input. \n " );
635 yychar1
= YYTRANSLATE ( yychar
);
640 fprintf ( stderr
, "Next token is %d ( %s " , yychar
, yytname
[ yychar1
]);
641 /* Give the individual parser a way to print the precise meaning
642 of a token, for further debugging info. */
644 YYPRINT ( stderr
, yychar
, yylval
);
646 fprintf ( stderr
, ") \n " );
652 if ( yyn
< 0 || yyn
> YYLAST
|| yycheck
[ yyn
] != yychar1
)
657 /* yyn is what to do for this token type in this state.
658 Negative => reduce, -yyn is rule number.
659 Positive => shift, yyn is new state.
660 New state is final state => don't bother to shift,
662 0, or most negative number => error. */
677 /* Shift the lookahead token. */
681 fprintf ( stderr
, "Shifting token %d ( %s ), " , yychar
, yytname
[ yychar1
]);
684 /* Discard the token being shifted unless it is eof. */
693 /* count tokens shifted since error; after three, turn off error status. */
694 if ( yyerrstatus
) yyerrstatus
--;
699 /* Do the default action for the current state. */
702 yyn
= yydefact
[ yystate
];
706 /* Do a reduction. yyn is the number of a rule to reduce with. */
710 yyval
= yyvsp
[ 1 - yylen
]; /* implement default value of the action */
717 fprintf ( stderr
, "Reducing via rule %d (line %d ), " ,
720 /* Print the symbols being reduced, and their result. */
721 for ( i
= yyprhs
[ yyn
]; yyrhs
[ i
] > 0 ; i
++)
722 fprintf ( stderr
, " %s " , yytname
[ yyrhs
[ i
]]);
723 fprintf ( stderr
, " -> %s \n " , yytname
[ yyr1
[ yyn
]]);
733 (( parser
*) parser_obj
)-> setAction ( yyvsp
[- 2 ]);
734 (( parser
*) parser_obj
)-> endAction ();
740 (( parser
*) parser_obj
)-> endChain ();
745 { (( parser
*) parser_obj
)-> startChain (); ;
749 { /* ((parser*)parser_obj)->endChain(); */ ;
753 { (( parser
*) parser_obj
)-> addModifier ( yyvsp
[- 2 ]); ;
757 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
761 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
765 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
769 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
773 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
777 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
781 { (( parser
*) parser_obj
)-> setArgumentNum ( yyvsp
[ 0 ]); ;
785 { (( parser
*) parser_obj
)-> setArgumentNegNum ( yyvsp
[ 0 ]); ;
789 { (( parser
*) parser_obj
)-> setArgumentStr ( yyvsp
[ 0 ]); ;
793 { (( parser
*) parser_obj
)-> setArgumentTrue ( yyvsp
[ 0 ]); ;
797 { (( parser
*) parser_obj
)-> setArgumentFalse ( yyvsp
[ 0 ]); ;
801 { (( parser
*) parser_obj
)-> setOption ( yyvsp
[- 2 ]); ;
804 /* the action file gets copied in in place of this dollarsign */
805 #line 543 "/usr/share/misc/bison.simple"
816 short * ssp1
= yyss
- 1 ;
817 fprintf ( stderr
, "state stack now" );
818 while ( ssp1
!= yyssp
)
819 fprintf ( stderr
, " %d " , *++ ssp1
);
820 fprintf ( stderr
, " \n " );
830 yylsp
-> first_line
= yylloc
. first_line
;
831 yylsp
-> first_column
= yylloc
. first_column
;
832 yylsp
-> last_line
= ( yylsp
- 1 )-> last_line
;
833 yylsp
-> last_column
= ( yylsp
- 1 )-> last_column
;
838 yylsp
-> last_line
= ( yylsp
+ yylen
- 1 )-> last_line
;
839 yylsp
-> last_column
= ( yylsp
+ yylen
- 1 )-> last_column
;
843 /* Now "shift" the result of the reduction.
844 Determine what state that goes to,
845 based on the state we popped back to
846 and the rule number reduced by. */
850 yystate
= yypgoto
[ yyn
- YYNTBASE
] + * yyssp
;
851 if ( yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[ yystate
] == * yyssp
)
852 yystate
= yytable
[ yystate
];
854 yystate
= yydefgoto
[ yyn
- YYNTBASE
];
858 yyerrlab
: /* here on detecting error */
861 /* If not already recovering from an error, report this error. */
865 #ifdef YYERROR_VERBOSE
866 yyn
= yypact
[ yystate
];
868 if ( yyn
> YYFLAG
&& yyn
< YYLAST
)
875 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
876 for ( x
= ( yyn
< 0 ? - yyn
: 0 );
877 x
< ( sizeof ( yytname
) / sizeof ( char *)); x
++)
878 if ( yycheck
[ x
+ yyn
] == x
)
879 size
+= strlen ( yytname
[ x
]) + 15 , count
++;
880 msg
= ( char *) malloc ( size
+ 15 );
883 strcpy ( msg
, "parse error" );
888 for ( x
= ( yyn
< 0 ? - yyn
: 0 );
889 x
< ( sizeof ( yytname
) / sizeof ( char *)); x
++)
890 if ( yycheck
[ x
+ yyn
] == x
)
892 strcat ( msg
, count
== 0 ? ", expecting `" : " or `" );
893 strcat ( msg
, yytname
[ x
]);
902 yyerror ( "parse error; also virtual memory exceeded" );
905 #endif /* YYERROR_VERBOSE */
906 yyerror ( "parse error" );
910 yyerrlab1
: /* here on error raised explicitly by an action */
912 if ( yyerrstatus
== 3 )
914 /* if just tried and failed to reuse lookahead token after an error, discard it. */
916 /* return failure if at end of input */
922 fprintf ( stderr
, "Discarding token %d ( %s ). \n " , yychar
, yytname
[ yychar1
]);
928 /* Else will try to reuse lookahead token
929 after shifting the error token. */
931 yyerrstatus
= 3 ; /* Each real token shifted decrements this */
935 yyerrdefault
: /* current state does not do anything special for the error token. */
938 /* This is wrong; only states that explicitly want error tokens
939 should shift them. */
940 yyn
= yydefact
[ yystate
]; /* If its default is to accept any token, ok. Otherwise pop it.*/
941 if ( yyn
) goto yydefault
;
944 yyerrpop
: /* pop the current state because it cannot handle the error token */
946 if ( yyssp
== yyss
) YYABORT
;
956 short * ssp1
= yyss
- 1 ;
957 fprintf ( stderr
, "Error: state stack now" );
958 while ( ssp1
!= yyssp
)
959 fprintf ( stderr
, " %d " , *++ ssp1
);
960 fprintf ( stderr
, " \n " );
966 yyn
= yypact
[ yystate
];
971 if ( yyn
< 0 || yyn
> YYLAST
|| yycheck
[ yyn
] != YYTERROR
)
990 fprintf ( stderr
, "Shifting error token, " );
1002 /* YYACCEPT comes here. */
1014 /* YYABORT comes here. */
This page took 0.088089 seconds and 4 git commands to generate.