コード例 #1
0
 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);
   }
 }
コード例 #2
0
 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);
   }
 }