diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-01-30 08:47:51 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-01-30 08:47:51 +0100 |
commit | d99d80e862c2799d0dc9a567b710c7b05d6a47a4 (patch) | |
tree | 6a6f0f66751c6080389904937757ce4ea0daa606 /grammer.h | |
parent | 1f3f7c2693686d847bf1a9bb3e47a023fe9d7992 (diff) |
Fix alternatives handling
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 }; |