forked from kdt3rd/lime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
State.h
72 lines (56 loc) · 1.9 KB
/
State.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/// @file State.h
/// @brief File that declares a class to record state transitions.
///
///
//
//
// Copyright © 2003-2013 Kimball Thurston
//
// This program is free software; you can redisribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
//
#ifndef _State_h_
#define _State_h_
#include <iosfwd>
#include "ActionList.h"
class Config;
////////////////////////////////////////
class State
{
public:
State( Config *basis, Config *config );
~State( void );
Config *getBasis( void ) const;
Config *getConfig( void ) const;
// Globally sequential number for this state.
int getStateIndex( void ) const;
void addAction( Action::Type type,
const std::string &lookAhead,
State *state,
Rule *rule );
void sortActions( void );
ActionList &getActions( void );
const ActionList &getActions( void ) const;
void compress( void );
void print( std::ostream &out, bool basisOnly ) const;
private:
Config *myBasis; // Basis Configurations for this state
Config *myConfig; // All Configurations for this set
int myStateIndex; // Sequential number for this state (auto)
ActionList myActions; // Array of actions for this state
//int tabstart; /* First index of the action table */
//int tabdfltact; /* Default action */
};
#endif /* _State_h_ */