]> git.saurik.com Git - bison.git/blob - data/lalr1.java
Version 2.4.1a.
[bison.git] / data / lalr1.java
1 # Java skeleton for Bison -*- autoconf -*-
2
3 # Copyright (C) 2007-2010 Free Software Foundation, Inc.
4
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 m4_include(b4_pkgdatadir/[java.m4])
19
20 b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java], [b4_skeleton])])
21 m4_ifval(m4_defn([b4_symbol_destructors]),
22 [b4_fatal([%s: %%destructor does not make sense in Java], [b4_skeleton])],
23 [])
24
25 m4_divert_push(0)dnl
26 @output(b4_parser_file_name@)@
27 b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
28 [2007-2010])
29
30 b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
31 ])[/* First part of user declarations. */
32 ]b4_pre_prologue
33 b4_percent_code_get([[imports]])
34 [/**
35 * A Bison parser, automatically generated from <tt>]m4_bpatsubst(b4_file_name, [^"\(.*\)"$], [\1])[</tt>.
36 *
37 * @@author LALR (1) parser skeleton written by Paolo Bonzini.
38 */
39 ]b4_public_if([public ])dnl
40 b4_abstract_if([abstract ])dnl
41 b4_final_if([final ])dnl
42 b4_strictfp_if([strictfp ])dnl
43 [class ]b4_parser_class_name[]dnl
44 b4_percent_define_get3([extends], [ extends ])dnl
45 b4_percent_define_get3([implements], [ implements ])[
46 {
47 ]b4_identification[
48
49 /** True if verbose error messages are enabled. */
50 public boolean errorVerbose = ]b4_flag_value([error_verbose]);
51
52 b4_locations_if([[
53 /**
54 * A class defining a pair of positions. Positions, defined by the
55 * <code>]b4_position_type[</code> class, denote a point in the input.
56 * Locations represent a part of the input through the beginning
57 * and ending positions. */
58 public class ]b4_location_type[ {
59 /** The first, inclusive, position in the range. */
60 public ]b4_position_type[ begin;
61
62 /** The first position beyond the range. */
63 public ]b4_position_type[ end;
64
65 /**
66 * Create a <code>]b4_location_type[</code> denoting an empty range located at
67 * a given point.
68 * @@param loc The position at which the range is anchored. */
69 public ]b4_location_type[ (]b4_position_type[ loc) {
70 this.begin = this.end = loc;
71 }
72
73 /**
74 * Create a <code>]b4_location_type[</code> from the endpoints of the range.
75 * @@param begin The first position included in the range.
76 * @@param end The first position beyond the range. */
77 public ]b4_location_type[ (]b4_position_type[ begin, ]b4_position_type[ end) {
78 this.begin = begin;
79 this.end = end;
80 }
81
82 /**
83 * Print a representation of the location. For this to be correct,
84 * <code>]b4_position_type[</code> should override the <code>equals</code>
85 * method. */
86 public String toString () {
87 if (begin.equals (end))
88 return begin.toString ();
89 else
90 return begin.toString () + "-" + end.toString ();
91 }
92 }
93
94 ]])
95
96 [ /** Token returned by the scanner to signal the end of its input. */
97 public static final int EOF = 0;]
98
99 b4_token_enums(b4_tokens)
100
101 b4_locations_if([[
102 private ]b4_location_type[ yylloc (YYStack rhs, int n)
103 {
104 if (n > 0)
105 return new ]b4_location_type[ (rhs.locationAt (1).begin, rhs.locationAt (n).end);
106 else
107 return new ]b4_location_type[ (rhs.locationAt (0).end);
108 }]])[
109
110 /**
111 * Communication interface between the scanner and the Bison-generated
112 * parser <tt>]b4_parser_class_name[</tt>.
113 */
114 public interface Lexer {
115 ]b4_locations_if([[/**
116 * Method to retrieve the beginning position of the last scanned token.
117 * @@return the position at which the last scanned token starts. */
118 ]b4_position_type[ getStartPos ();
119
120 /**
121 * Method to retrieve the ending position of the last scanned token.
122 * @@return the first position beyond the last scanned token. */
123 ]b4_position_type[ getEndPos ();]])[
124
125 /**
126 * Method to retrieve the semantic value of the last scanned token.
127 * @@return the semantic value of the last scanned token. */
128 ]b4_yystype[ getLVal ();
129
130 /**
131 * Entry point for the scanner. Returns the token identifier corresponding
132 * to the next token and prepares to return the semantic value
133 * ]b4_locations_if([and beginning/ending positions ])[of the token.
134 * @@return the token identifier corresponding to the next token. */
135 int yylex () ]b4_maybe_throws([b4_lex_throws])[;
136
137 /**
138 * Entry point for error reporting. Emits an error
139 * ]b4_locations_if([referring to the given location ])[in a user-defined way.
140 *
141 * ]b4_locations_if([[@@param loc The location of the element to which the
142 * error message is related]])[
143 * @@param s The string for the error message. */
144 void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s);]
145 }
146
147 b4_lexer_if([[private class YYLexer implements Lexer {
148 ]b4_percent_code_get([[lexer]])[
149 }
150
151 ]])[/** The object doing lexical analysis for us. */
152 private Lexer yylexer;
153 ]
154 b4_parse_param_vars
155
156 b4_lexer_if([[
157 /**
158 * Instantiates the Bison-generated parser.
159 */
160 public ]b4_parser_class_name (b4_parse_param_decl([b4_lex_param_decl])[) {
161 this.yylexer = new YYLexer(]b4_lex_param_call[);
162 ]b4_parse_param_cons[
163 }
164 ]])
165
166 /**
167 * Instantiates the Bison-generated parser.
168 * @@param yylexer The scanner that will supply tokens to the parser.
169 */
170 b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) {
171 this.yylexer = yylexer;
172 ]b4_parse_param_cons[
173 }
174
175 private java.io.PrintStream yyDebugStream = System.err;
176
177 /**
178 * Return the <tt>PrintStream</tt> on which the debugging output is
179 * printed.
180 */
181 public final java.io.PrintStream getDebugStream () { return yyDebugStream; }
182
183 /**
184 * Set the <tt>PrintStream</tt> on which the debug output is printed.
185 * @@param s The stream that is used for debugging output.
186 */
187 public final void setDebugStream(java.io.PrintStream s) { yyDebugStream = s; }
188
189 private int yydebug = 0;
190
191 /**
192 * Answer the verbosity of the debugging output; 0 means that all kinds of
193 * output from the parser are suppressed.
194 */
195 public final int getDebugLevel() { return yydebug; }
196
197 /**
198 * Set the verbosity of the debugging output; 0 means that all kinds of
199 * output from the parser are suppressed.
200 * @@param level The verbosity level for debugging output.
201 */
202 public final void setDebugLevel(int level) { yydebug = level; }
203
204 private final int yylex () ]b4_maybe_throws([b4_lex_throws]) [{
205 return yylexer.yylex ();
206 }
207 protected final void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s) {
208 yylexer.yyerror (]b4_locations_if([loc, ])[s);
209 }
210
211 ]b4_locations_if([
212 protected final void yyerror (String s) {
213 yylexer.yyerror ((]b4_location_type[)null, s);
214 }
215 protected final void yyerror (]b4_position_type[ loc, String s) {
216 yylexer.yyerror (new ]b4_location_type[ (loc), s);
217 }])
218
219 [protected final void yycdebug (String s) {
220 if (yydebug > 0)
221 yyDebugStream.println (s);
222 }
223
224 private final class YYStack {
225 private int[] stateStack = new int[16];
226 ]b4_locations_if([[private ]b4_location_type[[] locStack = new ]b4_location_type[[16];]])[
227 private ]b4_yystype[[] valueStack = new ]b4_yystype[[16];
228
229 public int size = 16;
230 public int height = -1;
231
232 public final void push (int state, ]b4_yystype[ value]dnl
233 b4_locations_if([, ]b4_location_type[ loc])[) {
234 height++;
235 if (size == height)
236 {
237 int[] newStateStack = new int[size * 2];
238 System.arraycopy (stateStack, 0, newStateStack, 0, height);
239 stateStack = newStateStack;
240 ]b4_locations_if([[
241 ]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2];
242 System.arraycopy (locStack, 0, newLocStack, 0, height);
243 locStack = newLocStack;]])
244
245 b4_yystype[[] newValueStack = new ]b4_yystype[[size * 2];
246 System.arraycopy (valueStack, 0, newValueStack, 0, height);
247 valueStack = newValueStack;
248
249 size *= 2;
250 }
251
252 stateStack[height] = state;
253 ]b4_locations_if([[locStack[height] = loc;]])[
254 valueStack[height] = value;
255 }
256
257 public final void pop () {
258 height--;
259 }
260
261 public final void pop (int num) {
262 // Avoid memory leaks... garbage collection is a white lie!
263 if (num > 0) {
264 java.util.Arrays.fill (valueStack, height - num + 1, height, null);
265 ]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
266 }
267 height -= num;
268 }
269
270 public final int stateAt (int i) {
271 return stateStack[height - i];
272 }
273
274 ]b4_locations_if([[public final ]b4_location_type[ locationAt (int i) {
275 return locStack[height - i];
276 }
277
278 ]])[public final ]b4_yystype[ valueAt (int i) {
279 return valueStack[height - i];
280 }
281
282 // Print the state stack on the debug stream.
283 public void print (java.io.PrintStream out)
284 {
285 out.print ("Stack now");
286
287 for (int i = 0; i < height; i++)
288 {
289 out.print (' ');
290 out.print (stateStack[i]);
291 }
292 out.println ();
293 }
294 }
295
296 /**
297 * Returned by a Bison action in order to stop the parsing process and
298 * return success (<tt>true</tt>). */
299 public static final int YYACCEPT = 0;
300
301 /**
302 * Returned by a Bison action in order to stop the parsing process and
303 * return failure (<tt>false</tt>). */
304 public static final int YYABORT = 1;
305
306 /**
307 * Returned by a Bison action in order to start error recovery without
308 * printing an error message. */
309 public static final int YYERROR = 2;
310
311 /**
312 * Returned by a Bison action in order to print an error message and start
313 * error recovery. Formally deprecated in Bison 2.4.2's NEWS entry, where
314 * a plan to phase it out is discussed. */
315 public static final int YYFAIL = 3;
316
317 private static final int YYNEWSTATE = 4;
318 private static final int YYDEFAULT = 5;
319 private static final int YYREDUCE = 6;
320 private static final int YYERRLAB1 = 7;
321 private static final int YYRETURN = 8;
322
323 private int yyerrstatus_ = 0;
324
325 /**
326 * Return whether error recovery is being done. In this state, the parser
327 * reads token until it reaches a known state, and then restarts normal
328 * operation. */
329 public final boolean recovering ()
330 {
331 return yyerrstatus_ == 0;
332 }
333
334 private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[
335 {
336 ]b4_yystype[ yyval;
337 ]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[
338
339 /* If YYLEN is nonzero, implement the default value of the action:
340 `$$ = $1'. Otherwise, use the top of the stack.
341
342 Otherwise, the following line sets YYVAL to garbage.
343 This behavior is undocumented and Bison
344 users should not rely upon it. */
345 if (yylen > 0)
346 yyval = yystack.valueAt (yylen - 1);
347 else
348 yyval = yystack.valueAt (0);
349
350 yy_reduce_print (yyn, yystack);
351
352 switch (yyn)
353 {
354 ]b4_user_actions[
355 default: break;
356 }
357
358 yy_symbol_print ("-> $$ =", yyr1_[yyn], yyval]b4_locations_if([, yyloc])[);
359
360 yystack.pop (yylen);
361 yylen = 0;
362
363 /* Shift the result of the reduction. */
364 yyn = yyr1_[yyn];
365 int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0);
366 if (0 <= yystate && yystate <= yylast_
367 && yycheck_[yystate] == yystack.stateAt (0))
368 yystate = yytable_[yystate];
369 else
370 yystate = yydefgoto_[yyn - yyntokens_];
371
372 yystack.push (yystate, yyval]b4_locations_if([, yyloc])[);
373 return YYNEWSTATE;
374 }
375
376 /* Return YYSTR after stripping away unnecessary quotes and
377 backslashes, so that it's suitable for yyerror. The heuristic is
378 that double-quoting is unnecessary unless the string contains an
379 apostrophe, a comma, or backslash (other than backslash-backslash).
380 YYSTR is taken from yytname. */
381 private final String yytnamerr_ (String yystr)
382 {
383 if (yystr.charAt (0) == '"')
384 {
385 StringBuffer yyr = new StringBuffer ();
386 strip_quotes: for (int i = 1; i < yystr.length (); i++)
387 switch (yystr.charAt (i))
388 {
389 case '\'':
390 case ',':
391 break strip_quotes;
392
393 case '\\':
394 if (yystr.charAt(++i) != '\\')
395 break strip_quotes;
396 /* Fall through. */
397 default:
398 yyr.append (yystr.charAt (i));
399 break;
400
401 case '"':
402 return yyr.toString ();
403 }
404 }
405 else if (yystr.equals ("$end"))
406 return "end of input";
407
408 return yystr;
409 }
410
411 /*--------------------------------.
412 | Print this symbol on YYOUTPUT. |
413 `--------------------------------*/
414
415 private void yy_symbol_print (String s, int yytype,
416 ]b4_yystype[ yyvaluep]dnl
417 b4_locations_if([, Object yylocationp])[)
418 {
419 if (yydebug > 0)
420 yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ")
421 + yytname_[yytype] + " ("]b4_locations_if([
422 + yylocationp + ": "])[
423 + (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")");
424 }
425
426 /**
427 * Parse input from the scanner that was specified at object construction
428 * time. Return whether the end of the input was reached successfully.
429 *
430 * @@return <tt>true</tt> if the parsing succeeds. Note that this does not
431 * imply that there were no syntax errors.
432 */
433 public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[
434 {
435 /// Lookahead and lookahead in internal form.
436 int yychar = yyempty_;
437 int yytoken = 0;
438
439 /* State. */
440 int yyn = 0;
441 int yylen = 0;
442 int yystate = 0;
443
444 YYStack yystack = new YYStack ();
445
446 /* Error handling. */
447 int yynerrs_ = 0;
448 ]b4_locations_if([/// The location where the error started.
449 ]b4_location_type[ yyerrloc = null;
450
451 /// ]b4_location_type[ of the lookahead.
452 ]b4_location_type[ yylloc = new ]b4_location_type[ (null, null);
453
454 /// @@$.
455 ]b4_location_type[ yyloc;])
456
457 /// Semantic value of the lookahead.
458 b4_yystype[ yylval = null;
459
460 int yyresult;
461
462 yycdebug ("Starting parse\n");
463 yyerrstatus_ = 0;
464
465 ]m4_ifdef([b4_initial_action], [
466 m4_pushdef([b4_at_dollar], [yylloc])dnl
467 m4_pushdef([b4_dollar_dollar], [yylval])dnl
468 /* User initialization code. */
469 b4_user_initial_action
470 m4_popdef([b4_dollar_dollar])dnl
471 m4_popdef([b4_at_dollar])])dnl
472
473 [ /* Initialize the stack. */
474 yystack.push (yystate, yylval]b4_locations_if([, yylloc])[);
475
476 int label = YYNEWSTATE;
477 for (;;)
478 switch (label)
479 {
480 /* New state. Unlike in the C/C++ skeletons, the state is already
481 pushed when we come here. */
482 case YYNEWSTATE:
483 yycdebug ("Entering state " + yystate + "\n");
484 if (yydebug > 0)
485 yystack.print (yyDebugStream);
486
487 /* Accept? */
488 if (yystate == yyfinal_)
489 return true;
490
491 /* Take a decision. First try without lookahead. */
492 yyn = yypact_[yystate];
493 if (yyn == yypact_ninf_)
494 {
495 label = YYDEFAULT;
496 break;
497 }
498
499 /* Read a lookahead token. */
500 if (yychar == yyempty_)
501 {
502 yycdebug ("Reading a token: ");
503 yychar = yylex ();]
504 b4_locations_if([[
505 yylloc = new ]b4_location_type[(yylexer.getStartPos (),
506 yylexer.getEndPos ());]])
507 yylval = yylexer.getLVal ();[
508 }
509
510 /* Convert token to internal form. */
511 if (yychar <= EOF)
512 {
513 yychar = yytoken = EOF;
514 yycdebug ("Now at end of input.\n");
515 }
516 else
517 {
518 yytoken = yytranslate_ (yychar);
519 yy_symbol_print ("Next token is", yytoken,
520 yylval]b4_locations_if([, yylloc])[);
521 }
522
523 /* If the proper action on seeing token YYTOKEN is to reduce or to
524 detect an error, take that action. */
525 yyn += yytoken;
526 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
527 label = YYDEFAULT;
528
529 /* <= 0 means reduce or error. */
530 else if ((yyn = yytable_[yyn]) <= 0)
531 {
532 if (yyn == 0 || yyn == yytable_ninf_)
533 label = YYFAIL;
534 else
535 {
536 yyn = -yyn;
537 label = YYREDUCE;
538 }
539 }
540
541 else
542 {
543 /* Shift the lookahead token. */
544 yy_symbol_print ("Shifting", yytoken,
545 yylval]b4_locations_if([, yylloc])[);
546
547 /* Discard the token being shifted. */
548 yychar = yyempty_;
549
550 /* Count tokens shifted since error; after three, turn off error
551 status. */
552 if (yyerrstatus_ > 0)
553 --yyerrstatus_;
554
555 yystate = yyn;
556 yystack.push (yystate, yylval]b4_locations_if([, yylloc])[);
557 label = YYNEWSTATE;
558 }
559 break;
560
561 /*-----------------------------------------------------------.
562 | yydefault -- do the default action for the current state. |
563 `-----------------------------------------------------------*/
564 case YYDEFAULT:
565 yyn = yydefact_[yystate];
566 if (yyn == 0)
567 label = YYFAIL;
568 else
569 label = YYREDUCE;
570 break;
571
572 /*-----------------------------.
573 | yyreduce -- Do a reduction. |
574 `-----------------------------*/
575 case YYREDUCE:
576 yylen = yyr2_[yyn];
577 label = yyaction (yyn, yystack, yylen);
578 yystate = yystack.stateAt (0);
579 break;
580
581 /*------------------------------------.
582 | yyerrlab -- here on detecting error |
583 `------------------------------------*/
584 case YYFAIL:
585 /* If not already recovering from an error, report this error. */
586 if (yyerrstatus_ == 0)
587 {
588 ++yynerrs_;
589 yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
590 }
591
592 ]b4_locations_if([yyerrloc = yylloc;])[
593 if (yyerrstatus_ == 3)
594 {
595 /* If just tried and failed to reuse lookahead token after an
596 error, discard it. */
597
598 if (yychar <= EOF)
599 {
600 /* Return failure if at end of input. */
601 if (yychar == EOF)
602 return false;
603 }
604 else
605 yychar = yyempty_;
606 }
607
608 /* Else will try to reuse lookahead token after shifting the error
609 token. */
610 label = YYERRLAB1;
611 break;
612
613 /*---------------------------------------------------.
614 | errorlab -- error raised explicitly by YYERROR. |
615 `---------------------------------------------------*/
616 case YYERROR:
617
618 ]b4_locations_if([yyerrloc = yystack.locationAt (yylen - 1);])[
619 /* Do not reclaim the symbols of the rule which action triggered
620 this YYERROR. */
621 yystack.pop (yylen);
622 yylen = 0;
623 yystate = yystack.stateAt (0);
624 label = YYERRLAB1;
625 break;
626
627 /*-------------------------------------------------------------.
628 | yyerrlab1 -- common code for both syntax error and YYERROR. |
629 `-------------------------------------------------------------*/
630 case YYERRLAB1:
631 yyerrstatus_ = 3; /* Each real token shifted decrements this. */
632
633 for (;;)
634 {
635 yyn = yypact_[yystate];
636 if (yyn != yypact_ninf_)
637 {
638 yyn += yyterror_;
639 if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
640 {
641 yyn = yytable_[yyn];
642 if (0 < yyn)
643 break;
644 }
645 }
646
647 /* Pop the current state because it cannot handle the error token. */
648 if (yystack.height == 1)
649 return false;
650
651 ]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
652 yystack.pop ();
653 yystate = yystack.stateAt (0);
654 if (yydebug > 0)
655 yystack.print (yyDebugStream);
656 }
657
658 ]b4_locations_if([
659 /* Muck with the stack to setup for yylloc. */
660 yystack.push (0, null, yylloc);
661 yystack.push (0, null, yyerrloc);
662 yyloc = yylloc (yystack, 2);
663 yystack.pop (2);])[
664
665 /* Shift the error token. */
666 yy_symbol_print ("Shifting", yystos_[yyn],
667 yylval]b4_locations_if([, yyloc])[);
668
669 yystate = yyn;
670 yystack.push (yyn, yylval]b4_locations_if([, yyloc])[);
671 label = YYNEWSTATE;
672 break;
673
674 /* Accept. */
675 case YYACCEPT:
676 return true;
677
678 /* Abort. */
679 case YYABORT:
680 return false;
681 }
682 }
683
684 // Generate an error message.
685 private String yysyntax_error (int yystate, int tok)
686 {
687 if (errorVerbose)
688 {
689 int yyn = yypact_[yystate];
690 if (yypact_ninf_ < yyn && yyn <= yylast_)
691 {
692 StringBuffer res;
693
694 /* Start YYX at -YYN if negative to avoid negative indexes in
695 YYCHECK. */
696 int yyxbegin = yyn < 0 ? -yyn : 0;
697
698 /* Stay within bounds of both yycheck and yytname. */
699 int yychecklim = yylast_ - yyn + 1;
700 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
701 int count = 0;
702 for (int x = yyxbegin; x < yyxend; ++x)
703 if (yycheck_[x + yyn] == x && x != yyterror_)
704 ++count;
705
706 // FIXME: This method of building the message is not compatible
707 // with internationalization.
708 res = new StringBuffer ("syntax error, unexpected ");
709 res.append (yytnamerr_ (yytname_[tok]));
710 if (count < 5)
711 {
712 count = 0;
713 for (int x = yyxbegin; x < yyxend; ++x)
714 if (yycheck_[x + yyn] == x && x != yyterror_)
715 {
716 res.append (count++ == 0 ? ", expecting " : " or ");
717 res.append (yytnamerr_ (yytname_[x]));
718 }
719 }
720 return res.toString ();
721 }
722 }
723
724 return "syntax error";
725 }
726
727
728 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
729 STATE-NUM. */
730 private static final ]b4_int_type_for([b4_pact])[ yypact_ninf_ = ]b4_pact_ninf[;
731 private static final ]b4_int_type_for([b4_pact])[ yypact_[] =
732 {
733 ]b4_pact[
734 };
735
736 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
737 doesn't specify something else to do. Zero means the default is an
738 error. */
739 private static final ]b4_int_type_for([b4_defact])[ yydefact_[] =
740 {
741 ]b4_defact[
742 };
743
744 /* YYPGOTO[NTERM-NUM]. */
745 private static final ]b4_int_type_for([b4_pgoto])[ yypgoto_[] =
746 {
747 ]b4_pgoto[
748 };
749
750 /* YYDEFGOTO[NTERM-NUM]. */
751 private static final ]b4_int_type_for([b4_defgoto])[
752 yydefgoto_[] =
753 {
754 ]b4_defgoto[
755 };
756
757 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
758 positive, shift that token. If negative, reduce the rule which
759 number is the opposite. If zero, do what YYDEFACT says. */
760 private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
761 private static final ]b4_int_type_for([b4_table])[
762 yytable_[] =
763 {
764 ]b4_table[
765 };
766
767 /* YYCHECK. */
768 private static final ]b4_int_type_for([b4_check])[
769 yycheck_[] =
770 {
771 ]b4_check[
772 };
773
774 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
775 symbol of state STATE-NUM. */
776 private static final ]b4_int_type_for([b4_stos])[
777 yystos_[] =
778 {
779 ]b4_stos[
780 };
781
782 /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
783 to YYLEX-NUM. */
784 private static final ]b4_int_type_for([b4_toknum])[
785 yytoken_number_[] =
786 {
787 ]b4_toknum[
788 };
789
790 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
791 private static final ]b4_int_type_for([b4_r1])[
792 yyr1_[] =
793 {
794 ]b4_r1[
795 };
796
797 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
798 private static final ]b4_int_type_for([b4_r2])[
799 yyr2_[] =
800 {
801 ]b4_r2[
802 };
803
804 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
805 First, the terminals, then, starting at \a yyntokens_, nonterminals. */
806 private static final String yytname_[] =
807 {
808 ]b4_tname[
809 };
810
811 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
812 private static final ]b4_int_type_for([b4_rhs])[ yyrhs_[] =
813 {
814 ]b4_rhs[
815 };
816
817 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
818 YYRHS. */
819 private static final ]b4_int_type_for([b4_prhs])[ yyprhs_[] =
820 {
821 ]b4_prhs[
822 };
823
824 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
825 private static final ]b4_int_type_for([b4_rline])[ yyrline_[] =
826 {
827 ]b4_rline[
828 };
829
830 // Report on the debug stream that the rule yyrule is going to be reduced.
831 private void yy_reduce_print (int yyrule, YYStack yystack)
832 {
833 if (yydebug == 0)
834 return;
835
836 int yylno = yyrline_[yyrule];
837 int yynrhs = yyr2_[yyrule];
838 /* Print the symbols being reduced, and their result. */
839 yycdebug ("Reducing stack by rule " + (yyrule - 1)
840 + " (line " + yylno + "), ");
841
842 /* The symbols being reduced. */
843 for (int yyi = 0; yyi < yynrhs; yyi++)
844 yy_symbol_print (" $" + (yyi + 1) + " =",
845 yyrhs_[yyprhs_[yyrule] + yyi],
846 ]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([,
847 b4_rhs_location(yynrhs, yyi + 1)])[);
848 }
849
850 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
851 private static final ]b4_int_type_for([b4_translate])[ yytranslate_table_[] =
852 {
853 ]b4_translate[
854 };
855
856 private static final ]b4_int_type_for([b4_translate])[ yytranslate_ (int t)
857 {
858 if (t >= 0 && t <= yyuser_token_number_max_)
859 return yytranslate_table_[t];
860 else
861 return yyundef_token_;
862 }
863
864 private static final int yylast_ = ]b4_last[;
865 private static final int yynnts_ = ]b4_nterms_number[;
866 private static final int yyempty_ = -2;
867 private static final int yyfinal_ = ]b4_final_state_number[;
868 private static final int yyterror_ = 1;
869 private static final int yyerrcode_ = 256;
870 private static final int yyntokens_ = ]b4_tokens_number[;
871
872 private static final int yyuser_token_number_max_ = ]b4_user_token_number_max[;
873 private static final int yyundef_token_ = ]b4_undef_token_number[;
874
875 ]/* User implementation code. */
876 b4_percent_code_get[]dnl
877
878 }
879
880 b4_epilogue
881 m4_divert_pop(0)dnl