Allow anonymous tokens to be used in grammars' external token lists
This commit is contained in:
parent
e2baf0930b
commit
ed8fbff175
24 changed files with 282 additions and 183 deletions
|
|
@ -30,6 +30,18 @@ struct SyntaxVariable {
|
|||
|
||||
using ConflictSet = std::set<rules::Symbol>;
|
||||
|
||||
struct ExternalToken {
|
||||
std::string name;
|
||||
VariableType type;
|
||||
rules::Symbol corresponding_internal_token;
|
||||
|
||||
inline bool operator==(const ExternalToken &other) const {
|
||||
return name == other.name &&
|
||||
type == other.type &&
|
||||
corresponding_internal_token == other.corresponding_internal_token;
|
||||
}
|
||||
};
|
||||
|
||||
struct SyntaxGrammar {
|
||||
std::vector<SyntaxVariable> variables;
|
||||
std::set<rules::Symbol> extra_tokens;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue