glr2.cc: formatting changes

* data/skeletons/glr2.cc: here.
This commit is contained in:
Akim Demaille
2021-01-15 19:27:01 +01:00
parent 0a4a7178c8
commit 0923da74e8

View File

@@ -1718,43 +1718,50 @@ public:
return yyitems[index]; return yyitems[index];
} }
size_t numTops() const { size_t numTops () const
return yytops.size(); {
return yytops.size ();
} }
glr_state* firstTop() const { glr_state* firstTop () const
return yytops[create_state_set_index(0)]; {
return yytops[create_state_set_index (0)];
} }
glr_state* topAt(state_set_index i) const { glr_state* topAt (state_set_index i) const
{
return yytops[i]; return yytops[i];
} }
void setFirstTop(glr_state* value) { void setFirstTop (glr_state* value)
yytops[create_state_set_index(0)] = value; {
yytops[create_state_set_index (0)] = value;
} }
void setTopAt(state_set_index i, glr_state* value) { void setTopAt (state_set_index i, glr_state* value)
{
yytops[i] = value; yytops[i] = value;
} }
void pop_back() { void pop_back ()
yyitems.pop_back(); {
yyitems.pop_back ();
} }
void pop_back(size_t n) { void pop_back (size_t n)
yyitems.resize(yyitems.size() - n); {
yyitems.resize (yyitems.size () - n);
} }
state_set_index state_set_index
yysplitStack (state_set_index yyk) yysplitStack (state_set_index yyk)
{ {
if (!isSplit()) if (!isSplit ())
{ {
YYASSERT (yyk.get() == 0); YYASSERT (yyk.get () == 0);
yysplitPoint = topAt(yyk); yysplitPoint = topAt (yyk);
} }
return yytops.yysplitStack(yyk); return yytops.yysplitStack (yyk);
} }
/** Assuming that YYS is a GLRState somewhere on *this, update the /** Assuming that YYS is a GLRState somewhere on *this, update the
@@ -2334,7 +2341,7 @@ b4_dollar_popdef])[]dnl
const char *yyformat = YY_NULLPTR; const char *yyformat = YY_NULLPTR;
switch (yycount) switch (yycount)
{ {
#define YYCASE_(N, S) \ #define YYCASE_(N, S) \
case N: \ case N: \
yyformat = S; \ yyformat = S; \
break break
@@ -2620,14 +2627,14 @@ b4_dollar_popdef])[]dnl
YYRESULTTAG YYRESULTTAG
yyresolveStack () yyresolveStack ()
{ {
if (yystateStack.isSplit()) if (yystateStack.isSplit ())
{ {
int yyn = 0; int yyn = 0;
for (glr_state* yys = firstTopState(); for (glr_state* yys = firstTopState ();
yys != yystateStack.yysplitPoint; yys != yystateStack.yysplitPoint;
yys = yys->pred()) yys = yys->pred ())
yyn += 1; yyn += 1;
YYCHK (yyresolveStates (*firstTopState(), yyn)); YYCHK (yyresolveStates (*firstTopState (), yyn));
} }
return yyok; return yyok;
} }