mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-27 13:13:04 +00:00
glr: formatting changes
* data/skeletons/glr.c: Formatting changes. * data/skeletons/glr2.cc: Ditto. (glr_state_set::INITIAL_NUMBER_STATES): Remove, unused (and useless: let std::vector deal with that).
This commit is contained in:
@@ -498,7 +498,8 @@ typedef struct yySemanticOption yySemanticOption;
|
||||
typedef union yyGLRStackItem yyGLRStackItem;
|
||||
typedef struct yyGLRStack yyGLRStack;
|
||||
|
||||
struct yyGLRState {
|
||||
struct yyGLRState
|
||||
{
|
||||
/** Type tag: always true. */
|
||||
yybool yyisState;
|
||||
/** Type tag for yysemantics. If true, yysval applies, otherwise
|
||||
@@ -522,7 +523,8 @@ struct yyGLRState {
|
||||
YYLTYPE yyloc;]])[
|
||||
};
|
||||
|
||||
struct yyGLRStateSet {
|
||||
struct yyGLRStateSet
|
||||
{
|
||||
yyGLRState** yystates;
|
||||
/** During nondeterministic operation, yylookaheadNeeds tracks which
|
||||
* stacks have actually needed the current lookahead. During deterministic
|
||||
@@ -533,7 +535,8 @@ struct yyGLRStateSet {
|
||||
YYPTRDIFF_T yycapacity;
|
||||
};
|
||||
|
||||
struct yySemanticOption {
|
||||
struct yySemanticOption
|
||||
{
|
||||
/** Type tag: always false. */
|
||||
yybool yyisState;
|
||||
/** Rule number for this reduction */
|
||||
|
||||
@@ -918,7 +918,8 @@ public:
|
||||
|
||||
/** A stack of GLRState representing the different heads during
|
||||
* nondeterministic evaluation. */
|
||||
class glr_state_set {
|
||||
class glr_state_set
|
||||
{
|
||||
public:
|
||||
/** Initialize YYSET to a singleton set containing an empty stack. */
|
||||
glr_state_set ()
|
||||
@@ -929,32 +930,38 @@ class glr_state_set {
|
||||
}
|
||||
|
||||
// Behave like a vector of states.
|
||||
glr_state*& operator[](state_set_index index) {
|
||||
glr_state*& operator[] (state_set_index index)
|
||||
{
|
||||
return yystates[index.uget()];
|
||||
}
|
||||
|
||||
glr_state* operator[](state_set_index index) const {
|
||||
glr_state* operator[] (state_set_index index) const
|
||||
{
|
||||
return yystates[index.uget()];
|
||||
}
|
||||
|
||||
size_t size() const {
|
||||
size_t size () const
|
||||
{
|
||||
return yystates.size ();
|
||||
}
|
||||
|
||||
std::vector<glr_state*>::iterator begin() {
|
||||
std::vector<glr_state*>::iterator begin ()
|
||||
{
|
||||
return yystates.begin ();
|
||||
}
|
||||
|
||||
std::vector<glr_state*>::iterator end() {
|
||||
std::vector<glr_state*>::iterator end ()
|
||||
{
|
||||
return yystates.end ();
|
||||
}
|
||||
|
||||
|
||||
bool lookaheadNeeds(state_set_index index) const {
|
||||
bool lookaheadNeeds (state_set_index index) const
|
||||
{
|
||||
return yylookaheadNeeds[index.uget ()];
|
||||
}
|
||||
|
||||
bool setLookaheadNeeds(state_set_index index, bool value) {
|
||||
bool setLookaheadNeeds (state_set_index index, bool value)
|
||||
{
|
||||
return yylookaheadNeeds[index.uget ()] = value;
|
||||
}
|
||||
|
||||
@@ -1029,7 +1036,8 @@ class glr_state_set {
|
||||
return create_state_set_index (static_cast<std::ptrdiff_t> (yystates.size () - 1));
|
||||
}
|
||||
|
||||
void clearLastDeleted() {
|
||||
void clearLastDeleted ()
|
||||
{
|
||||
yylastDeleted = YY_NULLPTR;
|
||||
}
|
||||
|
||||
@@ -1044,8 +1052,6 @@ class glr_state_set {
|
||||
|
||||
/** The last stack we invalidated. */
|
||||
glr_state* yylastDeleted;
|
||||
|
||||
static const size_t INITIAL_NUMBER_STATES = 16;
|
||||
};
|
||||
|
||||
class semantic_option {
|
||||
|
||||
Reference in New Issue
Block a user