reallocateOtherStacks method

void reallocateOtherStacks(
  1. int start_token_index
)

Implementation

void reallocateOtherStacks(int start_token_index) {
  // assert(super.stateStack != null);
  var length = super.stateStack.length;
  var fill = 0;
  if (actionStack.isEmpty) {
    actionStack = List.filled(length, fill);
    super.locationStack = List.filled(length, fill);
    super.parseStack = List.filled(length, null);

    actionStack[0] = 0;
    locationStack[0] = start_token_index;
  } else if (actionStack.length < super.stateStack.length) {
    var old_length = actionStack.length;
    ArrayList.copy(actionStack, 0, actionStack = List.filled(length, fill), 0,
        old_length);
    ArrayList.copy(super.locationStack, 0,
        super.locationStack = List.filled(length, fill), 0, old_length);
    ArrayList.copy(super.parseStack, 0,
        super.parseStack = List.filled(length, null), 0, old_length);
  }
  return;
}