void clear() {
    if (top != -1) {
      Arrays.fill(stack, 0, top + 1, null);
      top = -1;
    }
    this.symtab.clear();
    this.inputTab = null;
    this.visited = 0;
    MemoryCounter.reset();
  }
@Test
  public void testClear() {
    assertTrue(state.isStackEmpty());
    state.push(SelString.of("foo"));
    assertFalse(state.isStackEmpty());
    state.clear();
    assertTrue(state.isStackEmpty());
  }