diff --git a/include/Parsodus/grammar.h b/include/Parsodus/grammar.h index 23dd707..018e974 100644 --- a/include/Parsodus/grammar.h +++ b/include/Parsodus/grammar.h @@ -35,11 +35,11 @@ namespace pds { } } - Rule() : head(""), tail(), name("") {} - Rule(const std::string& h, const std::vector& t) : head(h), tail(t), name("") {} - Rule(const std::string& h, const std::vector& t, const std::string& name) : head(h), tail(t), name(name) {} - Rule(const std::string& h, const std::vector& t, const std::string& name, std::pair> precedence) : - head(h), tail(t), name(name), precedence(precedence) {} + Rule() : Rule("", {}, ""){} + Rule(const std::string& h, const std::vector& t) : Rule(h, t, "") {} + Rule(const std::string& h, const std::vector& t, const std::string& name) : head(h), tail(t), name(name), precedence{false, {0, PrecedenceType::RIGHT}} {} + Rule(const std::string& h, const std::vector& t, const std::string& name, std::pair precedence) : + head(h), tail(t), name(name), precedence{true, precedence} {} }; /** @@ -56,7 +56,7 @@ namespace pds { std::unique_ptr first; std::unique_ptr follow; - Grammar() : start(""), variables(), terminals(), rules(), first(nullptr), follow(nullptr) + Grammar() : start(""), variables(), terminals(), rules(), precedence(), first(nullptr), follow(nullptr) {} Grammar(const Grammar& rhs)