Added SLR(1) support in inputparser

This commit is contained in:
Thomas Avé 2017-01-02 16:04:07 +01:00
parent f1d9d5b7b3
commit 7f276d7375
1 changed files with 3 additions and 3 deletions

View File

@ -34,6 +34,8 @@ namespace pds {
if(token.type == ParsodusLexer::PARSERTYPE) { if(token.type == ParsodusLexer::PARSERTYPE) {
if(token.content == "lalr(1)") { if(token.content == "lalr(1)") {
config.parserType = util::ParserType::LALR_1; config.parserType = util::ParserType::LALR_1;
} else if(token.content == "SLR(1)") {
config.parserType = util::ParserType::SLR_1;
} else } else
throw InputParserException("Unkown parser type"); throw InputParserException("Unkown parser type");
} else { } else {
@ -108,9 +110,7 @@ namespace pds {
} }
} }
} catch(ParsodusLexer::NoMoreTokens& err) { } catch(ParsodusLexer::NoMoreTokens& err) {}
}
return config; return config;
} }
void InputParser::lexColon(ParsodusLexer& lex, ParsodusLexer::Token &token, bool nextoken) { void InputParser::lexColon(ParsodusLexer& lex, ParsodusLexer::Token &token, bool nextoken) {