public void write(Automaton.State state) throws IOException {
super.write(state);
if (state.kind == Type.K_NOMINAL) {
NameID name = (NameID) state.data;
writeString(name.module().toString());
writeString(name.name());
} else if(state.kind == Type.K_RECORD) {
Record.State fields = (Record.State) state.data;
writer.write_bit(fields.isOpen);
writer.write_uv(fields.size());