mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-28 05:33:03 +00:00
glr2.cc: formatting changes
* data/skeletons/glr2.cc: here. Remove useless `inline`.
This commit is contained in:
@@ -978,7 +978,7 @@ class glr_state_set
|
||||
}
|
||||
|
||||
/** Invalidate stack #YYK. */
|
||||
inline void
|
||||
void
|
||||
yymarkStackDeleted (state_set_index yyk)
|
||||
{
|
||||
size_t k = yyk.uget ();
|
||||
@@ -1002,7 +1002,7 @@ class glr_state_set
|
||||
|
||||
/** Remove the dead stacks (yystates[i] == YY_NULLPTR) and shift the later
|
||||
* ones. */
|
||||
inline void
|
||||
void
|
||||
yyremoveDeletes ()
|
||||
{
|
||||
size_t newsize = yystates.size ();
|
||||
@@ -1198,6 +1198,7 @@ public:
|
||||
/** Next sibling in chain of options. To facilitate merging,
|
||||
* options are chained in decreasing order by address. */
|
||||
std::ptrdiff_t yynext;
|
||||
|
||||
public:
|
||||
/** The lookahead for this reduction. */
|
||||
int yyrawchar;
|
||||
@@ -1477,7 +1478,8 @@ public:
|
||||
#if YYSTACKEXPANDABLE
|
||||
/** Returns false if it tried to expand but could not. */
|
||||
bool
|
||||
yyexpandGLRStackIfNeeded() {
|
||||
yyexpandGLRStackIfNeeded ()
|
||||
{
|
||||
return YYHEADROOM <= spaceLeft () || yyexpandGLRStack ();
|
||||
}
|
||||
|
||||
@@ -1525,7 +1527,8 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool glr_state_not_null(glr_state* s) {
|
||||
static bool glr_state_not_null (glr_state* s)
|
||||
{
|
||||
return s != YY_NULLPTR;
|
||||
}
|
||||
|
||||
@@ -1585,23 +1588,28 @@ public:
|
||||
}
|
||||
|
||||
// Present the interface of a vector of glr_stack_item.
|
||||
std::vector<glr_stack_item>::const_iterator begin() const {
|
||||
std::vector<glr_stack_item>::const_iterator begin () const
|
||||
{
|
||||
return yyitems.begin ();
|
||||
}
|
||||
|
||||
std::vector<glr_stack_item>::const_iterator end() const {
|
||||
std::vector<glr_stack_item>::const_iterator end () const
|
||||
{
|
||||
return yyitems.end ();
|
||||
}
|
||||
|
||||
size_t size() const {
|
||||
size_t size() const
|
||||
{
|
||||
return yyitems.size ();
|
||||
}
|
||||
|
||||
glr_stack_item& operator[](size_t i) {
|
||||
glr_stack_item& operator[] (size_t i)
|
||||
{
|
||||
return yyitems[i];
|
||||
}
|
||||
|
||||
glr_stack_item& stackItemAt(size_t index) {
|
||||
glr_stack_item& stackItemAt (size_t index)
|
||||
{
|
||||
return yyitems[index];
|
||||
}
|
||||
|
||||
@@ -1647,7 +1655,7 @@ public:
|
||||
/** Assuming that YYS is a GLRState somewhere on *this, update the
|
||||
* splitpoint of *this, if needed, so that it is at least as deep as
|
||||
* YYS. */
|
||||
inline void
|
||||
void
|
||||
yyupdateSplit (glr_state& yys)
|
||||
{
|
||||
if (isSplit() && &yys < yysplitPoint)
|
||||
@@ -1683,7 +1691,7 @@ public:
|
||||
/* Do nothing if YYNORMAL or if *YYLOW <= YYLOW1. Otherwise, fill in
|
||||
* YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1.
|
||||
* For convenience, always return YYLOW1. */
|
||||
inline int
|
||||
int
|
||||
yyfill (glr_stack_item *yyvsp, int &yylow, int yylow1, bool yynormal)
|
||||
{
|
||||
if (!yynormal && yylow1 < yylow)
|
||||
@@ -1733,7 +1741,7 @@ public:
|
||||
| Report that stack #YYK of *YYSTACKP is going to be reduced by YYRULE. |
|
||||
`----------------------------------------------------------------------*/
|
||||
|
||||
inline void
|
||||
void
|
||||
yy_reduce_print (bool yynormal, glr_stack_item* yyvsp, state_set_index yyk,
|
||||
rule_num yyrule, ]b4_namespace_ref[::]b4_parser_class[& yyparser)
|
||||
{
|
||||
@@ -1832,7 +1840,8 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
size_t spaceLeft() const {
|
||||
size_t spaceLeft() const
|
||||
{
|
||||
return yyitems.capacity() - yyitems.size();
|
||||
}
|
||||
|
||||
@@ -1840,7 +1849,7 @@ public:
|
||||
* if YYIS_STATE, and otherwise a semantic option. Callers should call
|
||||
* yyreserveStack afterwards to make sure there is sufficient
|
||||
* headroom. */
|
||||
inline size_t
|
||||
size_t
|
||||
yynewGLRStackItem (bool yyis_state)
|
||||
{
|
||||
YYDASSERT(yyitems.size() < yyitems.capacity());
|
||||
@@ -2206,8 +2215,8 @@ public:
|
||||
yystateStack.yytops.yymarkStackDeleted (yyk);
|
||||
return yyok;
|
||||
}
|
||||
const YYRESULTTAG yyflag = yyglrReduce (yyk, yyrule,
|
||||
yyimmediate[yyrule]);
|
||||
const YYRESULTTAG yyflag
|
||||
= yyglrReduce (yyk, yyrule, yyimmediate[yyrule]);
|
||||
if (yyflag == yyerr)
|
||||
{
|
||||
YY_DEBUG_STREAM << "Stack " << yyk.get() << " dies "
|
||||
@@ -2231,8 +2240,7 @@ public:
|
||||
YY_DEBUG_STREAM << "Splitting off stack " << yynewStack.get()
|
||||
<< " from " << yyk.get() << ".\n";
|
||||
YYRESULTTAG yyflag =
|
||||
yyglrReduce (yynewStack, *yyconflicts,
|
||||
yyimmediate[*yyconflicts]);
|
||||
yyglrReduce (yynewStack, *yyconflicts, yyimmediate[*yyconflicts]);
|
||||
if (yyflag == yyok)
|
||||
YYCHK (yyprocessOneStack (yynewStack,
|
||||
yyposn]b4_locations_if([, yylocp])[));
|
||||
@@ -2255,8 +2263,8 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
YYRESULTTAG yyflag = yyglrReduce (yyk, -yyaction,
|
||||
yyimmediate[-yyaction]);
|
||||
YYRESULTTAG yyflag
|
||||
= yyglrReduce (yyk, -yyaction, yyimmediate[-yyaction]);
|
||||
if (yyflag == yyerr)
|
||||
{
|
||||
YY_DEBUG_STREAM << "Stack " << yyk.get() << " dies "
|
||||
@@ -2363,7 +2371,7 @@ public:
|
||||
* have been previously resolved. Set *YYVALP to the resulting value,
|
||||
* and *YYLOCP to the computed location (if any). Return value is as
|
||||
* for userAction. */
|
||||
inline YYRESULTTAG
|
||||
YYRESULTTAG
|
||||
yydoAction (state_set_index yyk, rule_num yyrule,
|
||||
value_type* yyvalp]b4_locations_if([, location_type* yylocp])[)
|
||||
{
|
||||
@@ -2412,9 +2420,8 @@ public:
|
||||
* *YYSTACKP. In this case, the semantic value is
|
||||
* added to the options for the existing state's semantic value.
|
||||
*/
|
||||
inline YYRESULTTAG
|
||||
yyglrReduce (state_set_index yyk, rule_num yyrule,
|
||||
bool yyforceEval)
|
||||
YYRESULTTAG
|
||||
yyglrReduce (state_set_index yyk, rule_num yyrule, bool yyforceEval)
|
||||
{
|
||||
size_t yyposn = topState(yyk)->yyposn;
|
||||
|
||||
@@ -2482,7 +2489,7 @@ public:
|
||||
/** Shift stack #YYK of *YYSTACKP, to a new state corresponding to LR
|
||||
* state YYLRSTATE, at input position YYPOSN, with the (unresolved)
|
||||
* semantic value of YYRHS under the action for YYRULE. */
|
||||
inline void
|
||||
void
|
||||
yyglrShiftDefer (state_set_index yyk, state_num yylrState,
|
||||
size_t yyposn, glr_state* yyrhs, rule_num yyrule)
|
||||
{
|
||||
@@ -2498,7 +2505,7 @@ public:
|
||||
/** Shift to a new state on stack #YYK of *YYSTACKP, corresponding to LR
|
||||
* state YYLRSTATE, at input position YYPOSN, with (resolved) semantic
|
||||
* value *YYVALP and source location *YYLOCP. */
|
||||
inline void
|
||||
void
|
||||
yyglrShift (state_set_index yyk, state_num yylrState,
|
||||
size_t yyposn,
|
||||
value_type& yyval_arg]b4_locations_if([, location_type* yylocp])[)
|
||||
|
||||
Reference in New Issue
Block a user