in src/com/amazon/ion/impl/SymbolTableReader.java [984:1047]
public void stepOut()
{
int new_state = -1;
switch (_current_state) {
case S_IN_STRUCT:
case S_NAME:
case S_VERSION:
case S_MAX_ID:
case S_IMPORT_LIST:
case S_AFTER_IMPORT_LIST:
case S_SYMBOL_LIST:
case S_STRUCT_CLOSE:
// these are all top level so stepOut()
// ends up at the end of our data
new_state = S_EOF;
break;
case S_IN_IMPORTS:
case S_IMPORT_STRUCT:
case S_IMPORT_LIST_CLOSE:
// if we're outside a struct, and we're in the import
// list stepOut will be whatever follows the import list
// close and we're done with these
_current_import = null;
_import_iterator = null;
new_state = stateFollowingImportList(Op.STEPOUT);
break;
case S_IN_IMPORT_STRUCT:
case S_IMPORT_NAME:
case S_IMPORT_VERSION:
case S_IMPORT_MAX_ID:
case S_IMPORT_STRUCT_CLOSE:
// if there is a next import the next state
// will be its struct open
// otherwise next will be the list close
if (_import_iterator.hasNext()) {
new_state = S_IMPORT_STRUCT;
}
else {
new_state = S_IMPORT_LIST_CLOSE;
}
break;
case S_IN_SYMBOLS:
case S_SYMBOL:
case S_SYMBOL_LIST_CLOSE:
// I think this is just S_EOF, but if we ever
// put anything after the symbol list this
// will need to be updated. And we're done
// with our local symbol references.
_string_value = null;
_local_symbols = null;
new_state = stateFollowingLocalSymbols();
break;
default:
throw new IllegalStateException("current value is not in a container");
}
_current_state = new_state;
return;
}