org.eclipse.help.base_3.6.2.v201202080800

16:44:54.428 INFO  jd.cli.Main - Decompiling org.eclipse.help.base_3.6.2.v201202080800.jar
package org.apache.lucene.demo.html;

import java.util.Hashtable;

public class Entities
{
  static final Hashtable decoder = new Hashtable(300);
  static final String[] encoder = new String['?'];
  
  static final String decode(String entity)
  {
    if (entity.charAt(entity.length() - 1) == ';') {
      entity = entity.substring(0, entity.length() - 1);
    }
    if (entity.charAt(1) == '#')
    {
      int start = 2;
      int radix = 10;
      if ((entity.charAt(2) == 'X') || (entity.charAt(2) == 'x'))
      {
        start++;
        radix = 16;
      }
      Character c = 
        new Character((char)Integer.parseInt(entity.substring(start), radix));
      return c.toString();
    }
    String s = (String)decoder.get(entity);
    if (s != null) {
      return s;
    }
    return "";
  }
  
  public static final String encode(String s)
  {
    int length = s.length();
    StringBuffer buffer = new StringBuffer(length * 2);
    for (int i = 0; i < length; i++)
    {
      char c = s.charAt(i);
      int j = c;
      if ((j < 256) && (encoder[j] != null))
      {
        buffer.append(encoder[j]);
        buffer.append(';');
      }
      else if (j < 128)
      {
        buffer.append(c);
      }
      else
      {
        buffer.append("&#");
        buffer.append(c);
        buffer.append(';');
      }
    }
    return buffer.toString();
  }
  
  static final void add(String entity, int value)
  {
    decoder.put(entity, new Character((char)value).toString());
    if (value < 256) {
      encoder[value] = entity;
    }
  }
  
  static
  {
    add("&nbsp", 160);
    add("&iexcl", 161);
    add("&cent", 162);
    add("&pound", 163);
    add("&curren", 164);
    add("&yen", 165);
    add("&brvbar", 166);
    add("&sect", 167);
    add("&uml", 168);
    add("&copy", 169);
    add("&ordf", 170);
    add("&laquo", 171);
    add("&not", 172);
    add("&shy", 173);
    add("&reg", 174);
    add("&macr", 175);
    add("&deg", 176);
    add("&plusmn", 177);
    add("&sup2", 178);
    add("&sup3", 179);
    add("&acute", 180);
    add("&micro", 181);
    add("&para", 182);
    add("&middot", 183);
    add("&cedil", 184);
    add("&sup1", 185);
    add("&ordm", 186);
    add("&raquo", 187);
    add("&frac14", 188);
    add("&frac12", 189);
    add("&frac34", 190);
    add("&iquest", 191);
    add("&Agrave", 192);
    add("&Aacute", 193);
    add("&Acirc", 194);
    add("&Atilde", 195);
    add("&Auml", 196);
    add("&Aring", 197);
    add("&AElig", 198);
    add("&Ccedil", 199);
    add("&Egrave", 200);
    add("&Eacute", 201);
    add("&Ecirc", 202);
    add("&Euml", 203);
    add("&Igrave", 204);
    add("&Iacute", 205);
    add("&Icirc", 206);
    add("&Iuml", 207);
    add("&ETH", 208);
    add("&Ntilde", 209);
    add("&Ograve", 210);
    add("&Oacute", 211);
    add("&Ocirc", 212);
    add("&Otilde", 213);
    add("&Ouml", 214);
    add("&times", 215);
    add("&Oslash", 216);
    add("&Ugrave", 217);
    add("&Uacute", 218);
    add("&Ucirc", 219);
    add("&Uuml", 220);
    add("&Yacute", 221);
    add("&THORN", 222);
    add("&szlig", 223);
    add("&agrave", 224);
    add("&aacute", 225);
    add("&acirc", 226);
    add("&atilde", 227);
    add("&auml", 228);
    add("&aring", 229);
    add("&aelig", 230);
    add("&ccedil", 231);
    add("&egrave", 232);
    add("&eacute", 233);
    add("&ecirc", 234);
    add("&euml", 235);
    add("&igrave", 236);
    add("&iacute", 237);
    add("&icirc", 238);
    add("&iuml", 239);
    add("&eth", 240);
    add("&ntilde", 241);
    add("&ograve", 242);
    add("&oacute", 243);
    add("&ocirc", 244);
    add("&otilde", 245);
    add("&ouml", 246);
    add("&divide", 247);
    add("&oslash", 248);
    add("&ugrave", 249);
    add("&uacute", 250);
    add("&ucirc", 251);
    add("&uuml", 252);
    add("&yacute", 253);
    add("&thorn", 254);
    add("&yuml", 255);
    add("&fnof", 402);
    add("&Alpha", 913);
    add("&Beta", 914);
    add("&Gamma", 915);
    add("&Delta", 916);
    add("&Epsilon", 917);
    add("&Zeta", 918);
    add("&Eta", 919);
    add("&Theta", 920);
    add("&Iota", 921);
    add("&Kappa", 922);
    add("&Lambda", 923);
    add("&Mu", 924);
    add("&Nu", 925);
    add("&Xi", 926);
    add("&Omicron", 927);
    add("&Pi", 928);
    add("&Rho", 929);
    add("&Sigma", 931);
    add("&Tau", 932);
    add("&Upsilon", 933);
    add("&Phi", 934);
    add("&Chi", 935);
    add("&Psi", 936);
    add("&Omega", 937);
    add("&alpha", 945);
    add("&beta", 946);
    add("&gamma", 947);
    add("&delta", 948);
    add("&epsilon", 949);
    add("&zeta", 950);
    add("&eta", 951);
    add("&theta", 952);
    add("&iota", 953);
    add("&kappa", 954);
    add("&lambda", 955);
    add("&mu", 956);
    add("&nu", 957);
    add("&xi", 958);
    add("&omicron", 959);
    add("&pi", 960);
    add("&rho", 961);
    add("&sigmaf", 962);
    add("&sigma", 963);
    add("&tau", 964);
    add("&upsilon", 965);
    add("&phi", 966);
    add("&chi", 967);
    add("&psi", 968);
    add("&omega", 969);
    add("&thetasym", 977);
    add("&upsih", 978);
    add("&piv", 982);
    add("&bull", 8226);
    add("&hellip", 8230);
    add("&prime", 8242);
    add("&Prime", 8243);
    add("&oline", 8254);
    add("&frasl", 8260);
    add("&weierp", 8472);
    add("&image", 8465);
    add("&real", 8476);
    add("&trade", 8482);
    add("&alefsym", 8501);
    add("&larr", 8592);
    add("&uarr", 8593);
    add("&rarr", 8594);
    add("&darr", 8595);
    add("&harr", 8596);
    add("&crarr", 8629);
    add("&lArr", 8656);
    add("&uArr", 8657);
    add("&rArr", 8658);
    add("&dArr", 8659);
    add("&hArr", 8660);
    add("&forall", 8704);
    add("&part", 8706);
    add("&exist", 8707);
    add("&empty", 8709);
    add("&nabla", 8711);
    add("&isin", 8712);
    add("&notin", 8713);
    add("&ni", 8715);
    add("&prod", 8719);
    add("&sum", 8721);
    add("&minus", 8722);
    add("&lowast", 8727);
    add("&radic", 8730);
    add("&prop", 8733);
    add("&infin", 8734);
    add("&ang", 8736);
    add("&and", 8743);
    add("&or", 8744);
    add("&cap", 8745);
    add("&cup", 8746);
    add("&int", 8747);
    add("&there4", 8756);
    add("&sim", 8764);
    add("&cong", 8773);
    add("&asymp", 8776);
    add("&ne", 8800);
    add("&equiv", 8801);
    add("&le", 8804);
    add("&ge", 8805);
    add("&sub", 8834);
    add("&sup", 8835);
    add("&nsub", 8836);
    add("&sube", 8838);
    add("&supe", 8839);
    add("&oplus", 8853);
    add("&otimes", 8855);
    add("&perp", 8869);
    add("&sdot", 8901);
    add("&lceil", 8968);
    add("&rceil", 8969);
    add("&lfloor", 8970);
    add("&rfloor", 8971);
    add("&lang", 9001);
    add("&rang", 9002);
    add("&loz", 9674);
    add("&spades", 9824);
    add("&clubs", 9827);
    add("&hearts", 9829);
    add("&diams", 9830);
    add("&quot", 34);
    add("&amp", 38);
    add("&lt", 60);
    add("&gt", 62);
    add("&OElig", 338);
    add("&oelig", 339);
    add("&Scaron", 352);
    add("&scaron", 353);
    add("&Yuml", 376);
    add("&circ", 710);
    add("&tilde", 732);
    add("&ensp", 8194);
    add("&emsp", 8195);
    add("&thinsp", 8201);
    add("&zwnj", 8204);
    add("&zwj", 8205);
    add("&lrm", 8206);
    add("&rlm", 8207);
    add("&ndash", 8211);
    add("&mdash", 8212);
    add("&lsquo", 8216);
    add("&rsquo", 8217);
    add("&sbquo", 8218);
    add("&ldquo", 8220);
    add("&rdquo", 8221);
    add("&bdquo", 8222);
    add("&dagger", 8224);
    add("&Dagger", 8225);
    add("&permil", 8240);
    add("&lsaquo", 8249);
    add("&rsaquo", 8250);
    add("&euro", 8364);
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.demo.html.Entities
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.demo.html;

final class HTMLParser$JJCalls
{
  int gen;
  Token first;
  int arg;
  JJCalls next;
}

/* Location:
 * Qualified Name:     org.apache.lucene.demo.html.HTMLParser.JJCalls
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.demo.html;

final class HTMLParser$LookaheadSuccess
  extends Error
{
  private static final long serialVersionUID = 1L;
  
  private HTMLParser$LookaheadSuccess() {}
  
  HTMLParser$LookaheadSuccess(LookaheadSuccess paramLookaheadSuccess)
  {
    this();
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.demo.html.HTMLParser.LookaheadSuccess
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.demo.html;

import java.io.CharArrayReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Set;
import java.util.Vector;
import org.eclipse.help.internal.search.LimitedSizeCharArrayWriter;

public class HTMLParser
  implements HTMLParserConstants
{
  public static int SUMMARY_LENGTH = 175;
  StringBuffer title = new StringBuffer();
  StringBuffer summary = new StringBuffer();
  Properties metaTags = new Properties();
  String currentMetaTag = null;
  String currentMetaContent = null;
  int length = 0;
  boolean titleComplete = false;
  boolean inTitle = false;
  boolean inHeading = false;
  boolean inMetaTag = false;
  boolean inIgnoredTag = true;
  boolean afterTag = false;
  boolean afterSpace = false;
  String eol = System.getProperty("line.separator");
  private LimitedSizeCharArrayWriter writer = new LimitedSizeCharArrayWriter(1000000L);
  private Exception exception = null;
  public HTMLParserTokenManager token_source;
  SimpleCharStream jj_input_stream;
  public Token token;
  public Token jj_nt;
  private int jj_ntk;
  private Token jj_scanpos;
  private Token jj_lastpos;
  private int jj_la;
  
  /**
   * @deprecated
   */
  public HTMLParser(File file)
    throws FileNotFoundException
  {
    this(new FileInputStream(file));
  }
  
  public String getTitle()
    throws IOException, InterruptedException
  {
    return title.toString().trim();
  }
  
  public Properties getMetaTags()
    throws IOException, InterruptedException
  {
    return metaTags;
  }
  
  public String getSummary()
    throws IOException, InterruptedException
  {
    String metaDescription = metaTags.getProperty("description");
    if (metaDescription != null)
    {
      if (metaDescription.length() > SUMMARY_LENGTH) {
        return metaDescription.substring(0, SUMMARY_LENGTH - 1);
      }
      if (metaDescription.length() > 0) {
        return metaDescription;
      }
    }
    return summary.toString().trim();
  }
  
  public Reader getReader()
    throws IOException
  {
    return new CharArrayReader(writer.toCharArray());
  }
  
  public void parse()
    throws IOException
  {
    try
    {
      HTMLDocument();
    }
    catch (Exception e)
    {
      setException(e);
    }
  }
  
  void addToSummary(String text)
  {
    if (summary.length() < SUMMARY_LENGTH)
    {
      summary.append(text);
      if ((summary.length() == title.length()) && (summary.toString().equals(title.toString()))) {
        summary.setLength(0);
      }
      if (summary.length() >= SUMMARY_LENGTH)
      {
        summary.setLength(SUMMARY_LENGTH - 3);
        summary.append("...");
        synchronized (this)
        {
          notifyAll();
        }
      }
    }
  }
  
  void addText(String text)
    throws IOException
  {
    if (inIgnoredTag) {
      return;
    }
    if (inTitle)
    {
      title.append(text);
    }
    else
    {
      if ((!inHeading) || (summary.length() > 0)) {
        addToSummary(text);
      }
      if ((!titleComplete) && (!title.equals(""))) {
        synchronized (this)
        {
          titleComplete = true;
          notifyAll();
        }
      }
    }
    length += text.length();
    writer.write(text);
    
    afterSpace = false;
  }
  
  void addMetaTag()
    throws IOException
  {
    metaTags.setProperty(currentMetaTag, currentMetaContent);
    if ((currentMetaTag.equalsIgnoreCase("keywords")) || 
      (currentMetaTag.equalsIgnoreCase("description")))
    {
      writer.write(32);
      writer.write(currentMetaContent);
      writer.write(32);
    }
    currentMetaTag = null;
    currentMetaContent = null;
  }
  
  void addSpace()
    throws IOException
  {
    if (!afterSpace)
    {
      if (inTitle) {
        title.append(" ");
      } else if (summary.length() > 0) {
        addToSummary(" ");
      }
      String space = afterTag ? eol : " ";
      length += space.length();
      writer.write(space);
      afterSpace = true;
    }
  }
  
  public final void HTMLDocument()
    throws ParseException, IOException
  {
    for (;;)
    {
      switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
      {
      case 1: 
      case 2: 
      case 3: 
      case 4: 
      case 5: 
      case 6: 
      case 10: 
      case 12: 
      case 13: 
        break;
      case 7: 
      case 8: 
      case 9: 
      case 11: 
      default: 
        jj_la1[0] = jj_gen;
        break;
      }
      switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
      {
      case 2: 
        Tag();
        afterTag = true;
        break;
      case 3: 
        Token t = Decl();
        afterTag = true;
        break;
      case 4: 
      case 5: 
        CommentTag();
        afterTag = true;
        break;
      case 1: 
        ScriptTag();
        afterTag = true;
        break;
      case 6: 
        Token t = jj_consume_token(6);
        addText(image);afterTag = false;
        break;
      case 12: 
        Token t = jj_consume_token(12);
        addText(Entities.decode(image));afterTag = false;
        break;
      case 13: 
        Token t = jj_consume_token(13);
        addText(image);afterTag = false;
        break;
      case 10: 
        jj_consume_token(10);
        addSpace();afterTag = false;
      }
    }
    jj_la1[1] = jj_gen;
    jj_consume_token(-1);
    throw new ParseException();
    
    jj_consume_token(0);
  }
  
  public final void Tag()
    throws ParseException, IOException
  {
    boolean inImg = false;
    Token t1 = jj_consume_token(2);
    String tagName = image.toLowerCase();
    if (Tags.WS_ELEMS.contains(tagName)) {
      addSpace();
    }
    inTitle = tagName.equals("<title");
    inHeading = ((tagName.startsWith("<h")) && (tagName.length() == 3) && (Character.isDigit(tagName.charAt(2))));
    inMetaTag = tagName.equals("<meta");
    inIgnoredTag = ((tagName.equals("<style")) || (tagName.equals("<script")));
    inImg = tagName.equals("<img");
    for (;;)
    {
      switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
      {
      case 16: 
        break;
      default: 
        jj_la1[2] = jj_gen;
        break;
      }
      t1 = jj_consume_token(16);
      switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
      {
      case 17: 
        jj_consume_token(17);
        switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
        {
        case 19: 
        case 20: 
        case 21: 
          Token t2 = ArgValue();
          if ((inImg) && (image.equalsIgnoreCase("alt")) && (t2 != null)) {
            addText("[" + image + "]");
          }
          if ((inMetaTag) && (
            (image.equalsIgnoreCase("name")) || 
            (image.equalsIgnoreCase("HTTP-EQUIV")))) {
            if (t2 != null)
            {
              currentMetaTag = image.toLowerCase();
              if ((currentMetaTag != null) && (currentMetaContent != null)) {
                addMetaTag();
              }
            }
          }
          if ((inMetaTag) && (image.equalsIgnoreCase("content")) && (t2 != null))
          {
            currentMetaContent = image;
            if ((currentMetaTag != null) && (currentMetaContent != null)) {
              addMetaTag();
            }
          }
          break;
        default: 
          jj_la1[3] = jj_gen;
        }
        break;
      default: 
        jj_la1[4] = jj_gen;
      }
    }
    jj_consume_token(18);
  }
  
  public final Token ArgValue()
    throws ParseException
  {
    Token t = null;
    switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
    {
    case 19: 
      t = jj_consume_token(19);
      return t;
    }
    jj_la1[5] = jj_gen;
    if (jj_2_1(2))
    {
      jj_consume_token(20);
      jj_consume_token(24);
      return t;
    }
    switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
    {
    case 20: 
      jj_consume_token(20);
      t = jj_consume_token(23);
      jj_consume_token(24);
      return t;
    }
    jj_la1[6] = jj_gen;
    if (jj_2_2(2))
    {
      jj_consume_token(21);
      jj_consume_token(26);
      return t;
    }
    switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
    {
    case 21: 
      jj_consume_token(21);
      t = jj_consume_token(25);
      jj_consume_token(26);
      return t;
    }
    jj_la1[7] = jj_gen;
    jj_consume_token(-1);
    throw new ParseException();
  }
  
  public final Token Decl()
    throws ParseException
  {
    Token t = jj_consume_token(3);
    for (;;)
    {
      switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
      {
      case 16: 
      case 17: 
      case 19: 
      case 20: 
      case 21: 
        break;
      case 18: 
      default: 
        jj_la1[8] = jj_gen;
        break;
      }
      switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
      {
      case 16: 
        jj_consume_token(16);
        break;
      case 19: 
      case 20: 
      case 21: 
        ArgValue();
        break;
      case 17: 
        jj_consume_token(17);
      }
    }
    jj_la1[9] = jj_gen;
    jj_consume_token(-1);
    throw new ParseException();
    
    jj_consume_token(18);
    return t;
  }
  
  public final void CommentTag()
    throws ParseException
  {
    switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
    {
    case 4: 
      jj_consume_token(4);
      for (;;)
      {
        switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
        {
        case 27: 
          break;
        default: 
          jj_la1[10] = jj_gen;
          break;
        }
        jj_consume_token(27);
      }
      jj_consume_token(28);
      break;
    case 5: 
      jj_consume_token(5);
      for (;;)
      {
        switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
        {
        case 29: 
          break;
        default: 
          jj_la1[11] = jj_gen;
          break;
        }
        jj_consume_token(29);
      }
      jj_consume_token(30);
      break;
    default: 
      jj_la1[12] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }
  
  public final void ScriptTag()
    throws ParseException
  {
    jj_consume_token(1);
    for (;;)
    {
      switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
      {
      case 14: 
        break;
      default: 
        jj_la1[13] = jj_gen;
        break;
      }
      jj_consume_token(14);
    }
    jj_consume_token(15);
  }
  
  private final boolean jj_2_1(int xla)
  {
    jj_la = xla;jj_lastpos = (jj_scanpos = token);
    try
    {
      return !jj_3_1();
    }
    catch (LookaheadSuccess localLookaheadSuccess)
    {
      return true;
    }
    finally
    {
      jj_save(0, xla);
    }
  }
  
  private final boolean jj_2_2(int xla)
  {
    jj_la = xla;jj_lastpos = (jj_scanpos = token);
    try
    {
      return !jj_3_2();
    }
    catch (LookaheadSuccess localLookaheadSuccess)
    {
      return true;
    }
    finally
    {
      jj_save(1, xla);
    }
  }
  
  private final boolean jj_3_2()
  {
    if (jj_scan_token(21)) {
      return true;
    }
    if (jj_scan_token(26)) {
      return true;
    }
    return false;
  }
  
  private final boolean jj_3_1()
  {
    if (jj_scan_token(20)) {
      return true;
    }
    if (jj_scan_token(24)) {
      return true;
    }
    return false;
  }
  
  public boolean lookingAhead = false;
  private int jj_gen;
  private final int[] jj_la1 = new int[14];
  private static int[] jj_la1_0;
  
  static
  {
    jj_la1_0();
  }
  
  private static void jj_la1_0()
  {
    jj_la1_0 = new int[] { 13438, 13438, 65536, 3670016, 131072, 524288, 1048576, 2097152, 3866624, 3866624, 134217728, 536870912, 48, 16384 };
  }
  
  private final JJCalls[] jj_2_rtns = new JJCalls[2];
  private boolean jj_rescan = false;
  private int jj_gc = 0;
  
  public HTMLParser(InputStream stream)
  {
    this(stream, null);
  }
  
  public HTMLParser(InputStream stream, String encoding)
  {
    try
    {
      jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1);
    }
    catch (UnsupportedEncodingException e)
    {
      throw new RuntimeException(e);
    }
    token_source = new HTMLParserTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 14; i++) {
      jj_la1[i] = -1;
    }
    for (int i = 0; i < jj_2_rtns.length; i++) {
      jj_2_rtns[i] = new JJCalls();
    }
  }
  
  public void ReInit(InputStream stream)
  {
    ReInit(stream, null);
  }
  
  public void ReInit(InputStream stream, String encoding)
  {
    try
    {
      jj_input_stream.ReInit(stream, encoding, 1, 1);
    }
    catch (UnsupportedEncodingException e)
    {
      throw new RuntimeException(e);
    }
    token_source.ReInit(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 14; i++) {
      jj_la1[i] = -1;
    }
    for (int i = 0; i < jj_2_rtns.length; i++) {
      jj_2_rtns[i] = new JJCalls();
    }
  }
  
  public HTMLParser(Reader stream)
  {
    jj_input_stream = new SimpleCharStream(stream, 1, 1);
    token_source = new HTMLParserTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 14; i++) {
      jj_la1[i] = -1;
    }
    for (int i = 0; i < jj_2_rtns.length; i++) {
      jj_2_rtns[i] = new JJCalls();
    }
  }
  
  public void ReInit(Reader stream)
  {
    jj_input_stream.ReInit(stream, 1, 1);
    token_source.ReInit(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 14; i++) {
      jj_la1[i] = -1;
    }
    for (int i = 0; i < jj_2_rtns.length; i++) {
      jj_2_rtns[i] = new JJCalls();
    }
  }
  
  public HTMLParser(HTMLParserTokenManager tm)
  {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 14; i++) {
      jj_la1[i] = -1;
    }
    for (int i = 0; i < jj_2_rtns.length; i++) {
      jj_2_rtns[i] = new JJCalls();
    }
  }
  
  public void ReInit(HTMLParserTokenManager tm)
  {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 14; i++) {
      jj_la1[i] = -1;
    }
    for (int i = 0; i < jj_2_rtns.length; i++) {
      jj_2_rtns[i] = new JJCalls();
    }
  }
  
  private final Token jj_consume_token(int kind)
    throws ParseException
  {
    Token oldToken;
    if (token).next != null) {
      token = token.next;
    } else {
      token = (token.next = token_source.getNextToken());
    }
    jj_ntk = -1;
    if (token.kind == kind)
    {
      jj_gen += 1;
      if (++jj_gc > 100)
      {
        jj_gc = 0;
        for (int i = 0; i < jj_2_rtns.length; i++)
        {
          JJCalls c = jj_2_rtns[i];
          while (c != null)
          {
            if (gen < jj_gen) {
              first = null;
            }
            c = next;
          }
        }
      }
      return token;
    }
    token = oldToken;
    jj_kind = kind;
    throw generateParseException();
  }
  
  static final class JJCalls
  {
    int gen;
    Token first;
    int arg;
    JJCalls next;
  }
  
  private static final class LookaheadSuccess
    extends Error
  {
    private static final long serialVersionUID = 1L;
    
    private LookaheadSuccess() {}
    
    LookaheadSuccess(LookaheadSuccess paramLookaheadSuccess)
    {
      this();
    }
  }
  
  private final LookaheadSuccess jj_ls = new LookaheadSuccess(null);
  
  private final boolean jj_scan_token(int kind)
  {
    if (jj_scanpos == jj_lastpos)
    {
      jj_la -= 1;
      if (jj_scanpos.next == null) {
        jj_lastpos = (jj_scanpos = jj_scanpos.next = token_source.getNextToken());
      } else {
        jj_lastpos = (jj_scanpos = jj_scanpos.next);
      }
    }
    else
    {
      jj_scanpos = jj_scanpos.next;
    }
    if (jj_rescan)
    {
      int i = 0;
      for (Token tok = token; (tok != null) && (tok != jj_scanpos); tok = next) {
        i++;
      }
      if (tok != null) {
        jj_add_error_token(kind, i);
      }
    }
    if (jj_scanpos.kind != kind) {
      return true;
    }
    if ((jj_la == 0) && (jj_scanpos == jj_lastpos)) {
      throw jj_ls;
    }
    return false;
  }
  
  public final Token getNextToken()
  {
    if (token.next != null) {
      token = token.next;
    } else {
      token = (token.next = token_source.getNextToken());
    }
    jj_ntk = -1;
    jj_gen += 1;
    return token;
  }
  
  public final Token getToken(int index)
  {
    Token t = lookingAhead ? jj_scanpos : token;
    for (int i = 0; i < index; i++) {
      if (next != null) {
        t = next;
      } else {
        t = next = token_source.getNextToken();
      }
    }
    return t;
  }
  
  private final int jj_ntk()
  {
    if ((jj_nt = token.next) == null) {
      return jj_ntk = token.next = token_source.getNextToken()).kind;
    }
    return jj_ntk = jj_nt.kind;
  }
  
  private Vector jj_expentries = new Vector();
  private int[] jj_expentry;
  private int jj_kind = -1;
  private int[] jj_lasttokens = new int[100];
  private int jj_endpos;
  
  private void jj_add_error_token(int kind, int pos)
  {
    if (pos >= 100) {
      return;
    }
    if (pos == jj_endpos + 1)
    {
      jj_lasttokens[(jj_endpos++)] = kind;
    }
    else if (jj_endpos != 0)
    {
      jj_expentry = new int[jj_endpos];
      for (int i = 0; i < jj_endpos; i++) {
        jj_expentry[i] = jj_lasttokens[i];
      }
      boolean exists = false;
      for (Enumeration e = jj_expentries.elements(); e.hasMoreElements();)
      {
        int[] oldentry = (int[])e.nextElement();
        if (oldentry.length == jj_expentry.length)
        {
          exists = true;
          for (int i = 0; i < jj_expentry.length; i++) {
            if (oldentry[i] != jj_expentry[i])
            {
              exists = false;
              break;
            }
          }
          if (exists) {
            break;
          }
        }
      }
      if (!exists) {
        jj_expentries.addElement(jj_expentry);
      }
      if (pos != 0) {
        jj_lasttokens[((jj_endpos = pos) - 1)] = kind;
      }
    }
  }
  
  public ParseException generateParseException()
  {
    jj_expentries.removeAllElements();
    boolean[] la1tokens = new boolean[31];
    for (int i = 0; i < 31; i++) {
      la1tokens[i] = false;
    }
    if (jj_kind >= 0)
    {
      la1tokens[jj_kind] = true;
      jj_kind = -1;
    }
    for (int i = 0; i < 14; i++) {
      if (jj_la1[i] == jj_gen) {
        for (int j = 0; j < 32; j++) {
          if ((jj_la1_0[i] & 1 << j) != 0) {
            la1tokens[j] = true;
          }
        }
      }
    }
    for (int i = 0; i < 31; i++) {
      if (la1tokens[i] != 0)
      {
        jj_expentry = new int[1];
        jj_expentry[0] = i;
        jj_expentries.addElement(jj_expentry);
      }
    }
    jj_endpos = 0;
    jj_rescan_token();
    jj_add_error_token(0, 0);
    int[][] exptokseq = new int[jj_expentries.size()][];
    for (int i = 0; i < jj_expentries.size(); i++) {
      exptokseq[i] = ((int[])jj_expentries.elementAt(i));
    }
    return new ParseException(token, exptokseq, tokenImage);
  }
  
  private final void jj_rescan_token()
  {
    jj_rescan = true;
    for (int i = 0; i < 2; i++) {
      try
      {
        JJCalls p = jj_2_rtns[i];
        do
        {
          if (gen > jj_gen)
          {
            jj_la = arg;jj_lastpos = (jj_scanpos = first);
            switch (i)
            {
            case 0: 
              jj_3_1(); break;
            case 1: 
              jj_3_2();
            }
          }
          p = next;
        } while (p != null);
      }
      catch (LookaheadSuccess localLookaheadSuccess) {}
    }
    jj_rescan = false;
  }
  
  private final void jj_save(int index, int xla)
  {
    JJCalls p = jj_2_rtns[index];
    while (gen > jj_gen)
    {
      if (next == null)
      {
        p = next = new JJCalls(); break;
      }
      p = next;
    }
    gen = (jj_gen + xla - jj_la);first = token;arg = xla;
  }
  
  public void setException(Exception exception)
  {
    this.exception = exception;
  }
  
  public Exception getException()
  {
    return exception;
  }
  
  public final void enable_tracing() {}
  
  public final void disable_tracing() {}
}

/* Location:
 * Qualified Name:     org.apache.lucene.demo.html.HTMLParser
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.demo.html;

public abstract interface HTMLParserConstants
{
  public static final int EOF = 0;
  public static final int ScriptStart = 1;
  public static final int TagName = 2;
  public static final int DeclName = 3;
  public static final int Comment1 = 4;
  public static final int Comment2 = 5;
  public static final int Word = 6;
  public static final int LET = 7;
  public static final int NUM = 8;
  public static final int HEX = 9;
  public static final int Space = 10;
  public static final int SP = 11;
  public static final int Entity = 12;
  public static final int Punct = 13;
  public static final int ScriptText = 14;
  public static final int ScriptEnd = 15;
  public static final int ArgName = 16;
  public static final int ArgEquals = 17;
  public static final int TagEnd = 18;
  public static final int ArgValue = 19;
  public static final int ArgQuote1 = 20;
  public static final int ArgQuote2 = 21;
  public static final int Quote1Text = 23;
  public static final int CloseQuote1 = 24;
  public static final int Quote2Text = 25;
  public static final int CloseQuote2 = 26;
  public static final int CommentText1 = 27;
  public static final int CommentEnd1 = 28;
  public static final int CommentText2 = 29;
  public static final int CommentEnd2 = 30;
  public static final int DEFAULT = 0;
  public static final int WithinScript = 1;
  public static final int WithinTag = 2;
  public static final int AfterEquals = 3;
  public static final int WithinQuote1 = 4;
  public static final int WithinQuote2 = 5;
  public static final int WithinComment1 = 6;
  public static final int WithinComment2 = 7;
  public static final String[] tokenImage = {
    "<EOF>", 
    "\"<script\"", 
    "<TagName>", 
    "<DeclName>", 
    "\"<!--\"", 
    "\"<!\"", 
    "<Word>", 
    "<LET>", 
    "<NUM>", 
    "<HEX>", 
    "<Space>", 
    "<SP>", 
    "<Entity>", 
    "<Punct>", 
    "<ScriptText>", 
    "<ScriptEnd>", 
    "<ArgName>", 
    "\"=\"", 
    "<TagEnd>", 
    "<ArgValue>", 
    "\"\\'\"", 
    "\"\\\"\"", 
    "<token of kind 22>", 
    "<Quote1Text>", 
    "<CloseQuote1>", 
    "<Quote2Text>", 
    "<CloseQuote2>", 
    "<CommentText1>", 
    "\"-->\"", 
    "<CommentText2>", 
    "\">\"" };
}

/* Location:
 * Qualified Name:     org.apache.lucene.demo.html.HTMLParserConstants
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.demo.html;

import java.io.IOException;
import java.io.PrintStream;

public class HTMLParserTokenManager
  implements HTMLParserConstants
{
  public PrintStream debugStream = System.out;
  
  public void setDebugStream(PrintStream ds)
  {
    debugStream = ds;
  }
  
  private final int jjStopStringLiteralDfa_0(int pos, long active0)
  {
    switch (pos)
    {
    case 0: 
      if ((active0 & 0x32) != 0L) {
        return 26;
      }
      return -1;
    case 1: 
      if ((active0 & 0x30) != 0L) {
        return 31;
      }
      if ((active0 & 0x2) != 0L)
      {
        if (jjmatchedPos != 1)
        {
          jjmatchedKind = 2;
          jjmatchedPos = 1;
        }
        return 28;
      }
      return -1;
    case 2: 
      if ((active0 & 0x2) != 0L)
      {
        jjmatchedKind = 2;
        jjmatchedPos = 2;
        return 29;
      }
      return -1;
    case 3: 
      if ((active0 & 0x2) != 0L)
      {
        jjmatchedKind = 2;
        jjmatchedPos = 3;
        return 29;
      }
      return -1;
    case 4: 
      if ((active0 & 0x2) != 0L)
      {
        jjmatchedKind = 2;
        jjmatchedPos = 4;
        return 29;
      }
      return -1;
    case 5: 
      if ((active0 & 0x2) != 0L)
      {
        jjmatchedKind = 2;
        jjmatchedPos = 5;
        return 29;
      }
      return -1;
    }
    return -1;
  }
  
  private final int jjStartNfa_0(int pos, long active0)
  {
    return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
  }
  
  private final int jjStopAtPos(int pos, int kind)
  {
    jjmatchedKind = kind;
    jjmatchedPos = pos;
    return pos + 1;
  }
  
  private final int jjStartNfaWithStates_0(int pos, int kind, int state)
  {
    jjmatchedKind = kind;
    jjmatchedPos = pos;
    try
    {
      curChar = input_stream.readChar();
    }
    catch (IOException localIOException)
    {
      return pos + 1;
    }
    return jjMoveNfa_0(state, pos + 1);
  }
  
  private final int jjMoveStringLiteralDfa0_0()
  {
    switch (curChar)
    {
    case '<': 
      return jjMoveStringLiteralDfa1_0(50L);
    }
    return jjMoveNfa_0(17, 0);
  }
  
  private final int jjMoveStringLiteralDfa1_0(long active0)
  {
    try
    {
      curChar = input_stream.readChar();
    }
    catch (IOException localIOException)
    {
      jjStopStringLiteralDfa_0(0, active0);
      return 1;
    }
    switch (curChar)
    {
    case '!': 
      if ((active0 & 0x20) != 0L)
      {
        jjmatchedKind = 5;
        jjmatchedPos = 1;
      }
      return jjMoveStringLiteralDfa2_0(active0, 16L);
    case 's': 
      return jjMoveStringLiteralDfa2_0(active0, 2L);
    }
    return jjStartNfa_0(0, active0);
  }
  
  private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
  {
    if ((active0 &= old0) == 0L) {
      return jjStartNfa_0(0, old0);
    }
    try
    {
      curChar = input_stream.readChar();
    }
    catch (IOException localIOException)
    {
      jjStopStringLiteralDfa_0(1, active0);
      return 2;
    }
    switch (curChar)
    {
    case '-': 
      return jjMoveStringLiteralDfa3_0(active0, 16L);
    case 'c': 
      return jjMoveStringLiteralDfa3_0(active0, 2L);
    }
    return jjStartNfa_0(1, active0);
  }
  
  private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
  {
    if ((active0 &= old0) == 0L) {
      return jjStartNfa_0(1, old0);
    }
    try
    {
      curChar = input_stream.readChar();
    }
    catch (IOException localIOException)
    {
      jjStopStringLiteralDfa_0(2, active0);
      return 3;
    }
    switch (curChar)
    {
    case '-': 
      if ((active0 & 0x10) != 0L) {
        return jjStopAtPos(3, 4);
      }
      break;
    case 'r': 
      return jjMoveStringLiteralDfa4_0(active0, 2L);
    }
    return jjStartNfa_0(2, active0);
  }
  
  private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
  {
    if ((active0 &= old0) == 0L) {
      return jjStartNfa_0(2, old0);
    }
    try
    {
      curChar = input_stream.readChar();
    }
    catch (IOException localIOException)
    {
      jjStopStringLiteralDfa_0(3, active0);
      return 4;
    }
    switch (curChar)
    {
    case 'i': 
      return jjMoveStringLiteralDfa5_0(active0, 2L);
    }
    return jjStartNfa_0(3, active0);
  }
  
  private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
  {
    if ((active0 &= old0) == 0L) {
      return jjStartNfa_0(3, old0);
    }
    try
    {
      curChar = input_stream.readChar();
    }
    catch (IOException localIOException)
    {
      jjStopStringLiteralDfa_0(4, active0);
      return 5;
    }
    switch (curChar)
    {
    case 'p': 
      return jjMoveStringLiteralDfa6_0(active0, 2L);
    }
    return jjStartNfa_0(4, active0);
  }
  
  private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
  {
    if ((active0 &= old0) == 0L) {
      return jjStartNfa_0(4, old0);
    }
    try
    {
      curChar = input_stream.readChar();
    }
    catch (IOException localIOException)
    {
      jjStopStringLiteralDfa_0(5, active0);
      return 6;
    }
    switch (curChar)
    {
    case 't': 
      if ((active0 & 0x2) != 0L) {
        return jjStartNfaWithStates_0(6, 1, 29);
      }
      break;
    }
    return jjStartNfa_0(5, active0);
  }
  
  private final void jjCheckNAdd(int state)
  {
    if (jjrounds[state] != jjround)
    {
      jjstateSet[(jjnewStateCnt++)] = state;
      jjrounds[state] = jjround;
    }
  }
  
  private final void jjAddStates(int start, int end)
  {
    do
    {
      jjstateSet[(jjnewStateCnt++)] = jjnextStates[start];
    } while (start++ != end);
  }
  
  private final void jjCheckNAddTwoStates(int state1, int state2)
  {
    jjCheckNAdd(state1);
    jjCheckNAdd(state2);
  }
  
  private final void jjCheckNAddStates(int start, int end)
  {
    do
    {
      jjCheckNAdd(jjnextStates[start]);
    } while (start++ != end);
  }
  
  static final long[] jjbitVec0 = {
    -2L, -1L, -1L, -1L };
  static final long[] jjbitVec2 = {
    0, 0, -1L, -1L };
  
  private final int jjMoveNfa_0(int startState, int curPos)
  {
    int startsAt = 0;
    jjnewStateCnt = 34;
    int i = 1;
    jjstateSet[0] = startState;
    int kind = Integer.MAX_VALUE;
    for (;;)
    {
      if (++jjround == Integer.MAX_VALUE) {
        ReInitRounds();
      }
      if (curChar < '@')
      {
        long l = 1L << curChar;
        do
        {
          switch (jjstateSet[(--i)])
          {
          case 26: 
            if (curChar == '!') {
              jjstateSet[(jjnewStateCnt++)] = 31;
            } else if (curChar == '/') {
              jjCheckNAdd(27);
            }
            break;
          case 17: 
            if ((0x3FF000000000000 & l) != 0L)
            {
              jjCheckNAddTwoStates(7, 2);
            }
            else if ((0x100002600 & l) != 0L)
            {
              if (kind > 10) {
                kind = 10;
              }
              jjCheckNAddTwoStates(10, 16);
            }
            else if (curChar == '<')
            {
              jjCheckNAddStates(0, 2);
            }
            else if (curChar == '&')
            {
              jjAddStates(3, 5);
            }
            else if (curChar == '$')
            {
              jjstateSet[(jjnewStateCnt++)] = 1;
            }
            if ((0x3FF000000000000 & l) != 0L)
            {
              if (kind > 6) {
                kind = 6;
              }
              jjCheckNAddStates(6, 10);
            }
            else if (curChar == '&')
            {
              jjstateSet[(jjnewStateCnt++)] = 15;
            }
            break;
          case 0: 
            if (curChar == '$') {
              jjstateSet[(jjnewStateCnt++)] = 1;
            }
            break;
          case 1: 
            if ((0x3FF000000000000 & l) != 0L) {
              jjCheckNAdd(2);
            }
            break;
          case 2: 
            if ((0x500000000000 & l) != 0L) {
              jjstateSet[(jjnewStateCnt++)] = 3;
            }
            break;
          case 3: 
          case 9: 
            if ((0x3FF000000000000 & l) != 0L)
            {
              if (kind > 6) {
                kind = 6;
              }
              jjCheckNAddStates(11, 13);
            }
            break;
          case 4: 
            if ((0x3FF000000000000 & l) != 0L)
            {
              if (kind > 6) {
                kind = 6;
              }
              jjCheckNAddStates(6, 10);
            }
            break;
          case 5: 
            if ((0x880000000000 & l) != 0L)
            {
              if (kind > 6) {
                kind = 6;
              }
              jjCheckNAddStates(14, 17);
         
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd