30 |
#include "stack.hh" |
#include "stack.hh" |
31 |
#include "location.hh" |
#include "location.hh" |
32 |
|
|
33 |
b4_prologue |
#include <string> |
34 |
|
|
35 |
/* Enabling traces. */ |
/* Enabling traces. */ |
36 |
#ifndef YYDEBUG |
#ifndef YYDEBUG |
45 |
/* Using locations. */ |
/* Using locations. */ |
46 |
#define YYLSP_NEEDED b4_locations_flag |
#define YYLSP_NEEDED b4_locations_flag |
47 |
|
|
48 |
|
b4_prologue |
49 |
|
|
50 |
// FIXME: This should be defined in traits, not here. |
// FIXME: This should be defined in traits, not here. |
51 |
typedef b4_stype yystype; |
typedef b4_stype yystype; |
52 |
|
|
82 |
typedef Stack< SemanticType > SemanticStack; |
typedef Stack< SemanticType > SemanticStack; |
83 |
typedef Stack< LocationType > LocationStack; |
typedef Stack< LocationType > LocationStack; |
84 |
|
|
85 |
|
#if YYLSP_NEEDED |
86 |
|
b4_name (bool debug, |
87 |
|
LocationType initlocation) : debug_ (debug), |
88 |
|
initlocation_ (initlocation) |
89 |
|
#else |
90 |
b4_name (bool debug) : debug_ (debug) |
b4_name (bool debug) : debug_ (debug) |
91 |
|
#endif |
92 |
{ |
{ |
93 |
} |
} |
94 |
|
|
163 |
/* @$ and $$. */ |
/* @$ and $$. */ |
164 |
SemanticType value; |
SemanticType value; |
165 |
LocationType location; |
LocationType location; |
166 |
|
|
167 |
|
/* Initial location. */ |
168 |
|
LocationType initlocation_; |
169 |
}; |
}; |
170 |
} |
} |
171 |
|
|
208 |
/* Start. */ |
/* Start. */ |
209 |
state_ = 0; |
state_ = 0; |
210 |
looka_ = empty_; |
looka_ = empty_; |
211 |
|
#if YYLSP_NEEDED |
212 |
|
location = initlocation_; |
213 |
|
#endif |
214 |
YYDPRINTF ((stderr, "Starting parse\n")); |
YYDPRINTF ((stderr, "Starting parse\n")); |
215 |
|
|
216 |
/* New state. */ |
/* New state. */ |
286 |
|
|
287 |
semantic_stack_.push (value); |
semantic_stack_.push (value); |
288 |
location_stack_.push (location); |
location_stack_.push (location); |
289 |
|
|
290 |
|
/* Count tokens shifted since error; after three, turn off error |
291 |
|
status. */ |
292 |
|
if (errstatus) |
293 |
|
--errstatus; |
294 |
|
|
295 |
state_ = n_; |
state_ = n_; |
296 |
goto yynewstate; |
goto yynewstate; |
297 |
|
|
399 |
else |
else |
400 |
#endif |
#endif |
401 |
message = "parse error"; |
message = "parse error"; |
402 |
|
error_ (); |
403 |
} |
} |
|
error_ (); |
|
404 |
goto yyerrlab1; |
goto yyerrlab1; |
405 |
|
|
406 |
/* Error raised explicitly by an action. */ |
/* Error raised explicitly by an action. */ |