public boolean loadSpec(String rootExternalModuleName,Errors errors) throws AbortException {
  rootParseUnit=findOrCreateParsedUnit(rootExternalModuleName,errors,true);
  rootModule=rootParseUnit.getRootModule();
  ParseUnit nextExtentionOrInstantiationParseUnit=null;
  while (findNextUnresolvedExtention(rootModule) || findNextUnresolvedInstantiation(rootModule)) {
    if (parseUnitContext.get(nextParseUnitName) == null) {
      nextExtentionOrInstantiationParseUnit=findOrCreateParsedUnit(nextParseUnitName,errors,false);
    }
 else {
      nextExtentionOrInstantiationParseUnit=(ParseUnit)parseUnitContext.get(nextParseUnitName);
    }
    ParseUnit extenderOrInstancerParseUnit=nextExtenderOrInstancerModule.getParseUnit();
    if (extentionFound) {
      extenderOrInstancerParseUnit.addExtendee(nextExtentionOrInstantiationParseUnit);
      nextExtentionOrInstantiationParseUnit.addExtendedBy(extenderOrInstancerParseUnit);
    }
    if (instantiationFound) {
      extenderOrInstancerParseUnit.addInstancee(nextExtentionOrInstantiationParseUnit);
      nextExtentionOrInstantiationParseUnit.addInstancedBy(extenderOrInstancerParseUnit);
    }
    nonCircularityTest(nextExtentionOrInstantiationParseUnit,errors);
    if (extentionFound) {
      resolveNamesBetweenSpecAndExtention(nextExtenderOrInstancerModule,nextExtentionOrInstantiationParseUnit);
    }
    if (instantiationFound) {
      resolveNamesBetweenSpecAndInstantiation(nextExtenderOrInstancerModule,nextExtentionOrInstantiationParseUnit);
    }
  }
  calculateDependencies(rootParseUnit);
  return true;
}

public boolean loadSpec ( String rootExternalModuleName , Errors errors ) throws AbortException { rootParseUnit = findOrCreateParsedUnit ( rootExternalModuleName , errors , true ) ; rootModule = rootParseUnit . getRootModule ( ) ; ParseUnit nextExtentionOrInstantiationParseUnit = null ; while ( findNextUnresolvedExtention ( rootModule ) || findNextUnresolvedInstantiation ( rootModule ) ) { if ( parseUnitContext . get ( nextParseUnitName ) == null ) { nextExtentionOrInstantiationParseUnit = findOrCreateParsedUnit ( nextParseUnitName , errors , false ) ; } else { nextExtentionOrInstantiationParseUnit = ( ParseUnit ) parseUnitContext . get ( nextParseUnitName ) ; } ParseUnit extenderOrInstancerParseUnit = nextExtenderOrInstancerModule . getParseUnit ( ) ; if ( extentionFound ) { extenderOrInstancerParseUnit . addExtendee ( nextExtentionOrInstantiationParseUnit ) ; nextExtentionOrInstantiationParseUnit . addExtendedBy ( extenderOrInstancerParseUnit ) ; } if ( instantiationFound ) { extenderOrInstancerParseUnit . addInstancee ( nextExtentionOrInstantiationParseUnit ) ; nextExtentionOrInstantiationParseUnit . addInstancedBy ( extenderOrInstancerParseUnit ) ; } nonCircularityTest ( nextExtentionOrInstantiationParseUnit , errors ) ; if ( extentionFound ) { resolveNamesBetweenSpecAndExtention ( nextExtenderOrInstancerModule , nextExtentionOrInstantiationParseUnit ) ; } if ( instantiationFound ) { resolveNamesBetweenSpecAndInstantiation ( nextExtenderOrInstancerModule , nextExtentionOrInstantiationParseUnit ) ; } } calculateDependencies ( rootParseUnit ) ; return true ; }
this method " loads " an entire specification , starting with the top - level rootexternalmodule and followed by all of the external modules it references via extends and instance statements .
