Use PrecedenceRange in build_lex_table
This commit is contained in:
parent
11a1ea8dfe
commit
5455fb977f
5 changed files with 37 additions and 40 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include <vector>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include "compiler/precedence_range.h"
|
||||
#include "compiler/rules/symbol.h"
|
||||
#include "compiler/rules/character_set.h"
|
||||
|
||||
|
|
@ -18,19 +19,19 @@ typedef enum {
|
|||
|
||||
class LexAction {
|
||||
LexAction(LexActionType type, size_t state_index, rules::Symbol symbol,
|
||||
std::set<int> precedence_values);
|
||||
PrecedenceRange precedence_range);
|
||||
|
||||
public:
|
||||
LexAction();
|
||||
static LexAction Accept(rules::Symbol symbol, int precedence);
|
||||
static LexAction Error();
|
||||
static LexAction Advance(size_t state_index, std::set<int> precedence_values);
|
||||
static LexAction Advance(size_t state_index, PrecedenceRange precedence_range);
|
||||
bool operator==(const LexAction &action) const;
|
||||
|
||||
LexActionType type;
|
||||
rules::Symbol symbol;
|
||||
size_t state_index;
|
||||
std::set<int> precedence_values;
|
||||
PrecedenceRange precedence_range;
|
||||
};
|
||||
|
||||
} // namespace tree_sitter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue