]>
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
42 void yyerror ( const char * c
)
44 printf ( "ERROR: %s , on line %d , near %s \n " , c
, yylineno
, yytext
);
64 #define YYTRANSLATE(x) ((unsigned)(x) <= 267 ? yytranslate[x] : 28)
66 static const char yytranslate
[] = { 0 ,
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 , 2 , 2 , 2 , 2 , 2 ,
90 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
91 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ,
92 2 , 2 , 2 , 2 , 2 , 1 , 3 , 4 , 5 , 6 ,
93 7 , 8 , 9 , 10 , 11 , 12 , 13
97 static const short yyprhs
[] = { 0 ,
98 0 , 1 , 4 , 7 , 9 , 11 , 16 , 21 , 26 , 29 ,
99 31 , 33 , 34 , 38 , 40 , 42 , 44 , 46 , 48 , 50 ,
100 51 , 53 , 56 , 58 , 60 , 62 , 64 , 65 , 68
103 static const short yyrhs
[] = { - 1 ,
104 14 , 15 , 0 , 14 , 18 , 0 , 16 , 0 , 17 , 0 ,
105 19 , 9 , 24 , 5 , 0 , 19 , 20 , 14 , 21 , 0 ,
106 25 , 3 , 26 , 4 , 0 , 22 , 23 , 0 , 3 , 0 ,
107 4 , 0 , 0 , 10 , 6 , 22 , 0 , 3 , 0 , 4 ,
108 0 , 6 , 0 , 5 , 0 , 7 , 0 , 9 , 0 , 0 ,
109 7 , 0 , 6 , 7 , 0 , 8 , 0 , 12 , 0 , 13 ,
110 0 , 11 , 0 , 0 , 26 , 27 , 0 , 9 , 24 , 5 ,
117 static const short yyrline
[] = { 0 ,
118 35 , 36 , 37 , 40 , 41 , 44 , 53 , 60 , 64 , 68 ,
119 72 , 76 , 77 , 80 , 82 , 83 , 84 , 85 , 86 , 89 ,
120 90 , 91 , 92 , 93 , 94 , 97 , 101 , 102 , 105
125 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
127 static const char * const yytname
[] = { "$" , "error" , "$undefined." , "OBRACE" ,
128 "EBRACE" , "SEMICOLON" , "DASH" , "NUMBER" , "QUOTES" , "WORD" , "BINDING" , "OPTIONS" , "TRUE" ,
129 "FALSE" , "commands" , "command" , "action_command" , "chain_command" , "options_block" ,
130 "binding" , "obrace" , "ebrace" , "binding_w_modifier" , "bind_key" , "parameter" , "options_keyword" ,
131 "options" , "option" , NULL
135 static const short yyr1
[] = { 0 ,
136 14 , 14 , 14 , 15 , 15 , 16 , 17 , 18 , 19 , 20 ,
137 21 , 22 , 22 , 23 , 23 , 23 , 23 , 23 , 23 , 24 ,
138 24 , 24 , 24 , 24 , 24 , 25 , 26 , 26 , 27
141 static const short yyr2
[] = { 0 ,
142 0 , 2 , 2 , 1 , 1 , 4 , 4 , 4 , 2 , 1 ,
143 1 , 0 , 3 , 1 , 1 , 1 , 1 , 1 , 1 , 0 ,
144 1 , 2 , 1 , 1 , 1 , 1 , 0 , 2 , 3
147 static const short yydefact
[] = { 1 ,
148 12 , 0 , 26 , 2 , 4 , 5 , 3 , 0 , 0 , 0 ,
149 12 , 10 , 20 , 1 , 14 , 15 , 17 , 16 , 18 , 19 ,
150 9 , 27 , 13 , 0 , 21 , 23 , 24 , 25 , 0 , 12 ,
151 0 , 22 , 6 , 11 , 7 , 8 , 20 , 28 , 0 , 29 ,
155 static const short yydefgoto
[] = { 1 ,
156 4 , 5 , 6 , 7 , 8 , 14 , 35 , 9 , 21 , 29 ,
160 static const short yypact
[] = {- 32768 ,
161 0 , - 2 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 , 16 , 11 , 6 ,
162 12 ,- 32768 , - 5 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,
163 - 32768 ,- 32768 ,- 32768 , 20 ,- 32768 ,- 32768 ,- 32768 ,- 32768 , 18 , 2 ,
164 17 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 , - 5 ,- 32768 , 19 ,- 32768 ,
168 static const short yypgoto
[] = { 14 ,
169 - 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 ,- 32768 , 21 ,- 32768 , - 8 ,
177 static const short yytable
[] = { 41 ,
178 24 , 25 , 26 , 11 , 42 , 34 , 27 , 28 , 22 , 2 ,
179 3 , 2 , 3 , 15 , 16 , 17 , 18 , 19 , 12 , 20 ,
180 36 , 2 , 33 , 40 , 13 , 37 , 32 , 30 , 39 , 0 ,
184 static const short yycheck
[] = { 0 ,
185 6 , 7 , 8 , 6 , 0 , 4 , 12 , 13 , 3 , 10 ,
186 11 , 10 , 11 , 3 , 4 , 5 , 6 , 7 , 3 , 9 ,
187 4 , 10 , 5 , 5 , 9 , 9 , 7 , 14 , 37 , - 1 ,
190 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
191 #line 3 "/usr/share/misc/bison.simple"
192 /* This file comes from bison-1.28. */
194 /* Skeleton output parser for bison,
195 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
197 This program is free software; you can redistribute it and/or modify
198 it under the terms of the GNU General Public License as published by
199 the Free Software Foundation; either version 2, or (at your option)
202 This program is distributed in the hope that it will be useful,
203 but WITHOUT ANY WARRANTY; without even the implied warranty of
204 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
205 GNU General Public License for more details.
207 You should have received a copy of the GNU General Public License
208 along with this program; if not, write to the Free Software
209 Foundation, Inc., 59 Temple Place - Suite 330,
210 Boston, MA 02111-1307, USA. */
212 /* As a special exception, when this file is copied by Bison into a
213 Bison output file, you may use that output file without restriction.
214 This special exception was added by the Free Software Foundation
215 in version 1.24 of Bison. */
217 /* This is the parser code that is written into each bison parser
218 when the %semantic_parser declaration is not specified in the grammar.
219 It was written by Richard Stallman by simplifying the hairy parser
220 used when %semantic_parser is specified. */
222 #ifndef YYSTACK_USE_ALLOCA
224 #define YYSTACK_USE_ALLOCA
225 #else /* alloca not defined */
227 #define YYSTACK_USE_ALLOCA
228 #define alloca __builtin_alloca
229 #else /* not GNU C. */
230 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
231 #define YYSTACK_USE_ALLOCA
233 #else /* not sparc */
234 /* We think this test detects Watcom and Microsoft C. */
235 /* This used to test MSDOS, but that is a bad idea
236 since that symbol is in the user namespace. */
237 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
238 #if 0 /* No need for malloc.h, which pollutes the namespace;
239 instead, just don't use alloca. */
242 #else /* not MSDOS, or __TURBOC__ */
244 /* I don't know what this was needed for, but it pollutes the namespace.
245 So I turned it off. rms, 2 May 1997. */
246 /* #include <malloc.h> */
248 #define YYSTACK_USE_ALLOCA
249 #else /* not MSDOS, or __TURBOC__, or _AIX */
251 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
252 and on HPUX 10. Eventually we can turn this on. */
253 #define YYSTACK_USE_ALLOCA
254 #define alloca __builtin_alloca
257 #endif /* not _AIX */
258 #endif /* not MSDOS, or __TURBOC__ */
259 #endif /* not sparc */
260 #endif /* not GNU C */
261 #endif /* alloca not defined */
262 #endif /* YYSTACK_USE_ALLOCA not defined */
264 #ifdef YYSTACK_USE_ALLOCA
265 #define YYSTACK_ALLOC alloca
267 #define YYSTACK_ALLOC malloc
270 /* Note: there must be only one dollar sign in this file.
271 It is replaced by the list of actions, each action
272 as one case of the switch. */
274 #define yyerrok (yyerrstatus = 0)
275 #define yyclearin (yychar = YYEMPTY)
278 #define YYACCEPT goto yyacceptlab
279 #define YYABORT goto yyabortlab
280 #define YYERROR goto yyerrlab1
281 /* Like YYERROR except do call yyerror.
282 This remains here temporarily to ease the
283 transition to the new meaning of YYERROR, for GCC.
284 Once GCC version 2 has supplanted version 1, this can go. */
285 #define YYFAIL goto yyerrlab
286 #define YYRECOVERING() (!!yyerrstatus)
287 #define YYBACKUP(token, value) \
289 if (yychar == YYEMPTY && yylen == 1) \
290 { yychar = (token), yylval = (value); \
291 yychar1 = YYTRANSLATE (yychar); \
296 { yyerror ( "syntax error: cannot back up" ); YYERROR; } \
300 #define YYERRCODE 256
303 #define YYLEX yylex()
309 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
311 #define YYLEX yylex(&yylval, &yylloc)
313 #else /* not YYLSP_NEEDED */
315 #define YYLEX yylex(&yylval, YYLEX_PARAM)
317 #define YYLEX yylex(&yylval)
319 #endif /* not YYLSP_NEEDED */
322 /* If nonreentrant, generate the variables here */
326 int yychar
; /* the lookahead symbol */
327 YYSTYPE yylval
; /* the semantic value of the */
328 /* lookahead symbol */
331 YYLTYPE yylloc
; /* location data for the lookahead */
335 int yynerrs
; /* number of parse errors so far */
336 #endif /* not YYPURE */
339 int yydebug
; /* nonzero means print parse trace */
340 /* Since this is uninitialized, it does not stop multiple parsers
344 /* YYINITDEPTH indicates the initial size of the parser's stacks */
347 #define YYINITDEPTH 200
350 /* YYMAXDEPTH is the maximum size the stacks can grow to
351 (effective only if the built-in stack extension method is used). */
358 #define YYMAXDEPTH 10000
361 /* Define __yy_memcpy. Note that the size argument
362 should be passed with type unsigned int, because that is what the non-GCC
363 definitions require. With GCC, __builtin_memcpy takes an arg
364 of type size_t, but it can handle unsigned int. */
366 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
367 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
368 #else /* not GNU C or C++ */
371 /* This is the most reliable way to avoid incompatibilities
372 in available built-in functions on various systems. */
374 __yy_memcpy ( to
, from
, count
)
379 register char * f
= from
;
380 register char * t
= to
;
381 register int i
= count
;
387 #else /* __cplusplus */
389 /* This is the most reliable way to avoid incompatibilities
390 in available built-in functions on various systems. */
392 __yy_memcpy ( char * to
, char * from
, unsigned int count
)
394 register char * t
= to
;
395 register char * f
= from
;
396 register int i
= count
;
405 #line 217 "/usr/share/misc/bison.simple"
407 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
408 into yyparse. The argument should have type void *.
409 It should actually point to an object.
410 Grammar actions can access the variable by casting it
411 to the proper pointer type. */
415 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
416 #define YYPARSE_PARAM_DECL
417 #else /* not __cplusplus */
418 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
419 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
420 #endif /* not __cplusplus */
421 #else /* not YYPARSE_PARAM */
422 #define YYPARSE_PARAM_ARG
423 #define YYPARSE_PARAM_DECL
424 #endif /* not YYPARSE_PARAM */
426 /* Prevent warning if -Wstrict-prototypes. */
429 int yyparse ( void *);
436 yyparse ( YYPARSE_PARAM_ARG
)
439 register int yystate
;
441 register short * yyssp
;
442 register YYSTYPE
* yyvsp
;
443 int yyerrstatus
; /* number of tokens to shift before error messages enabled */
444 int yychar1
= 0 ; /* lookahead token as an internal (translated) token number */
446 short yyssa
[ YYINITDEPTH
]; /* the state stack */
447 YYSTYPE yyvsa
[ YYINITDEPTH
]; /* the semantic value stack */
449 short * yyss
= yyssa
; /* refer to the stacks thru separate pointers */
450 YYSTYPE
* yyvs
= yyvsa
; /* to allow yyoverflow to reallocate them elsewhere */
453 YYLTYPE yylsa
[ YYINITDEPTH
]; /* the location stack */
454 YYLTYPE
* yyls
= yylsa
;
457 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
459 #define YYPOPSTACK (yyvsp--, yyssp--)
462 int yystacksize
= YYINITDEPTH
;
463 int yyfree_stacks
= 0 ;
474 YYSTYPE yyval
; /* the variable used to return */
475 /* semantic values from the action */
482 fprintf ( stderr
, "Starting parse \n " );
488 yychar
= YYEMPTY
; /* Cause a token to be read. */
490 /* Initialize stack pointers.
491 Waste one element of value and location stack
492 so that they stay on the same level as the state stack.
493 The wasted elements are never initialized. */
501 /* Push a new state, which is found in yystate . */
502 /* In all cases, when you get here, the value and location stacks
503 have just been pushed. so pushing a state here evens the stacks. */
508 if ( yyssp
>= yyss
+ yystacksize
- 1 )
510 /* Give user a chance to reallocate the stack */
511 /* Use copies of these so that the &'s don't force the real ones into memory. */
512 YYSTYPE
* yyvs1
= yyvs
;
515 YYLTYPE
* yyls1
= yyls
;
518 /* Get the current used size of the three stacks, in elements. */
519 int size
= yyssp
- yyss
+ 1 ;
522 /* Each stack pointer address is followed by the size of
523 the data in use in that stack, in bytes. */
525 /* This used to be a conditional around just the two extra args,
526 but that might be undefined if yyoverflow is a macro. */
527 yyoverflow ( "parser stack overflow" ,
528 & yyss1
, size
* sizeof (* yyssp
),
529 & yyvs1
, size
* sizeof (* yyvsp
),
530 & yyls1
, size
* sizeof (* yylsp
),
533 yyoverflow ( "parser stack overflow" ,
534 & yyss1
, size
* sizeof (* yyssp
),
535 & yyvs1
, size
* sizeof (* yyvsp
),
539 yyss
= yyss1
; yyvs
= yyvs1
;
543 #else /* no yyoverflow */
544 /* Extend the stack our own way. */
545 if ( yystacksize
>= YYMAXDEPTH
)
547 yyerror ( "parser stack overflow" );
559 if ( yystacksize
> YYMAXDEPTH
)
560 yystacksize
= YYMAXDEPTH
;
561 #ifndef YYSTACK_USE_ALLOCA
564 yyss
= ( short *) YYSTACK_ALLOC ( yystacksize
* sizeof (* yyssp
));
565 __yy_memcpy (( char *) yyss
, ( char *) yyss1
,
566 size
* ( unsigned int ) sizeof (* yyssp
));
567 yyvs
= ( YYSTYPE
*) YYSTACK_ALLOC ( yystacksize
* sizeof (* yyvsp
));
568 __yy_memcpy (( char *) yyvs
, ( char *) yyvs1
,
569 size
* ( unsigned int ) sizeof (* yyvsp
));
571 yyls
= ( YYLTYPE
*) YYSTACK_ALLOC ( yystacksize
* sizeof (* yylsp
));
572 __yy_memcpy (( char *) yyls
, ( char *) yyls1
,
573 size
* ( unsigned int ) sizeof (* yylsp
));
575 #endif /* no yyoverflow */
577 yyssp
= yyss
+ size
- 1 ;
578 yyvsp
= yyvs
+ size
- 1 ;
580 yylsp
= yyls
+ size
- 1 ;
585 fprintf ( stderr
, "Stack size increased to %d \n " , yystacksize
);
588 if ( yyssp
>= yyss
+ yystacksize
- 1 )
594 fprintf ( stderr
, "Entering state %d \n " , yystate
);
600 /* Do appropriate processing given the current state. */
601 /* Read a lookahead token if we need one and don't already have one. */
604 /* First try to decide what to do without reference to lookahead token. */
606 yyn
= yypact
[ yystate
];
610 /* Not known => get a lookahead token if don't already have one. */
612 /* yychar is either YYEMPTY or YYEOF
613 or a valid token in external form. */
615 if ( yychar
== YYEMPTY
)
619 fprintf ( stderr
, "Reading a token: " );
624 /* Convert token to internal form (in yychar1) for indexing tables with */
626 if ( yychar
<= 0 ) /* This means end of input. */
629 yychar
= YYEOF
; /* Don't call YYLEX any more */
633 fprintf ( stderr
, "Now at end of input. \n " );
638 yychar1
= YYTRANSLATE ( yychar
);
643 fprintf ( stderr
, "Next token is %d ( %s " , yychar
, yytname
[ yychar1
]);
644 /* Give the individual parser a way to print the precise meaning
645 of a token, for further debugging info. */
647 YYPRINT ( stderr
, yychar
, yylval
);
649 fprintf ( stderr
, ") \n " );
655 if ( yyn
< 0 || yyn
> YYLAST
|| yycheck
[ yyn
] != yychar1
)
660 /* yyn is what to do for this token type in this state.
661 Negative => reduce, -yyn is rule number.
662 Positive => shift, yyn is new state.
663 New state is final state => don't bother to shift,
665 0, or most negative number => error. */
680 /* Shift the lookahead token. */
684 fprintf ( stderr
, "Shifting token %d ( %s ), " , yychar
, yytname
[ yychar1
]);
687 /* Discard the token being shifted unless it is eof. */
696 /* count tokens shifted since error; after three, turn off error status. */
697 if ( yyerrstatus
) yyerrstatus
--;
702 /* Do the default action for the current state. */
705 yyn
= yydefact
[ yystate
];
709 /* Do a reduction. yyn is the number of a rule to reduce with. */
713 yyval
= yyvsp
[ 1 - yylen
]; /* implement default value of the action */
720 fprintf ( stderr
, "Reducing via rule %d (line %d ), " ,
723 /* Print the symbols being reduced, and their result. */
724 for ( i
= yyprhs
[ yyn
]; yyrhs
[ i
] > 0 ; i
++)
725 fprintf ( stderr
, " %s " , yytname
[ yyrhs
[ i
]]);
726 fprintf ( stderr
, " -> %s \n " , yytname
[ yyr1
[ yyn
]]);
736 (( parser
*) parser_obj
)-> setAction ( yyvsp
[- 2 ]);
737 (( parser
*) parser_obj
)-> endAction ();
743 (( parser
*) parser_obj
)-> endChain ();
748 { (( parser
*) parser_obj
)-> startChain (); ;
752 { /* ((parser*)parser_obj)->endChain(); */ ;
756 { (( parser
*) parser_obj
)-> addModifier ( yyvsp
[- 2 ]); ;
760 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
764 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
768 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
772 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
776 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
780 { (( parser
*) parser_obj
)-> setKey ( yyvsp
[ 0 ]); ;
784 { (( parser
*) parser_obj
)-> setArgumentNum ( yyvsp
[ 0 ]); ;
788 { (( parser
*) parser_obj
)-> setArgumentNegNum ( yyvsp
[ 0 ]); ;
792 { (( parser
*) parser_obj
)-> setArgumentStr ( yyvsp
[ 0 ]); ;
796 { (( parser
*) parser_obj
)-> setArgumentTrue ( yyvsp
[ 0 ]); ;
800 { (( parser
*) parser_obj
)-> setArgumentFalse ( yyvsp
[ 0 ]); ;
804 { (( parser
*) parser_obj
)-> setOption ( yyvsp
[- 2 ]); ;
807 /* the action file gets copied in in place of this dollarsign */
808 #line 543 "/usr/share/misc/bison.simple"
819 short * ssp1
= yyss
- 1 ;
820 fprintf ( stderr
, "state stack now" );
821 while ( ssp1
!= yyssp
)
822 fprintf ( stderr
, " %d " , *++ ssp1
);
823 fprintf ( stderr
, " \n " );
833 yylsp
-> first_line
= yylloc
. first_line
;
834 yylsp
-> first_column
= yylloc
. first_column
;
835 yylsp
-> last_line
= ( yylsp
- 1 )-> last_line
;
836 yylsp
-> last_column
= ( yylsp
- 1 )-> last_column
;
841 yylsp
-> last_line
= ( yylsp
+ yylen
- 1 )-> last_line
;
842 yylsp
-> last_column
= ( yylsp
+ yylen
- 1 )-> last_column
;
846 /* Now "shift" the result of the reduction.
847 Determine what state that goes to,
848 based on the state we popped back to
849 and the rule number reduced by. */
853 yystate
= yypgoto
[ yyn
- YYNTBASE
] + * yyssp
;
854 if ( yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[ yystate
] == * yyssp
)
855 yystate
= yytable
[ yystate
];
857 yystate
= yydefgoto
[ yyn
- YYNTBASE
];
861 yyerrlab
: /* here on detecting error */
864 /* If not already recovering from an error, report this error. */
868 #ifdef YYERROR_VERBOSE
869 yyn
= yypact
[ yystate
];
871 if ( yyn
> YYFLAG
&& yyn
< YYLAST
)
878 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
879 for ( x
= ( yyn
< 0 ? - yyn
: 0 );
880 x
< ( sizeof ( yytname
) / sizeof ( char *)); x
++)
881 if ( yycheck
[ x
+ yyn
] == x
)
882 size
+= strlen ( yytname
[ x
]) + 15 , count
++;
883 msg
= ( char *) malloc ( size
+ 15 );
886 strcpy ( msg
, "parse error" );
891 for ( x
= ( yyn
< 0 ? - yyn
: 0 );
892 x
< ( sizeof ( yytname
) / sizeof ( char *)); x
++)
893 if ( yycheck
[ x
+ yyn
] == x
)
895 strcat ( msg
, count
== 0 ? ", expecting `" : " or `" );
896 strcat ( msg
, yytname
[ x
]);
905 yyerror ( "parse error; also virtual memory exceeded" );
908 #endif /* YYERROR_VERBOSE */
909 yyerror ( "parse error" );
913 yyerrlab1
: /* here on error raised explicitly by an action */
915 if ( yyerrstatus
== 3 )
917 /* if just tried and failed to reuse lookahead token after an error, discard it. */
919 /* return failure if at end of input */
925 fprintf ( stderr
, "Discarding token %d ( %s ). \n " , yychar
, yytname
[ yychar1
]);
931 /* Else will try to reuse lookahead token
932 after shifting the error token. */
934 yyerrstatus
= 3 ; /* Each real token shifted decrements this */
938 yyerrdefault
: /* current state does not do anything special for the error token. */
941 /* This is wrong; only states that explicitly want error tokens
942 should shift them. */
943 yyn
= yydefact
[ yystate
]; /* If its default is to accept any token, ok. Otherwise pop it.*/
944 if ( yyn
) goto yydefault
;
947 yyerrpop
: /* pop the current state because it cannot handle the error token */
949 if ( yyssp
== yyss
) YYABORT
;
959 short * ssp1
= yyss
- 1 ;
960 fprintf ( stderr
, "Error: state stack now" );
961 while ( ssp1
!= yyssp
)
962 fprintf ( stderr
, " %d " , *++ ssp1
);
963 fprintf ( stderr
, " \n " );
969 yyn
= yypact
[ yystate
];
974 if ( yyn
< 0 || yyn
> YYLAST
|| yycheck
[ yyn
] != YYTERROR
)
993 fprintf ( stderr
, "Shifting error token, " );
1005 /* YYACCEPT comes here. */
1017 /* YYABORT comes here. */
This page took 0.084218 seconds and 4 git commands to generate.