91 |
m4_divert(0)dnl |
m4_divert(0)dnl |
92 |
@output @output_header_name@ |
@output @output_header_name@ |
93 |
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], |
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], |
94 |
[2002]) |
[2002])[ |
95 |
#ifndef YYLSP_NEEDED |
/* FIXME: This is wrong, we want computed header guards. |
96 |
# define YYLSP_NEEDED |
I don't know why the macros are missing now. :( */ |
97 |
|
#ifndef PARSER_HEADER_H |
98 |
|
# define PARSER_HEADER_H |
99 |
|
|
100 |
#include "stack.hh" |
#include "stack.hh" |
101 |
#include "location.hh" |
#include "location.hh" |
104 |
#include <iostream> |
#include <iostream> |
105 |
|
|
106 |
/* Using locations. */ |
/* Using locations. */ |
107 |
#define YYLSP_NEEDED b4_locations_flag |
#define YYLSP_NEEDED ]b4_locations_flag[ |
108 |
|
|
109 |
b4_token_defines(b4_tokens) |
]b4_token_defines(b4_tokens)[ |
110 |
|
|
111 |
/* Copy the first part of user declarations. */ |
/* Copy the first part of user declarations. */ |
112 |
b4_pre_prologue |
]b4_pre_prologue[ |
113 |
|
|
114 |
/* Line __line__ of __file__. */ |
]/* Line __line__ of __file__. */ |
115 |
b4_syncline([@oline@], [@ofile@]) |
b4_syncline([@oline@], [@ofile@])[ |
116 |
|
|
117 |
/* Enabling traces. */ |
/* Enabling traces. */ |
118 |
#ifndef YYDEBUG |
#ifndef YYDEBUG |
119 |
# define YYDEBUG b4_debug |
# define YYDEBUG ]b4_debug[ |
120 |
#endif |
#endif |
121 |
|
|
122 |
/* Enabling verbose error message. */ |
/* Enabling verbose error message. */ |
123 |
#ifndef YYERROR_VERBOSE |
#ifndef YYERROR_VERBOSE |
124 |
# define YYERROR_VERBOSE b4_error_verbose |
# define YYERROR_VERBOSE ]b4_error_verbose[ |
125 |
#endif |
#endif |
126 |
|
|
127 |
#ifndef YYSTYPE |
#ifndef YYSTYPE |
128 |
m4_ifdef([b4_stype], |
]m4_ifdef([b4_stype], |
129 |
[b4_syncline([b4_stype_line], [b4_filename]) |
[b4_syncline([b4_stype_line], [b4_filename]) |
130 |
typedef union b4_stype yystype; |
typedef union b4_stype yystype; |
131 |
/* Line __line__ of __file__. */ |
/* Line __line__ of __file__. */ |
132 |
b4_syncline([@oline@], [@ofile@])], |
b4_syncline([@oline@], [@ofile@])], |
133 |
[typedef int yystype;]) |
[typedef int yystype;])[ |
134 |
# define YYSTYPE yystype |
# define YYSTYPE yystype |
135 |
#endif |
#endif |
136 |
|
|
137 |
/* Copy the second part of user declarations. */ |
/* Copy the second part of user declarations. */ |
138 |
b4_post_prologue |
]b4_post_prologue[ |
139 |
|
|
140 |
/* Line __line__ of __file__. */ |
]/* Line __line__ of __file__. */ |
141 |
b4_syncline([@oline@], [@ofile@]) |
b4_syncline([@oline@], [@ofile@])[ |
142 |
#ifndef YYLLOC_DEFAULT |
#ifndef YYLLOC_DEFAULT |
143 |
# define YYLLOC_DEFAULT(Current, Rhs, N) \ |
# define YYLLOC_DEFAULT(Current, Rhs, N) \ |
144 |
Current.last_line = Rhs[[N]].last_line; \ |
Current.last_line = Rhs[N].last_line; \ |
145 |
Current.last_column = Rhs[[N]].last_column; |
Current.last_column = Rhs[N].last_column; |
146 |
#endif |
#endif |
147 |
|
|
148 |
namespace yy |
namespace yy |
149 |
{ |
{ |
150 |
class b4_parser_class_name; |
class ]b4_parser_class_name[; |
151 |
|
|
152 |
template < typename P > |
template < typename P > |
153 |
struct Traits |
struct Traits |
155 |
}; |
}; |
156 |
|
|
157 |
template < > |
template < > |
158 |
struct Traits< b4_parser_class_name > |
struct Traits< ]b4_parser_class_name[ > |
159 |
{ |
{ |
160 |
typedef b4_int_type_for([b4_translate]) TokenNumberType; |
typedef ]b4_int_type_for([b4_translate])[ TokenNumberType; |
161 |
typedef b4_int_type_for([b4_rhs]) RhsNumberType; |
typedef ]b4_int_type_for([b4_rhs])[ RhsNumberType; |
162 |
typedef int StateType; |
typedef int StateType; |
163 |
typedef yystype SemanticType; |
typedef yystype SemanticType; |
164 |
typedef b4_location_type LocationType; |
typedef ]b4_location_type[ LocationType; |
165 |
}; |
}; |
166 |
} |
} |
167 |
|
|
168 |
namespace yy |
namespace yy |
169 |
{ |
{ |
170 |
class b4_parser_class_name b4_inherit |
class ]b4_parser_class_name b4_inherit[ |
171 |
{ |
{ |
172 |
public: |
public: |
173 |
|
|
174 |
typedef Traits< b4_parser_class_name >::TokenNumberType TokenNumberType; |
typedef Traits< ]b4_parser_class_name[ >::TokenNumberType TokenNumberType; |
175 |
typedef Traits< b4_parser_class_name >::RhsNumberType RhsNumberType; |
typedef Traits< ]b4_parser_class_name[ >::RhsNumberType RhsNumberType; |
176 |
typedef Traits< b4_parser_class_name >::StateType StateType; |
typedef Traits< ]b4_parser_class_name[ >::StateType StateType; |
177 |
typedef Traits< b4_parser_class_name >::SemanticType SemanticType; |
typedef Traits< ]b4_parser_class_name[ >::SemanticType SemanticType; |
178 |
typedef Traits< b4_parser_class_name >::LocationType LocationType; |
typedef Traits< ]b4_parser_class_name[ >::LocationType LocationType; |
179 |
|
|
180 |
typedef Stack< StateType > StateStack; |
typedef Stack< StateType > StateStack; |
181 |
typedef Stack< SemanticType > SemanticStack; |
typedef Stack< SemanticType > SemanticStack; |
182 |
typedef Stack< LocationType > LocationStack; |
typedef Stack< LocationType > LocationStack; |
183 |
|
|
184 |
#if YYLSP_NEEDED |
#if YYLSP_NEEDED |
185 |
b4_parser_class_name (bool debug, |
]b4_parser_class_name[ (bool debug, |
186 |
LocationType initlocation[]b4_param) : |
LocationType initlocation][]b4_param[) : |
187 |
b4_constructor[]debug_ (debug), |
]b4_constructor[][debug_ (debug), |
188 |
cdebug_ (std::cerr), |
cdebug_ (std::cerr), |
189 |
initlocation_ (initlocation) |
initlocation_ (initlocation) |
190 |
#else |
#else |
191 |
b4_parser_class_name (bool debug[]b4_param) : |
]b4_parser_class_name[ (bool debug][]b4_param[) : |
192 |
b4_constructor[]debug_ (debug), |
]b4_constructor[][debug_ (debug), |
193 |
cdebug_ (std::cerr) |
cdebug_ (std::cerr) |
194 |
#endif |
#endif |
195 |
{ |
{ |
196 |
} |
} |
197 |
|
|
198 |
virtual ~b4_parser_class_name () |
virtual ~]b4_parser_class_name[ () |
199 |
{ |
{ |
200 |
} |
} |
201 |
|
|
213 |
LocationStack location_stack_; |
LocationStack location_stack_; |
214 |
|
|
215 |
/* Tables. */ |
/* Tables. */ |
216 |
static const b4_int_type_for([b4_pact]) pact_[[]]; |
static const ]b4_int_type_for([b4_pact])[ pact_[]; |
217 |
static const b4_int_type_for([b4_pact]) pact_ninf_; |
static const ]b4_int_type_for([b4_pact])[ pact_ninf_; |
218 |
static const b4_int_type_for([b4_defact]) defact_[[]]; |
static const ]b4_int_type_for([b4_defact])[ defact_[]; |
219 |
static const b4_int_type_for([b4_pgoto]) pgoto_[[]]; |
static const ]b4_int_type_for([b4_pgoto])[ pgoto_[]; |
220 |
static const b4_int_type_for([b4_defgoto]) defgoto_[[]]; |
static const ]b4_int_type_for([b4_defgoto])[ defgoto_[]; |
221 |
static const b4_int_type_for([b4_table]) table_[[]]; |
static const ]b4_int_type_for([b4_table])[ table_[]; |
222 |
static const b4_int_type_for([b4_table]) table_ninf_; |
static const ]b4_int_type_for([b4_table])[ table_ninf_; |
223 |
static const b4_int_type_for([b4_check]) check_[[]]; |
static const ]b4_int_type_for([b4_check])[ check_[]; |
224 |
static const b4_int_type_for([b4_r1]) r1_[[]]; |
static const ]b4_int_type_for([b4_r1])[ r1_[]; |
225 |
static const b4_int_type_for([b4_r2]) r2_[[]]; |
static const ]b4_int_type_for([b4_r2])[ r2_[]; |
226 |
|
|
227 |
#if YYDEBUG || YYERROR_VERBOSE |
#if YYDEBUG || YYERROR_VERBOSE |
228 |
static const char* const name_[[]]; |
static const char* const name_[]; |
229 |
#endif |
#endif |
230 |
|
|
231 |
/* More tables, for debugging. */ |
/* More tables, for debugging. */ |
232 |
#if YYDEBUG |
#if YYDEBUG |
233 |
static const RhsNumberType rhs_[[]]; |
static const RhsNumberType rhs_[]; |
234 |
static const b4_int_type_for([b4_prhs]) prhs_[[]]; |
static const ]b4_int_type_for([b4_prhs])[ prhs_[]; |
235 |
static const b4_int_type_for([b4_rline]) rline_[[]]; |
static const ]b4_int_type_for([b4_rline])[ rline_[]; |
236 |
static const b4_int_type_for([b4_stos]) stos_[[]]; |
static const ]b4_int_type_for([b4_stos])[ stos_[]; |
237 |
static const b4_int_type_for([b4_toknum]) token_number_[[]]; |
static const ]b4_int_type_for([b4_toknum])[ token_number_[]; |
238 |
#endif |
#endif |
239 |
|
|
240 |
/* Even more tables. */ |
/* Even more tables. */ |
283 |
}; |
}; |
284 |
} |
} |
285 |
|
|
286 |
#endif /* ! defined YYLSP_NEEDED */ |
#endif /* ! defined PARSER_HEADER_H */] |
287 |
dnl |
dnl |
288 |
@output @output_parser_name@ |
@output @output_parser_name@ |
289 |
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], |
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], |
290 |
[2002]) |
[2002])[ |
291 |
|
|
292 |
#include @output_header_name@ |
#include @output_header_name@ |
293 |
|
|
299 |
#endif /* !YYDEBUG */ |
#endif /* !YYDEBUG */ |
300 |
|
|
301 |
int |
int |
302 |
yy::b4_parser_class_name::parse () |
yy::]b4_parser_class_name[::parse () |
303 |
{ |
{ |
304 |
int nerrs = 0; |
int nerrs = 0; |
305 |
int errstatus = 0; |
int errstatus = 0; |
327 |
yybackup: |
yybackup: |
328 |
|
|
329 |
/* Try to take a decision without lookahead. */ |
/* Try to take a decision without lookahead. */ |
330 |
n_ = pact_[[state_]]; |
n_ = pact_[state_]; |
331 |
if (n_ == pact_ninf_) |
if (n_ == pact_ninf_) |
332 |
goto yydefault; |
goto yydefault; |
333 |
|
|
352 |
if (debug_) |
if (debug_) |
353 |
{ |
{ |
354 |
YYCDEBUG << "Next token is " << looka_ |
YYCDEBUG << "Next token is " << looka_ |
355 |
<< " (" << name_[[ilooka_]]; |
<< " (" << name_[ilooka_]; |
356 |
print_ (); |
print_ (); |
357 |
YYCDEBUG << ')' << std::endl; |
YYCDEBUG << ')' << std::endl; |
358 |
} |
} |
360 |
} |
} |
361 |
|
|
362 |
n_ += ilooka_; |
n_ += ilooka_; |
363 |
if (n_ < 0 || last_ < n_ || check_[[n_]] != ilooka_) |
if (n_ < 0 || last_ < n_ || check_[n_] != ilooka_) |
364 |
goto yydefault; |
goto yydefault; |
365 |
|
|
366 |
/* Reduce or error. */ |
/* Reduce or error. */ |
367 |
n_ = table_[[n_]]; |
n_ = table_[n_]; |
368 |
if (n_ < 0) |
if (n_ < 0) |
369 |
{ |
{ |
370 |
if (n_ == table_ninf_) |
if (n_ == table_ninf_) |
384 |
|
|
385 |
/* Shift the lookahead token. */ |
/* Shift the lookahead token. */ |
386 |
YYCDEBUG << "Shifting token " << looka_ |
YYCDEBUG << "Shifting token " << looka_ |
387 |
<< " (" << name_[[ilooka_]] << "), "; |
<< " (" << name_[ilooka_] << "), "; |
388 |
|
|
389 |
/* Discard the token being shifted unless it is eof. */ |
/* Discard the token being shifted unless it is eof. */ |
390 |
if (looka_ != eof_) |
if (looka_ != eof_) |
403 |
|
|
404 |
/* Default action. */ |
/* Default action. */ |
405 |
yydefault: |
yydefault: |
406 |
n_ = defact_[[state_]]; |
n_ = defact_[state_]; |
407 |
if (n_ == 0) |
if (n_ == 0) |
408 |
goto yyerrlab; |
goto yyerrlab; |
409 |
goto yyreduce; |
goto yyreduce; |
410 |
|
|
411 |
/* Reduce. */ |
/* Reduce. */ |
412 |
yyreduce: |
yyreduce: |
413 |
len_ = r2_[[n_]]; |
len_ = r2_[n_]; |
414 |
if (len_) |
if (len_) |
415 |
{ |
{ |
416 |
yyval = semantic_stack_[[len_ - 1]]; |
yyval = semantic_stack_[len_ - 1]; |
417 |
yyloc = location_stack_[[len_ - 1]]; |
yyloc = location_stack_[len_ - 1]; |
418 |
} |
} |
419 |
else |
else |
420 |
{ |
{ |
421 |
yyval = semantic_stack_[[0]]; |
yyval = semantic_stack_[0]; |
422 |
yyloc = location_stack_[[0]]; |
yyloc = location_stack_[0]; |
423 |
} |
} |
424 |
|
|
425 |
#if YYDEBUG |
#if YYDEBUG |
426 |
if (debug_) |
if (debug_) |
427 |
{ |
{ |
428 |
YYCDEBUG << "Reducing via rule " << n_ - 1 |
YYCDEBUG << "Reducing via rule " << n_ - 1 |
429 |
<< " (line " << rline_[[n_]] << "), "; |
<< " (line " << rline_[n_] << "), "; |
430 |
for (b4_int_type_for([b4_prhs]) i = prhs_[[n_]]; |
for (]b4_int_type_for([b4_prhs])[ i = prhs_[n_]; |
431 |
0 <= rhs_[[i]]; ++i) |
0 <= rhs_[i]; ++i) |
432 |
YYCDEBUG << name_[[rhs_[i]]] << ' '; |
YYCDEBUG << name_[rhs_[i]] << ' '; |
433 |
YYCDEBUG << "-> " << name_[[r1_[n_]]] << std::endl; |
YYCDEBUG << "-> " << name_[r1_[n_]] << std::endl; |
434 |
} |
} |
435 |
#endif |
#endif |
436 |
|
|
442 |
|
|
443 |
switch (n_) |
switch (n_) |
444 |
{ |
{ |
445 |
b4_actions |
]b4_actions[ |
446 |
} |
} |
447 |
|
|
448 |
/* Line __line__ of __file__. */ |
]/* Line __line__ of __file__. */ |
449 |
b4_syncline([@oline@], [@ofile@]) |
b4_syncline([@oline@], [@ofile@])[ |
450 |
|
|
451 |
state_stack_.pop (len_); |
state_stack_.pop (len_); |
452 |
semantic_stack_.pop (len_); |
semantic_stack_.pop (len_); |
467 |
location_stack_.push (yyloc); |
location_stack_.push (yyloc); |
468 |
|
|
469 |
/* Shift the result of the reduction. */ |
/* Shift the result of the reduction. */ |
470 |
n_ = r1_[[n_]]; |
n_ = r1_[n_]; |
471 |
state_ = pgoto_[[n_ - ntokens_]] + state_stack_[[0]]; |
state_ = pgoto_[n_ - ntokens_] + state_stack_[0]; |
472 |
if (0 <= state_ && state_ <= last_ && check_[[state_]] == state_stack_[[0]]) |
if (0 <= state_ && state_ <= last_ && check_[state_] == state_stack_[0]) |
473 |
state_ = table_[[state_]]; |
state_ = table_[state_]; |
474 |
else |
else |
475 |
state_ = defgoto_[[n_ - ntokens_]]; |
state_ = defgoto_[n_ - ntokens_]; |
476 |
goto yynewstate; |
goto yynewstate; |
477 |
|
|
478 |
/* Report and recover from errors. This is very incomplete. */ |
/* Report and recover from errors. This is very incomplete. */ |
483 |
++nerrs; |
++nerrs; |
484 |
|
|
485 |
#if YYERROR_VERBOSE |
#if YYERROR_VERBOSE |
486 |
n_ = pact_[[state_]]; |
n_ = pact_[state_]; |
487 |
if (pact_ninf_ < n_ && n_ < last_) |
if (pact_ninf_ < n_ && n_ < last_) |
488 |
{ |
{ |
489 |
message = "syntax error, unexpected "; |
message = "syntax error, unexpected "; |
490 |
message += name_[[ilooka_]]; |
message += name_[ilooka_]; |
491 |
{ |
{ |
492 |
int count = 0; |
int count = 0; |
493 |
for (int x = (n_ < 0 ? -n_ : 0); x < ntokens_ + nnts_; ++x) |
for (int x = (n_ < 0 ? -n_ : 0); x < ntokens_ + nnts_; ++x) |
494 |
if (check_[[x + n_]] == x && x != terror_) |
if (check_[x + n_] == x && x != terror_) |
495 |
++count; |
++count; |
496 |
if (count < 5) |
if (count < 5) |
497 |
{ |
{ |
498 |
count = 0; |
count = 0; |
499 |
for (int x = (n_ < 0 ? -n_ : 0); x < ntokens_ + nnts_; ++x) |
for (int x = (n_ < 0 ? -n_ : 0); x < ntokens_ + nnts_; ++x) |
500 |
if (check_[[x + n_]] == x && x != terror_) |
if (check_[x + n_] == x && x != terror_) |
501 |
{ |
{ |
502 |
message += (!count++) ? ", expecting " : " or "; |
message += (!count++) ? ", expecting " : " or "; |
503 |
message += name_[[x]]; |
message += name_[x]; |
504 |
} |
} |
505 |
} |
} |
506 |
} |
} |
523 |
if (looka_ == eof_) |
if (looka_ == eof_) |
524 |
goto yyabortlab; |
goto yyabortlab; |
525 |
YYCDEBUG << "Discarding token " << looka_ |
YYCDEBUG << "Discarding token " << looka_ |
526 |
<< " (" << name_[[ilooka_]] << ")." << std::endl; |
<< " (" << name_[ilooka_] << ")." << std::endl; |
527 |
looka_ = empty_; |
looka_ = empty_; |
528 |
} |
} |
529 |
|
|
534 |
|
|
535 |
for (;;) |
for (;;) |
536 |
{ |
{ |
537 |
n_ = pact_[[state_]]; |
n_ = pact_[state_]; |
538 |
if (n_ != pact_ninf_) |
if (n_ != pact_ninf_) |
539 |
{ |
{ |
540 |
n_ += terror_; |
n_ += terror_; |
541 |
if (0 <= n_ && n_ <= last_ && check_[[n_]] == terror_) |
if (0 <= n_ && n_ <= last_ && check_[n_] == terror_) |
542 |
{ |
{ |
543 |
n_ = table_[[n_]]; |
n_ = table_[n_]; |
544 |
if (0 < n_) |
if (0 < n_) |
545 |
break; |
break; |
546 |
} |
} |
553 |
#if YYDEBUG |
#if YYDEBUG |
554 |
if (debug_) |
if (debug_) |
555 |
{ |
{ |
556 |
if (stos_[[state_]] < ntokens_) |
if (stos_[state_] < ntokens_) |
557 |
{ |
{ |
558 |
YYCDEBUG << "Error: popping token " |
YYCDEBUG << "Error: popping token " |
559 |
<< token_number_[[stos_[state_]]] |
<< token_number_[stos_[state_]] |
560 |
<< " (" << name_[[stos_[state_]]]; |
<< " (" << name_[stos_[state_]]; |
561 |
# ifdef YYPRINT |
# ifdef YYPRINT |
562 |
YYPRINT (stderr, token_number_[[stos_[state_]]], |
YYPRINT (stderr, token_number_[stos_[state_]], |
563 |
semantic_stack_.top ()); |
semantic_stack_.top ()); |
564 |
# endif |
# endif |
565 |
YYCDEBUG << ')' << std::endl; |
YYCDEBUG << ')' << std::endl; |
567 |
else |
else |
568 |
{ |
{ |
569 |
YYCDEBUG << "Error: popping nonterminal (" |
YYCDEBUG << "Error: popping nonterminal (" |
570 |
<< name_[[stos_[state_]]] << ')' << std::endl; |
<< name_[stos_[state_]] << ')' << std::endl; |
571 |
} |
} |
572 |
} |
} |
573 |
#endif |
#endif |
574 |
|
|
575 |
state_ = (state_stack_.pop (), state_stack_[[0]]); |
state_ = (state_stack_.pop (), state_stack_[0]); |
576 |
semantic_stack_.pop (); |
semantic_stack_.pop (); |
577 |
location_stack_.pop ();; |
location_stack_.pop ();; |
578 |
|
|
609 |
} |
} |
610 |
|
|
611 |
void |
void |
612 |
yy::b4_parser_class_name::lex_ () |
yy::]b4_parser_class_name[::lex_ () |
613 |
{ |
{ |
614 |
#if YYLSP_NEEDED |
#if YYLSP_NEEDED |
615 |
looka_ = yylex (&value, &location); |
looka_ = yylex (&value, &location); |
618 |
#endif |
#endif |
619 |
} |
} |
620 |
|
|
621 |
/* YYPACT[[STATE-NUM]] -- Index in YYTABLE of the portion describing |
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
622 |
STATE-NUM. */ |
STATE-NUM. */ |
623 |
const b4_int_type_for([b4_pact]) yy::b4_parser_class_name::pact_ninf_ = b4_pact_ninf; |
const ]b4_int_type_for([b4_pact]) yy::b4_parser_class_name::pact_ninf_ = b4_pact_ninf[; |
624 |
const b4_int_type_for([b4_pact]) |
const ]b4_int_type_for([b4_pact])[ |
625 |
yy::b4_parser_class_name::pact_[[]] = |
yy::]b4_parser_class_name[::pact_[] = |
626 |
{ |
{ |
627 |
b4_pact |
]b4_pact[ |
628 |
}; |
}; |
629 |
|
|
630 |
/* YYDEFACT[[S]] -- default rule to reduce with in state S when YYTABLE |
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE |
631 |
doesn't specify something else to do. Zero means the default is an |
doesn't specify something else to do. Zero means the default is an |
632 |
error. */ |
error. */ |
633 |
const b4_int_type_for([b4_defact]) |
const ]b4_int_type_for([b4_defact])[ |
634 |
yy::b4_parser_class_name::defact_[[]] = |
yy::]b4_parser_class_name[::defact_[] = |
635 |
{ |
{ |
636 |
b4_defact |
]b4_defact[ |
637 |
}; |
}; |
638 |
|
|
639 |
/* YYPGOTO[[NTERM-NUM]]. */ |
/* YYPGOTO[NTERM-NUM]. */ |
640 |
const b4_int_type_for([b4_pgoto]) |
const ]b4_int_type_for([b4_pgoto])[ |
641 |
yy::b4_parser_class_name::pgoto_[[]] = |
yy::]b4_parser_class_name[::pgoto_[] = |
642 |
{ |
{ |
643 |
b4_pgoto |
]b4_pgoto[ |
644 |
}; |
}; |
645 |
|
|
646 |
/* YYDEFGOTO[[NTERM-NUM]]. */ |
/* YYDEFGOTO[NTERM-NUM]. */ |
647 |
const b4_int_type_for([b4_defgoto]) |
const ]b4_int_type_for([b4_defgoto])[ |
648 |
yy::b4_parser_class_name::defgoto_[[]] = |
yy::]b4_parser_class_name[::defgoto_[] = |
649 |
{ |
{ |
650 |
b4_defgoto |
]b4_defgoto[ |
651 |
}; |
}; |
652 |
|
|
653 |
/* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If |
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
654 |
positive, shift that token. If negative, reduce the rule which |
positive, shift that token. If negative, reduce the rule which |
655 |
number is the opposite. If zero, do what YYDEFACT says. */ |
number is the opposite. If zero, do what YYDEFACT says. */ |
656 |
const b4_int_type_for([b4_table]) yy::b4_parser_class_name::table_ninf_ = b4_table_ninf; |
const ]b4_int_type_for([b4_table]) yy::b4_parser_class_name::table_ninf_ = b4_table_ninf[; |
657 |
const b4_int_type_for([b4_table]) |
const ]b4_int_type_for([b4_table])[ |
658 |
yy::b4_parser_class_name::table_[[]] = |
yy::]b4_parser_class_name[::table_[] = |
659 |
{ |
{ |
660 |
b4_table |
]b4_table[ |
661 |
}; |
}; |
662 |
|
|
663 |
/* YYCHECK. */ |
/* YYCHECK. */ |
664 |
const b4_int_type_for([b4_check]) |
const ]b4_int_type_for([b4_check])[ |
665 |
yy::b4_parser_class_name::check_[[]] = |
yy::]b4_parser_class_name[::check_[] = |
666 |
{ |
{ |
667 |
b4_check |
]b4_check[ |
668 |
}; |
}; |
669 |
|
|
670 |
#if YYDEBUG |
#if YYDEBUG |
671 |
/* STOS_[[STATE-NUM]] -- The (internal number of the) accessing |
/* STOS_[STATE-NUM] -- The (internal number of the) accessing |
672 |
symbol of state STATE-NUM. */ |
symbol of state STATE-NUM. */ |
673 |
const b4_int_type_for([b4_stos]) |
const ]b4_int_type_for([b4_stos])[ |
674 |
yy::b4_parser_class_name::stos_[[]] = |
yy::]b4_parser_class_name[::stos_[] = |
675 |
{ |
{ |
676 |
b4_stos |
]b4_stos[ |
677 |
}; |
}; |
678 |
|
|
679 |
/* TOKEN_NUMBER_[[YYLEX-NUM]] -- Internal token number corresponding |
/* TOKEN_NUMBER_[YYLEX-NUM] -- Internal token number corresponding |
680 |
to YYLEX-NUM. */ |
to YYLEX-NUM. */ |
681 |
const b4_int_type_for([b4_toknum]) |
const ]b4_int_type_for([b4_toknum])[ |
682 |
yy::b4_parser_class_name::token_number_[[]] = |
yy::]b4_parser_class_name[::token_number_[] = |
683 |
{ |
{ |
684 |
b4_toknum |
]b4_toknum[ |
685 |
}; |
}; |
686 |
#endif |
#endif |
687 |
|
|
688 |
/* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */ |
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
689 |
const b4_int_type_for([b4_r1]) |
const ]b4_int_type_for([b4_r1])[ |
690 |
yy::b4_parser_class_name::r1_[[]] = |
yy::]b4_parser_class_name[::r1_[] = |
691 |
{ |
{ |
692 |
b4_r1 |
]b4_r1[ |
693 |
}; |
}; |
694 |
|
|
695 |
/* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */ |
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
696 |
const b4_int_type_for([b4_r2]) |
const ]b4_int_type_for([b4_r2])[ |
697 |
yy::b4_parser_class_name::r2_[[]] = |
yy::]b4_parser_class_name[::r2_[] = |
698 |
{ |
{ |
699 |
b4_r2 |
]b4_r2[ |
700 |
}; |
}; |
701 |
|
|
702 |
#if YYDEBUG || YYERROR_VERBOSE |
#if YYDEBUG || YYERROR_VERBOSE |
703 |
/* YYTNAME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM. |
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
704 |
First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
705 |
const char* |
const char* |
706 |
const yy::b4_parser_class_name::name_[[]] = |
const yy::]b4_parser_class_name[::name_[] = |
707 |
{ |
{ |
708 |
b4_tname |
]b4_tname[ |
709 |
}; |
}; |
710 |
#endif |
#endif |
711 |
|
|
712 |
#if YYDEBUG |
#if YYDEBUG |
713 |
/* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
/* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
714 |
const yy::b4_parser_class_name::RhsNumberType |
const yy::]b4_parser_class_name[::RhsNumberType |
715 |
yy::b4_parser_class_name::rhs_[[]] = |
yy::]b4_parser_class_name[::rhs_[] = |
716 |
{ |
{ |
717 |
b4_rhs |
]b4_rhs[ |
718 |
}; |
}; |
719 |
|
|
720 |
/* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in |
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
721 |
YYRHS. */ |
YYRHS. */ |
722 |
const b4_int_type_for([b4_prhs]) |
const ]b4_int_type_for([b4_prhs])[ |
723 |
yy::b4_parser_class_name::prhs_[[]] = |
yy::]b4_parser_class_name[::prhs_[] = |
724 |
{ |
{ |
725 |
b4_prhs |
]b4_prhs[ |
726 |
}; |
}; |
727 |
|
|
728 |
/* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */ |
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
729 |
const b4_int_type_for([b4_rline]) |
const ]b4_int_type_for([b4_rline])[ |
730 |
yy::b4_parser_class_name::rline_[[]] = |
yy::]b4_parser_class_name[::rline_[] = |
731 |
{ |
{ |
732 |
b4_rline |
]b4_rline[ |
733 |
}; |
}; |
734 |
#endif |
#endif |
735 |
|
|
736 |
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
737 |
yy::b4_parser_class_name::TokenNumberType |
yy::]b4_parser_class_name[::TokenNumberType |
738 |
yy::b4_parser_class_name::translate_ (int token) |
yy::]b4_parser_class_name[::translate_ (int token) |
739 |
{ |
{ |
740 |
static |
static |
741 |
const TokenNumberType |
const TokenNumberType |
742 |
translate_[[]] = |
translate_[] = |
743 |
{ |
{ |
744 |
b4_translate |
]b4_translate[ |
745 |
}; |
}; |
746 |
if ((unsigned) token <= user_token_number_max_) |
if ((unsigned) token <= user_token_number_max_) |
747 |
return translate_[[token]]; |
return translate_[token]; |
748 |
else |
else |
749 |
return undef_token_; |
return undef_token_; |
750 |
} |
} |
751 |
|
|
752 |
const int yy::b4_parser_class_name::eof_ = 0; |
const int yy::]b4_parser_class_name[::eof_ = 0; |
753 |
const int yy::b4_parser_class_name::last_ = b4_last; |
const int yy::]b4_parser_class_name[::last_ = ]b4_last[; |
754 |
const int yy::b4_parser_class_name::nnts_ = b4_nterms_number; |
const int yy::]b4_parser_class_name[::nnts_ = ]b4_nterms_number[; |
755 |
const int yy::b4_parser_class_name::empty_ = -2; |
const int yy::]b4_parser_class_name[::empty_ = -2; |
756 |
const int yy::b4_parser_class_name::final_ = b4_final_state_number; |
const int yy::]b4_parser_class_name[::final_ = ]b4_final_state_number[; |
757 |
const int yy::b4_parser_class_name::terror_ = 1; |
const int yy::]b4_parser_class_name[::terror_ = 1; |
758 |
const int yy::b4_parser_class_name::errcode_ = 256; |
const int yy::]b4_parser_class_name[::errcode_ = 256; |
759 |
const int yy::b4_parser_class_name::ntokens_ = b4_tokens_number; |
const int yy::]b4_parser_class_name[::ntokens_ = ]b4_tokens_number[; |
760 |
const int yy::b4_parser_class_name::initdepth_ = b4_stack_depth_init; |
const int yy::]b4_parser_class_name[::initdepth_ = ]b4_stack_depth_init[; |
761 |
|
|
762 |
const unsigned yy::b4_parser_class_name::user_token_number_max_ = b4_user_token_number_max; |
const unsigned yy::]b4_parser_class_name[::user_token_number_max_ = ]b4_user_token_number_max[; |
763 |
const yy::b4_parser_class_name::TokenNumberType yy::b4_parser_class_name::undef_token_ = b4_undef_token_number; |
const yy::]b4_parser_class_name[::TokenNumberType yy::]b4_parser_class_name[::undef_token_ = ]b4_undef_token_number[; |
764 |
|
|
765 |
b4_epilogue |
]b4_epilogue |
766 |
dnl |
dnl |
767 |
@output stack.hh |
@output stack.hh |
768 |
b4_copyright([2002]) |
b4_copyright([2002])[ |
769 |
|
|
770 |
#ifndef BISON_STACK_HH |
#ifndef BISON_STACK_HH |
771 |
# define BISON_STACK_HH |
# define BISON_STACK_HH |
792 |
|
|
793 |
inline |
inline |
794 |
T& |
T& |
795 |
operator [[]] (unsigned index) |
operator [] (unsigned index) |
796 |
{ |
{ |
797 |
return seq_[[index]]; |
return seq_[index]; |
798 |
} |
} |
799 |
|
|
800 |
inline |
inline |
801 |
const T& |
const T& |
802 |
operator [[]] (unsigned index) const |
operator [] (unsigned index) const |
803 |
{ |
{ |
804 |
return seq_[[index]]; |
return seq_[index]; |
805 |
} |
} |
806 |
|
|
807 |
inline |
inline |
847 |
|
|
848 |
inline |
inline |
849 |
const T& |
const T& |
850 |
operator [[]] (unsigned index) const |
operator [] (unsigned index) const |
851 |
{ |
{ |
852 |
return stack_[[range_ - index]]; |
return stack_[range_ - index]; |
853 |
} |
} |
854 |
|
|
855 |
private: |
private: |
859 |
}; |
}; |
860 |
} |
} |
861 |
|
|
862 |
#endif // not BISON_STACK_HH |
#endif // not BISON_STACK_HH] |
863 |
dnl |
dnl |
864 |
@output location.hh |
@output location.hh |
865 |
b4_copyright([2002]) |
b4_copyright([2002])[ |
866 |
|
|
867 |
#ifndef BISON_LOCATION_HH |
#ifndef BISON_LOCATION_HH |
868 |
# define BISON_LOCATION_HH |
# define BISON_LOCATION_HH |
882 |
}; |
}; |
883 |
} |
} |
884 |
|
|
885 |
#endif // not BISON_LOCATION_HH |
#endif // not BISON_LOCATION_HH] |