Remove unused methods and members

This commit is contained in:
Max Brunsfeld 2013-12-17 18:27:32 -08:00
parent 3417ad5adb
commit 2f74c1de10
3 changed files with 10 additions and 54 deletions

View file

@ -10,22 +10,20 @@ namespace tree_sitter {
namespace lr {
typedef enum {
ParseActionTypeAccept,
ParseActionTypeAdvance,
ParseActionTypeError,
ParseActionTypeShift,
ParseActionTypeReduce,
} ParseActionType;
class ParseAction {
public:
ParseAction();
ParseAction(ParseActionType type, size_t state_index, std::string symbol_name, size_t child_symbol_count);
bool operator==(const ParseAction &action) const;
public:
static ParseAction Accept();
static ParseAction Advance(size_t state_index);
static ParseAction Error();
static ParseAction Shift(size_t state_index);
static ParseAction Reduce(std::string symbol_name, size_t child_symbol_count);
bool operator==(const ParseAction &action) const;
ParseActionType type;
size_t child_symbol_count;
@ -43,21 +41,16 @@ namespace tree_sitter {
class ParseTable {
public:
std::vector<ParseState> states;
const std::unordered_map<std::string, size_t> symbol_ids;
const std::vector<std::string> symbol_names;
ParseTable(std::vector<std::string> rule_names);
ParseState starting_state() const;
ParseState get_state(size_t index) const;
ParseAction action_for(size_t state_index, std::string symbol_name) const;
std::unordered_map<std::string, std::unordered_set<ParseAction>> actions_for(size_t state_index) const;
size_t add_state();
void add_action(size_t state_index, std::string symbol_name, ParseAction action);
static const std::string START;
static const std::string END_OF_INPUT;
std::vector<ParseState> states;
const std::vector<std::string> symbol_names;
};
}
}