code: public FileDefinition read() {
  
  		// Parse blocks
  		try {
  			fillIn();
  			mergeContiguousRegions( this.definitionFile.getBlocks());
  
  		} catch( IOException e ) {
  			addModelError( ErrorCode.P_IO_ERROR, this.currentLineNumber, exception( e ));
  		}
  
  		// Determine file type
  		boolean hasFacets = false, hasComponents = false, hasInstances = false, hasImports = false;
  		int ignorableBlocksCount = 0;
  		for( AbstractBlock block : this.definitionFile.getBlocks()) {
  
  			if( block.getInstructionType() == AbstractBlock.COMPONENT )
  				hasComponents = true;
  
  			else if( block.getInstructionType() == AbstractBlock.FACET )
  				hasFacets = true;
  
  			else if( block.getInstructionType() == AbstractBlock.INSTANCEOF )
  				hasInstances = true;
  
  			else if( block.getInstructionType() == AbstractBlock.IMPORT )
  				hasImports = true;
  
  			else if( block instanceof AbstractIgnorableInstruction )
  				ignorableBlocksCount ++;
  		}
  
  		if( hasInstances ) {
  			if( ! hasFacets && ! hasComponents )
  				this.definitionFile.setFileType( FileDefinition.INSTANCE );
  			else
  				addModelError( ErrorCode.P_INVALID_FILE_TYPE, 1 );
  
  		} else if( hasFacets || hasComponents ) {
  			this.definitionFile.setFileType( FileDefinition.GRAPH );
  
  		} else if( hasImports ) {
  			this.definitionFile.setFileType( FileDefinition.AGGREGATOR );
  
  		} else if( ignorableBlocksCount == this.definitionFile.getBlocks().size()) {
  			addModelError( ErrorCode.P_EMPTY_FILE, 1 );
  			this.definitionFile.setFileType( FileDefinition.EMPTY );
  		}
  
  		return this.definitionFile;
  	}
docs: Reads a definition file.
  @return an instance of {@link FileDefinition} (never null)
  <p>
  Parsing errors are stored in the result.<br>
  See {@link FileDefinition#getParsingErrors()}.
  </p>