summaryrefslogtreecommitdiffhomepage
path: root/grammer.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-03-21 22:11:57 +0100
committerRoland Reichwein <mail@reichwein.it>2020-03-21 22:11:57 +0100
commit365183e243d164185bca6ad9fa4e0d75664800f4 (patch)
treee488e99f78551773518c2fb946cbd165bb6a8c90 /grammer.cpp
parentcdf001920fde6652b344775589b0524ff6529809 (diff)
C++ grammer (WIP)
Diffstat (limited to 'grammer.cpp')
-rw-r--r--grammer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/grammer.cpp b/grammer.cpp
index 2379e9a..5557b12 100644
--- a/grammer.cpp
+++ b/grammer.cpp
@@ -230,6 +230,8 @@ bool Compiler::AddRootNode()
const auto& variants{bnf[type]};
for (int i = 0; i < variants.size(); i++) {
const std::vector<std::string> & variant{variants[i]};
+ if (variant.size() == 0)
+ continue; // TODO: Handle case of empty rule (see e.g. C++ "attribute-list")
if (child_type == variant[0]) {
if (node_type == "") {
node_type = type;