Look for non existing terminals in precedence rules
This commit is contained in:
parent
bb528821ad
commit
aecc191937
|
@ -72,6 +72,13 @@ namespace pds {
|
|||
else rule->precedence = {false,{0, PrecedenceType::RIGHT}};
|
||||
}
|
||||
|
||||
// Check if all terminals in precedence rules, are terminals
|
||||
for(auto& prec : cnf.grammar.precedence)
|
||||
|
||||
if (cnf.grammar.terminals.find(prec.first) == cnf.grammar.terminals.end())
|
||||
throw InputParserException("Found \"" + prec.first + "\" in precedence, which is no terminal.");
|
||||
|
||||
|
||||
return cnf;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue