// track whether a grammar file needed to have a grammar expanded
GrammarFile gf = hier.getFile(getFileName());
gf.setExpanded(true);
// Copy rules from supergrammar into this grammar
IndexedVector inhRules = superG.getRules();
for (Enumeration e = inhRules.elements(); e.hasMoreElements();) {
Rule r = (Rule)e.nextElement();
inherit(r, superG);
}
// Copy options from supergrammar into this grammar
// Modify tokdef options so that they point to dir of enclosing grammar
IndexedVector inhOptions = superG.getOptions();
if (inhOptions != null) {
for (Enumeration e = inhOptions.elements(); e.hasMoreElements();) {
Option o = (Option)e.nextElement();
inherit(o, superG);
}
}