code: @SuppressWarnings("unchecked")
      public <T> T pop(Class<T> declarationClass) {
          Object declaration = declarationStack.pop();
          if (declarationClass.isAssignableFrom(declaration.getClass())) {
              return (T) declaration;
          }
          return fail(declaration, declarationClass);
      }
docs: Pop an element from from a declaration stack.
  Used by parse listeners.