diff options
Diffstat (limited to 'grammer.h')
-rw-r--r-- | grammer.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -4,6 +4,7 @@ #include "minicc.h" #include <cstdint> +#include <utility> namespace Gram { @@ -16,7 +17,7 @@ struct TreeNode { std::string type; index_t variant; // bnf[type][variant] - std::deque<std::string> alternative_types; // alternatives that we can consider if type fails. Discard after parsing! + std::deque<std::pair<std::string, index_t>> alternatives; // [type][value] alternatives that we can consider on fail. Discard after parsing! std::vector<int32_t> child_ids; // < 0: terminal: token_id; >= 0: non-terminal: node_id; fill token by token }; |