violations.addViolation("No productions are defined", location);
for (Enumeration e = productions.elements(); e.hasMoreElements();)
violations.addViolations(((Production)e.nextElement()).validate());
SymbolSet ntsymbols = getSymbols().getNonterminals();
for (int i = 0; i<ntsymbols.getSymbolCount(); i++)
{
if (!contains(ntsymbols.getSymbol(i)))
violations.addViolation("Nonterminal symbol \""+ntsymbols.getSymbol(i)+"\""+
"is not defined through a production", location);
if (ntsymbols.getSymbol(i).getName().equals("error"))
violations.addViolation("Nonterminal symbol with name \"error\" is not allowed", location);
}
SymbolSet tsymbols = getSymbols().getTerminals();
for (int i = 0; i<tsymbols.getSymbolCount(); i++)
{
if ((!(tsymbols.getSymbol(i) instanceof Error)) &&
(tsymbols.getSymbol(i).getName().equals("error")))
violations.addViolation("Terminal symbol with name \"error\" is not allowed", location);
}
return violations;
}