code: protected SchemaInformedFirstStartTagGrammar translateTypeDefinitionToFSA(
  			XSTypeDefinition td) throws EXIException {
  		SchemaInformedFirstStartTagGrammar type_i = null;
  		QName typeName = null;
  
  		// type rule already created?
  		if (!td.getAnonymous()) {
  			typeName = new QName(td.getNamespace(), td.getName());
  			if ((type_i = grammarTypes.get(typeName)) != null) {
  				return type_i;
  			}
  		}
  
  		// simple vs. complex type handling
  		if (td.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
  			XSComplexTypeDefinition ctd = (XSComplexTypeDefinition) td;
  			type_i = translateComplexTypeDefinitionToFSA(ctd);
  		} else {
  			assert (td.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE);
  			XSSimpleTypeDefinition std = (XSSimpleTypeDefinition) td;
  			type_i = translateSimpleTypeDefinitionToFSA(std);
  		}
  
  		if (!td.getAnonymous()) {
  			// add to localName table for string table pre-population
  			addLocalNameStringEntry(td.getNamespace(), td.getName());
  			// type_i.setTypeName(typeName);
  			grammarTypes.put(typeName, type_i);
  		}
  
  		return type_i;
  	}
docs: Given an XML Schema type definition T i , two type grammars are created,
  which are denoted by Type i and TypeEmpty i . Type i is a grammar that
  fully reflects the type definition of T i , whereas TypeEmpty i is a
  grammar that accepts only the attribute uses and attribute wildcards of T
  i , if any.
  
  @param td
  type definition
  @return schema-informed first start tag grammar
  @throws EXIException
  EXI exception