code: private static String nextToken(String[] tokens, int x, String context)
              throws ParseException {
          if (x < tokens.length) {
              return tokens[x];
          }
          throw new ParseException("missing token at end of '" + context + "'", -1);
      }
docs: /*
  Returns the token at x if available, else throws a parse exception.