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