#ifndef COMPILER_SYNTAX_GRAMMAR_H_ #define COMPILER_SYNTAX_GRAMMAR_H_ #include #include #include #include "compiler/rule.h" #include "compiler/grammar.h" namespace tree_sitter { struct ProductionStep { inline bool operator==(const ProductionStep &other) const { return symbol == other.symbol && precedence == other.precedence && associativity == other.associativity; } rules::Symbol symbol; int precedence; rules::Associativity associativity; }; typedef std::vector Production; struct SyntaxVariable { std::string name; VariableType type; std::vector productions; }; using ConflictSet = std::set; struct SyntaxGrammar { std::vector variables; std::set extra_tokens; std::set expected_conflicts; std::vector external_tokens; }; } // namespace tree_sitter #endif // COMPILER_SYNTAX_GRAMMAR_H_