From 365183e243d164185bca6ad9fa4e0d75664800f4 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 21 Mar 2020 22:11:57 +0100 Subject: C++ grammer (WIP) --- grammer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'grammer.cpp') 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 & 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; -- cgit v1.2.3