final public HtmlDocument.HtmlElement Tag() throws ParseException {
  Token t, et;
  HtmlDocument.AttributeList alist;
  Token firstToken = getToken(1);
    try {
      jj_consume_token(TAG_START);
      t = jj_consume_token(TAG_NAME);
      alist = AttributeList();
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case TAG_END:
        et = jj_consume_token(TAG_END);
        break;
      case TAG_SLASHEND:
        et = jj_consume_token(TAG_SLASHEND);
        break;
      default:
        jj_la1[5] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      HtmlDocument.Tag tag = new HtmlDocument.Tag(t.image, alist);
      if (et.kind == TAG_SLASHEND) tag.setEmpty(true);
      {if (true) return tag;}
    } catch (ParseException ex) {
    token_source.SwitchTo(DEFAULT);
    String s = getTokenText(firstToken, getNextToken());
    {if (true) return new HtmlDocument.Text(s);}
    }
    throw new Error("Missing return statement in function");
  }