]> git.saurik.com Git - bison.git/blob - data/lalr1.cc
* src/output.c (froms, tos): Are state_number_t.
[bison.git] / data / lalr1.cc
1 m4_divert(-1)
2 # C++ skeleton for Bison
3 # Copyright (C) 2002 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 2 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, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 # 02111-1307 USA
19
20 m4_include([c.m4])
21
22 # b4_lhs_value([TYPE])
23 # --------------------
24 # Expansion of $<TYPE>$.
25 m4_define([b4_lhs_value],
26 [yyval[]m4_ifval([$1], [.$1])])
27
28
29 # b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
30 # --------------------------------------
31 # Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
32 # symbols on RHS.
33 m4_define([b4_rhs_value],
34 [semantic_stack_@<:@m4_eval([$1 - $2])@:>@m4_ifval([$3], [.$3])])
35
36
37 # b4_lhs_location()
38 # -----------------
39 # Expansion of @$.
40 m4_define([b4_lhs_location],
41 [yyloc])
42
43
44 # b4_rhs_location(RULE-LENGTH, NUM)
45 # ---------------------------------
46 # Expansion of @NUM, where the current rule has RULE-LENGTH symbols
47 # on RHS.
48 m4_define([b4_rhs_location],
49 [location_stack_@<:@m4_eval([$1 - $2])@:>@])
50
51
52 m4_define_default([b4_input_suffix], [.y])
53
54 m4_define_default([b4_output_parser_suffix],
55 [m4_translit(b4_input_suffix, [yY], [cC])])
56
57 m4_define_default([b4_output_parser_name],
58 [b4_output_prefix[]b4_output_infix[]b4_output_parser_suffix[]])
59
60
61 m4_define_default([b4_output_header_suffix],
62 [m4_translit(b4_input_suffix, [yY], [hH])])
63
64 m4_define_default([b4_output_header_name],
65 [b4_output_prefix[]b4_output_infix[]b4_output_header_suffix[]])
66
67 m4_define_default([b4_header_guard],
68 [m4_bpatsubst(m4_toupper([BISON_]b4_output_header_name),
69 [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])])
70
71 m4_define([b4_inherit],
72 [m4_ifdef([b4_root],
73 [: public b4_root
74 ],
75 [])])
76
77 m4_define([b4_param],
78 [m4_ifdef([b4_root],
79 [,
80 const Param& param],
81 [])])
82
83 m4_define([b4_constructor],
84 [m4_ifdef([b4_root],
85 [b4_root (param),
86 ],
87 [])])
88
89
90 m4_divert(0)dnl
91 #output "b4_output_header_name"
92 b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
93 [2002])
94 #ifndef b4_header_guard
95 # define b4_header_guard
96
97 #include "stack.hh"
98 #include "location.hh"
99
100 #include <string>
101 #include <iostream>
102
103 /* Using locations. */
104 #define YYLSP_NEEDED b4_locations_flag
105
106 /* Copy the first part of user declarations. */
107 b4_pre_prologue
108
109 /* Line __line__ of __file__. */
110 #line __oline__ "__ofile__"
111
112 /* Tokens. */
113 b4_token_defines(b4_tokens)
114
115 /* Enabling traces. */
116 #ifndef YYDEBUG
117 # define YYDEBUG b4_debug
118 #endif
119
120 /* Enabling verbose error message. */
121 #ifndef YYERROR_VERBOSE
122 # define YYERROR_VERBOSE b4_error_verbose
123 #endif
124
125 #ifndef YYSTYPE
126 m4_ifdef([b4_stype],
127 [#line b4_stype_line "b4_filename"
128 typedef union b4_stype yystype;
129 /* Line __line__ of __file__. */
130 #line __oline__ "__ofile__"],
131 [typedef int yystype;])
132 # define YYSTYPE yystype
133 #endif
134
135 /* Copy the second part of user declarations. */
136 b4_post_prologue
137
138 /* Line __line__ of __file__. */
139 #line __oline__ "__ofile__"
140 #ifndef YYLLOC_DEFAULT
141 # define YYLLOC_DEFAULT(Current, Rhs, N) \
142 Current.last_line = Rhs[[N]].last_line; \
143 Current.last_column = Rhs[[N]].last_column;
144 #endif
145
146 m4_if(b4_locations_flag, [0], [],
147 [#ifndef YYLTYPE
148 typedef struct yyltype
149 {
150 int first_line;
151 int first_column;
152 int last_line;
153 int last_column;
154 } yyltype;
155 # define YYLTYPE yyltype
156 #endif])
157
158 namespace yy
159 {
160 class b4_name;
161
162 template < typename P >
163 struct Traits
164 {
165 };
166
167 template < >
168 struct Traits< b4_name >
169 {
170 typedef b4_uint_type(b4_translate_max) TokenNumberType;
171 typedef b4_sint_type(b4_rhs_max) RhsNumberType;
172 typedef int StateType;
173 typedef yystype SemanticType;
174 typedef b4_ltype LocationType;
175 };
176 }
177
178 namespace yy
179 {
180 class b4_name b4_inherit
181 {
182 public:
183
184 typedef Traits< b4_name >::TokenNumberType TokenNumberType;
185 typedef Traits< b4_name >::RhsNumberType RhsNumberType;
186 typedef Traits< b4_name >::StateType StateType;
187 typedef Traits< b4_name >::SemanticType SemanticType;
188 typedef Traits< b4_name >::LocationType LocationType;
189
190 typedef Stack< StateType > StateStack;
191 typedef Stack< SemanticType > SemanticStack;
192 typedef Stack< LocationType > LocationStack;
193
194 #if YYLSP_NEEDED
195 b4_name (bool debug,
196 LocationType initlocation[]b4_param) :
197 b4_constructor[]debug_ (debug),
198 cdebug_ (std::cerr),
199 initlocation_ (initlocation)
200 #else
201 b4_name (bool debug[]b4_param) :
202 b4_constructor[]debug_ (debug),
203 cdebug_ (std::cerr)
204 #endif
205 {
206 }
207
208 virtual ~b4_name ()
209 {
210 }
211
212 virtual int parse ();
213
214 private:
215
216 virtual void lex_ ();
217 virtual void error_ ();
218 virtual void print_ ();
219
220 /* Stacks. */
221 StateStack state_stack_;
222 SemanticStack semantic_stack_;
223 LocationStack location_stack_;
224
225 /* Tables. */
226 static const short pact_[[]];
227 static const short defact_[[]];
228 static const short pgoto_[[]];
229 static const short defgoto_[[]];
230 static const short table_[[]];
231 static const short check_[[]];
232 static const b4_uint_type(b4_r1_max) r1_[[]];
233 static const b4_uint_type(b4_r2_max) r2_[[]];
234
235 #if YYDEBUG || YYERROR_VERBOSE
236 static const char* const name_[[]];
237 #endif
238
239 /* More tables, for debugging. */
240 #if YYDEBUG
241 static const RhsNumberType rhs_[[]];
242 static const b4_uint_type(b4_prhs_max) prhs_[[]];
243 static const b4_uint_type(b4_rline_max) rline_[[]];
244 static const b4_uint_type(b4_stos_max) stos_[[]];
245 static const short token_number_[[]];
246 #endif
247
248 /* Even more tables. */
249 static inline TokenNumberType translate_ (int token);
250
251 /* Constants. */
252 static const int eof_;
253 static const int last_;
254 static const int flag_;
255 static const int nnts_;
256 static const int empty_;
257 static const int final_;
258 static const int terror_;
259 static const int errcode_;
260 static const int ntokens_;
261 static const int initdepth_;
262 static const unsigned user_token_number_max_;
263 static const TokenNumberType undef_token_;
264
265 /* State. */
266 int n_;
267 int len_;
268 int state_;
269
270 /* Debugging. */
271 int debug_;
272 std::ostream &cdebug_;
273
274 /* Lookahead and lookahead in internal form. */
275 int looka_;
276 int ilooka_;
277
278 /* Message. */
279 std::string message;
280
281 /* Semantic value and location of lookahead token. */
282 SemanticType value;
283 LocationType location;
284
285 /* @$ and $$. */
286 SemanticType yyval;
287 LocationType yyloc;
288
289 /* Initial location. */
290 LocationType initlocation_;
291 };
292 }
293
294 #endif /* not b4_header_guard */
295
296 #output "b4_output_prefix[]b4_output_infix[].cc"
297 b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
298 [2002])
299
300 #include "b4_output_header_name"
301
302 /* Enable debugging if requested. */
303 #if YYDEBUG
304 # define YYCDEBUG if (debug_) cdebug_
305 #else /* !YYDEBUG */
306 # define YYCDEBUG if (0) cdebug_
307 #endif /* !YYDEBUG */
308
309 int
310 yy::b4_name::parse ()
311 {
312 int nerrs = 0;
313 int errstatus = 0;
314
315 /* Initialize stack. */
316 state_stack_ = StateStack (0);
317 semantic_stack_ = SemanticStack (1);
318 location_stack_ = LocationStack (1);
319
320 /* Start. */
321 state_ = 0;
322 looka_ = empty_;
323 #if YYLSP_NEEDED
324 location = initlocation_;
325 #endif
326 YYCDEBUG << "Starting parse" << std::endl;
327
328 /* New state. */
329 yynewstate:
330 state_stack_.push (state_);
331 YYCDEBUG << "Entering state " << state_ << std::endl;
332 goto yybackup;
333
334 /* Backup. */
335 yybackup:
336
337 /* Try to take a decision without lookahead. */
338 n_ = pact_[[state_]];
339 if (n_ == flag_)
340 goto yydefault;
341
342 /* Read a lookahead token. */
343 if (looka_ == empty_)
344 {
345 YYCDEBUG << "Reading a token: ";
346 lex_ ();
347 }
348
349 /* Convert token to internal form. */
350 if (looka_ <= 0)
351 {
352 looka_ = eof_;
353 ilooka_ = 0;
354 YYCDEBUG << "Now at end of input." << std::endl;
355 }
356 else
357 {
358 ilooka_ = translate_ (looka_);
359 #if YYDEBUG
360 if (debug_)
361 {
362 YYCDEBUG << "Next token is " << looka_
363 << " (" << name_[[ilooka_]];
364 print_ ();
365 YYCDEBUG << ')' << std::endl;
366 }
367 #endif
368 }
369
370 n_ += ilooka_;
371 if (n_ < 0 || n_ > last_ || check_[[n_]] != ilooka_)
372 goto yydefault;
373
374 /* Reduce or error. */
375 n_ = table_[[n_]];
376 if (n_ < 0)
377 {
378 if (n_ == flag_)
379 goto yyerrlab;
380 else
381 {
382 n_ = -n_;
383 goto yyreduce;
384 }
385 }
386 else if (n_ == 0)
387 goto yyerrlab;
388
389 /* Accept? */
390 if (n_ == final_)
391 goto yyacceptlab;
392
393 /* Shift the lookahead token. */
394 YYCDEBUG << "Shifting token " << looka_
395 << " (" << name_[[ilooka_]] << "), ";
396
397 /* Discard the token being shifted unless it is eof. */
398 if (looka_ != eof_)
399 looka_ = empty_;
400
401 semantic_stack_.push (value);
402 location_stack_.push (location);
403
404 /* Count tokens shifted since error; after three, turn off error
405 status. */
406 if (errstatus)
407 --errstatus;
408
409 state_ = n_;
410 goto yynewstate;
411
412 /* Default action. */
413 yydefault:
414 n_ = defact_[[state_]];
415 if (n_ == 0)
416 goto yyerrlab;
417 goto yyreduce;
418
419 /* Reduce. */
420 yyreduce:
421 len_ = r2_[[n_]];
422 if (len_)
423 {
424 yyval = semantic_stack_[[len_ - 1]];
425 yyloc = location_stack_[[len_ - 1]];
426 }
427 else
428 {
429 yyval = semantic_stack_[[0]];
430 yyloc = location_stack_[[0]];
431 }
432
433 #if YYDEBUG
434 if (debug_)
435 {
436 YYCDEBUG << "Reducing via rule " << n_ - 1
437 << " (line " << rline_[[n_]] << "), ";
438 for (b4_uint_type(b4_prhs_max) i = prhs_[[n_]];
439 rhs_[[i]] >= 0; ++i)
440 YYCDEBUG << name_[[rhs_[i]]] << ' ';
441 YYCDEBUG << "-> " << name_[[r1_[n_]]] << std::endl;
442 }
443 #endif
444
445 if (len_)
446 {
447 Slice< LocationType, LocationStack > slice (location_stack_, len_);
448 YYLLOC_DEFAULT (yyloc, slice, len_);
449 }
450
451 switch (n_)
452 {
453 b4_actions
454 }
455
456 /* Line __line__ of __file__. */
457 #line __oline__ "__ofile__"
458
459 state_stack_.pop (len_);
460 semantic_stack_.pop (len_);
461 location_stack_.pop (len_);
462
463 #if YYDEBUG
464 if (debug_)
465 {
466 YYCDEBUG << "state stack now";
467 for (StateStack::ConstIterator i = state_stack_.begin ();
468 i != state_stack_.end (); ++i)
469 YYCDEBUG << ' ' << *i;
470 YYCDEBUG << std::endl;
471 }
472 #endif
473
474 semantic_stack_.push (yyval);
475 location_stack_.push (yyloc);
476
477 /* Shift the result of the reduction. */
478 n_ = r1_[[n_]];
479 state_ = pgoto_[[n_ - ntokens_]] + state_stack_[[0]];
480 if (state_ >= 0 && state_ <= last_ && check_[[state_]] == state_stack_[[0]])
481 state_ = table_[[state_]];
482 else
483 state_ = defgoto_[[n_ - ntokens_]];
484 goto yynewstate;
485
486 /* Report and recover from errors. This is very incomplete. */
487 yyerrlab:
488 /* If not already recovering from an error, report this error. */
489 if (!errstatus)
490 {
491 ++nerrs;
492
493 #if YYERROR_VERBOSE
494 n_ = pact_[[state_]];
495 if (n_ > flag_ && n_ < last_)
496 {
497 message = "parse error, unexpected ";
498 message += name_[[ilooka_]];
499 {
500 int count = 0;
501 for (int x = (n_ < 0 ? -n_ : 0); x < ntokens_ + nnts_; ++x)
502 if (check_[[x + n_]] == x)
503 ++count;
504 if (count < 5)
505 {
506 count = 0;
507 for (int x = (n_ < 0 ? -n_ : 0); x < ntokens_ + nnts_; ++x)
508 if (check_[[x + n_]] == x)
509 {
510 message += (!count++) ? ", expecting " : " or ";
511 message += name_[[x]];
512 }
513 }
514 }
515 }
516 else
517 #endif
518 message = "parse error";
519 error_ ();
520 }
521 goto yyerrlab1;
522
523 /* Error raised explicitly by an action. */
524 yyerrlab1:
525 if (errstatus == 3)
526 {
527 /* If just tried and failed to reuse lookahead token after an
528 error, discard it. */
529
530 /* Return failure if at end of input. */
531 if (looka_ == eof_)
532 goto yyabortlab;
533 YYCDEBUG << "Discarding token " << looka_
534 << " (" << name_[[ilooka_]] << ")." << std::endl;
535 looka_ = empty_;
536 }
537
538 /* Else will try to reuse lookahead token after shifting the error
539 token. */
540
541 errstatus = 3;
542
543 for (;;)
544 {
545 n_ = pact_[[state_]];
546 if (n_ != flag_)
547 {
548 n_ += terror_;
549 if (0 <= n_ && n_ <= last_ && check_[[n_]] == terror_)
550 {
551 n_ = table_[[n_]];
552 if (0 < n_)
553 break;
554 }
555 }
556
557 /* Pop the current state because it cannot handle the error token. */
558 if (!state_stack_.height ())
559 goto yyabortlab;
560
561 #if YYDEBUG
562 if (debug_)
563 {
564 if (stos_[[state_]] < ntokens_)
565 {
566 YYCDEBUG << "Error: popping token "
567 << token_number_[[stos_[state_]]]
568 << " (" << name_[[stos_[state_]]];
569 # ifdef YYPRINT
570 YYPRINT (stderr, token_number_[[stos_[state_]]],
571 semantic_stack_.top ());
572 # endif
573 YYCDEBUG << ')' << std::endl;
574 }
575 else
576 {
577 YYCDEBUG << "Error: popping nonterminal ("
578 << name_[[stos_[state_]]] << ')' << std::endl;
579 }
580 }
581 #endif
582
583 state_ = (state_stack_.pop (), state_stack_[[0]]);
584 semantic_stack_.pop ();
585 location_stack_.pop ();;
586
587 #if YYDEBUG
588 if (debug_)
589 {
590 YYCDEBUG << "Error: state stack now";
591 for (StateStack::ConstIterator i = state_stack_.begin ();
592 i != state_stack_.end (); ++i)
593 YYCDEBUG << ' ' << *i;
594 YYCDEBUG << std::endl;
595 }
596 #endif
597 }
598
599 if (n_ == final_)
600 goto yyacceptlab;
601
602 YYCDEBUG << "Shifting error token, ";
603
604 semantic_stack_.push (value);
605 location_stack_.push (location);
606
607 state_ = n_;
608 goto yynewstate;
609
610 /* Accept. */
611 yyacceptlab:
612 return 0;
613
614 /* Abort. */
615 yyabortlab:
616 return 1;
617 }
618
619 void
620 yy::b4_name::lex_ ()
621 {
622 #if YYLSP_NEEDED
623 looka_ = yylex (&value, &location);
624 #else
625 looka_ = yylex (&value);
626 #endif
627 }
628
629 /* YYPACT[[STATE-NUM]] -- Index in YYTABLE of the portion describing
630 STATE-NUM. */
631 const short
632 yy::b4_name::pact_[[]] =
633 {
634 b4_pact
635 };
636
637 /* YYDEFACT[[S]] -- default rule to reduce with in state S when YYTABLE
638 doesn't specify something else to do. Zero means the default is an
639 error. */
640 const short
641 yy::b4_name::defact_[[]] =
642 {
643 b4_defact
644 };
645
646 /* YYPGOTO[[NTERM-NUM]]. */
647 const short
648 yy::b4_name::pgoto_[[]] =
649 {
650 b4_pgoto
651 };
652
653 /* YYDEFGOTO[[NTERM-NUM]]. */
654 const short
655 yy::b4_name::defgoto_[[]] =
656 {
657 b4_defgoto
658 };
659
660 /* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If
661 positive, shift that token. If negative, reduce the rule which
662 number is the opposite. If zero, do what YYDEFACT says. */
663 const short
664 yy::b4_name::table_[[]] =
665 {
666 b4_table
667 };
668
669 /* YYCHECK. */
670 const short
671 yy::b4_name::check_[[]] =
672 {
673 b4_check
674 };
675
676 #if YYDEBUG
677 /* STOS_[[STATE-NUM]] -- The (internal number of the) accessing
678 symbol of state STATE-NUM. */
679 const b4_uint_type(b4_stos_max)
680 yy::b4_name::stos_[[]] =
681 {
682 b4_stos
683 };
684
685 /* TOKEN_NUMBER_[[YYLEX-NUM]] -- Internal token number corresponding
686 to YYLEX-NUM. */
687 const short
688 yy::b4_name::token_number_[[]] =
689 {
690 b4_toknum
691 };
692 #endif
693
694 /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */
695 const b4_uint_type(b4_r1_max)
696 yy::b4_name::r1_[[]] =
697 {
698 b4_r1
699 };
700
701 /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */
702 const b4_uint_type(b4_r2_max)
703 yy::b4_name::r2_[[]] =
704 {
705 b4_r2
706 };
707
708 #if YYDEBUG || YYERROR_VERBOSE
709 /* YYTNAME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM.
710 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
711 const char*
712 const yy::b4_name::name_[[]] =
713 {
714 b4_tname
715 };
716 #endif
717
718 #if YYDEBUG
719 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
720 const yy::b4_name::RhsNumberType
721 yy::b4_name::rhs_[[]] =
722 {
723 b4_rhs
724 };
725
726 /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
727 YYRHS. */
728 const b4_uint_type(b4_prhs_max)
729 yy::b4_name::prhs_[[]] =
730 {
731 b4_prhs
732 };
733
734 /* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */
735 const b4_uint_type(b4_rline_max)
736 yy::b4_name::rline_[[]] =
737 {
738 b4_rline
739 };
740 #endif
741
742 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
743 yy::b4_name::TokenNumberType
744 yy::b4_name::translate_ (int token)
745 {
746 static
747 const TokenNumberType
748 translate_[[]] =
749 {
750 b4_translate
751 };
752 if ((unsigned) token <= user_token_number_max_)
753 return translate_[[token]];
754 else
755 return undef_token_;
756 }
757
758 const int yy::b4_name::eof_ = 0;
759 const int yy::b4_name::last_ = b4_last;
760 const int yy::b4_name::flag_ = b4_flag;
761 const int yy::b4_name::nnts_ = b4_nterms_number;
762 const int yy::b4_name::empty_ = -2;
763 const int yy::b4_name::final_ = b4_final_state_number;
764 const int yy::b4_name::terror_ = 1;
765 const int yy::b4_name::errcode_ = 256;
766 const int yy::b4_name::ntokens_ = b4_tokens_number;
767 const int yy::b4_name::initdepth_ = b4_initdepth;
768
769 const unsigned yy::b4_name::user_token_number_max_ = b4_user_token_number_max;
770 const yy::b4_name::TokenNumberType yy::b4_name::undef_token_ = b4_undef_token_number;
771
772 b4_epilogue
773
774 #output "stack.hh"
775 b4_copyright([2002])
776
777 #ifndef BISON_STACK_HH
778 # define BISON_STACK_HH
779
780 #include <deque>
781
782 namespace yy
783 {
784 template < class T, class S = std::deque< T > >
785 class Stack
786 {
787 public:
788
789 typedef typename S::iterator Iterator;
790 typedef typename S::const_iterator ConstIterator;
791
792 Stack () : seq_ ()
793 {
794 }
795
796 Stack (unsigned n) : seq_ (n)
797 {
798 }
799
800 inline
801 T&
802 operator [[]] (unsigned index)
803 {
804 return seq_[[index]];
805 }
806
807 inline
808 const T&
809 operator [[]] (unsigned index) const
810 {
811 return seq_[[index]];
812 }
813
814 inline
815 void
816 push (const T& t)
817 {
818 seq_.push_front (t);
819 }
820
821 inline
822 void
823 pop (unsigned n = 1)
824 {
825 for (; n; --n)
826 seq_.pop_front ();
827 }
828
829 inline
830 unsigned
831 height () const
832 {
833 return seq_.size ();
834 }
835
836 inline ConstIterator begin () const { return seq_.begin (); }
837 inline ConstIterator end () const { return seq_.end (); }
838
839 private:
840
841 S seq_;
842 };
843
844 template < class T, class S = Stack< T > >
845 class Slice
846 {
847 public:
848
849 Slice (const S& stack,
850 unsigned range) : stack_ (stack),
851 range_ (range)
852 {
853 }
854
855 inline
856 const T&
857 operator [[]] (unsigned index) const
858 {
859 return stack_[[range_ - index]];
860 }
861
862 private:
863
864 const S& stack_;
865 unsigned range_;
866 };
867 }
868
869 #endif // not BISON_STACK_HH
870
871 #output "location.hh"
872 b4_copyright([2002])
873
874 #ifndef BISON_LOCATION_HH
875 # define BISON_LOCATION_HH
876
877 namespace yy
878 {
879 struct Position
880 {
881 int line;
882 int column;
883 };
884
885 struct Location
886 {
887 Position first;
888 Position last;
889 };
890 }
891
892 #endif // not BISON_LOCATION_HH