From 8feccee75dadbf970b2fb402a8c624ed9b25f041 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 10 Apr 2015 03:04:22 +0200 Subject: generator_slr: implement first and follow set generation --- src/symbol.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/symbol.hpp') diff --git a/src/symbol.hpp b/src/symbol.hpp index 0e79eb6..e468d37 100644 --- a/src/symbol.hpp +++ b/src/symbol.hpp @@ -49,6 +49,7 @@ struct symbol_t : public std::tuple { return std::get<1>(*this); } + static symbol_t make_nonterm(const std::string &value) { return symbol_t(SYMBOL_TYPE_NONTERM, value); } @@ -61,6 +62,10 @@ struct symbol_t : public std::tuple { char v[2] = {char(value), 0}; return symbol_t(SYMBOL_TYPE_CHAR, v); } + + static symbol_t empty() { + return make_term(""); + } }; } -- cgit v1.2.3