summaryrefslogtreecommitdiffhomepage
path: root/grammer.h
diff options
context:
space:
mode:
Diffstat (limited to 'grammer.h')
-rw-r--r--grammer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/grammer.h b/grammer.h
index 18719cd..996d023 100644
--- a/grammer.h
+++ b/grammer.h
@@ -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
};