public Grammar getOutermostGrammar() {
        if ( parent==null ) return this;
        return parent.getOutermostGrammar();
    }
Return the grammar that imported us and our parents. Return this
 if we're root.
tool/src/org/antlr/v4/tool/Grammar.java