private void addGrammars(ASModelImpl model, XSGrammarBucket grammarBucket) {
   SchemaGrammar[] grammarList = grammarBucket.getGrammars();
   for (int i = 0; i < grammarList.length; i++) {
     ASModelImpl newModel = new ASModelImpl();
     newModel.setGrammar(grammarList[i]);
     model.addASModel(newModel);
   }
 } // addGrammars
 private void initGrammarBucketRecurse(ASModelImpl currModel) {
   if (currModel.getGrammar() != null) {
     fGrammarBucket.putGrammar(currModel.getGrammar());
   }
   for (int i = 0; i < currModel.getInternalASModels().size(); i++) {
     ASModelImpl nextModel = (ASModelImpl) (currModel.getInternalASModels().elementAt(i));
     initGrammarBucketRecurse(nextModel);
   }
 }
 private void initGrammarPool(ASModelImpl currModel, XMLGrammarPool grammarPool) {
   // put all the grammars in fAbstractSchema into the grammar pool.
   // grammarPool must never be null!
   Grammar[] grammars = new Grammar[1];
   if ((grammars[0] = (Grammar) currModel.getGrammar()) != null) {
     grammarPool.cacheGrammars(grammars[0].getGrammarDescription().getGrammarType(), grammars);
   }
   Vector modelStore = currModel.getInternalASModels();
   for (int i = 0; i < modelStore.size(); i++) {
     initGrammarPool((ASModelImpl) modelStore.elementAt(i), grammarPool);
   }
 }