gr = (Grammar)hier.getGrammar(sub.getText());
if ( gr!=null ) {
// antlr.Tool.toolError("redefinition of grammar "+gr.getName()+" ignored");
gr=null;
throw new SemanticException("redefinition of grammar "+sub.getText(), file, sub.getLine(), sub.getColumn());
}
else {
gr = new Grammar(hier.getTool(), sub.getText(), sup.getText(), rules);
gr.superClass=sc;
if ( preamble!=null ) {