// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3)
// Source File Name: Html.java
class Parser
{
Parser()
{
NONE = 0;
HTML = 1;
H2 = 2;
H3 = 3;
H4 = 4;
H5 = 5;
HEAD = 10;
TITLE = 11;
BODY = 20;
TABLE = 100;
TBODY = 101;
TR = 102;
TD = 103;
ATEND = 0x186a0;
state = NONE;
formatstring = "";
}
public boolean end()
{
return state == ATEND;
}
private void begintoken(String s)
throws Exception
{
prevstate = state;
if(state == NONE && s.equals("HTML"))
{
state = HTML;
break MISSING_BLOCK_LABEL_663;
}
if(state == HTML && s.equals("HEAD"))
{
state = HEAD;
break MISSING_BLOCK_LABEL_663;
}
if(state == HTML && s.equals("BODY"))
{
state = BODY;
break MISSING_BLOCK_LABEL_663;
}
if(state != BODY && state != TD || s.length() != 2 || s.charAt(0) != 'h')
break MISSING_BLOCK_LABEL_339;
if(s.charAt(1) != '2')
break MISSING_BLOCK_LABEL_188;
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
"Text_sehr_gross";
append();
toString();
formatstring;
state = H2;
break MISSING_BLOCK_LABEL_663;
if(s.charAt(1) != '3')
break MISSING_BLOCK_LABEL_235;
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
"Text_gross";
append();
toString();
formatstring;
state = H3;
break MISSING_BLOCK_LABEL_663;
if(s.charAt(1) != '4')
break MISSING_BLOCK_LABEL_282;
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
"Text_mittel";
append();
toString();
formatstring;
state = H4;
break MISSING_BLOCK_LABEL_663;
if(s.charAt(1) != '5')
break MISSING_BLOCK_LABEL_329;
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
"Text_normal";
append();
toString();
formatstring;
state = H5;
break MISSING_BLOCK_LABEL_663;
throw new Exception("Nicht definierte \334berschrift!");
if(state != BODY || !s.equals("BR"))
break MISSING_BLOCK_LABEL_388;
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
"\n";
append();
toString();
formatstring;
break MISSING_BLOCK_LABEL_663;
if(state != HEAD || !s.equals("TITLE"))
break MISSING_BLOCK_LABEL_445;
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
"Titel";
append();
toString();
formatstring;
state = TITLE;
break MISSING_BLOCK_LABEL_663;
if(state != BODY || !s.equals("TABLE"))
break MISSING_BLOCK_LABEL_523;
state = TABLE;
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
"Tabelle ";
append();
toString();
formatstring;
tablebegin = formatstring.length();
spalten = 0;
zeilen = 0;
break MISSING_BLOCK_LABEL_663;
if(state == TABLE && s.equals("TBODY"))
state = TBODY;
else
if(state == TBODY && s.equals("TR"))
{
spalten++;
state = TR;
} else
if(state == TR && s.equals("TD"))
{
zeilen++;
state = TD;
} else
{
throw new Exception((new StringBuilder()).append("Kann hier nicht aufgemacht werden: ").append(s).toString());
}
}
private void endtoken(String s)
throws Exception
{
if(state != HTML || !s.equals("HTML"))
break MISSING_BLOCK_LABEL_105;
if(formatstring.length() == 0 || formatstring.endsWith("\n")) goto _L2; else goto _L1
_L1:
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
" ";
append();
toString();
formatstring;
_L2:
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
"Ende";
append();
toString();
formatstring;
state = ATEND;
break MISSING_BLOCK_LABEL_702;
if(state == HEAD && s.equals("HEAD"))
{
state = HTML;
break MISSING_BLOCK_LABEL_702;
}
if(state == BODY && s.equals("BODY"))
{
state = HTML;
break MISSING_BLOCK_LABEL_702;
}
if(s.length() != 2 || s.charAt(0) != 'h')
break MISSING_BLOCK_LABEL_337;
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
";";
append();
toString();
formatstring;
if(state == H2 && s.charAt(1) == '2' || state == H3 && s.charAt(1) == '3' || state == H4 && s.charAt(1) == '4' || state == H5 && s.charAt(1) == '5')
state = prevstate;
else
throw new Exception((new StringBuilder()).append("Falsche \334berschrift geschlossen: h").append(s.charAt(1)).toString());
break MISSING_BLOCK_LABEL_702;
if(state != TITLE || !s.equals("TITLE"))
break MISSING_BLOCK_LABEL_394;
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
";";
append();
toString();
formatstring;
state = HEAD;
break MISSING_BLOCK_LABEL_702;
if(state == TD && s.equals("TD"))
{
state = TR;
break MISSING_BLOCK_LABEL_702;
}
if(state != TR || !s.equals("TR"))
break MISSING_BLOCK_LABEL_482;
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
"\n";
append();
toString();
formatstring;
state = TBODY;
break MISSING_BLOCK_LABEL_702;
if(state == TBODY && s.equals("TBODY"))
state = TABLE;
else
if(state == TABLE && s.equals("TABLE"))
{
String s1 = formatstring.substring(0, tablebegin);
s1 = (new StringBuilder()).append(s1).append(spalten).toString();
s1 = (new StringBuilder()).append(s1).append(" ").toString();
s1 = (new StringBuilder()).append(s1).append(zeilen).toString();
s1 = (new StringBuilder()).append(s1).append(" ").toString();
s1 = (new StringBuilder()).append(s1).append(formatstring.substring(tablebegin)).toString();
formatstring = s1;
state = BODY;
} else
{
throw new Exception((new StringBuilder()).append("Falsch zugemacht: ").append(s).toString());
}
}
public void parse(String s)
throws Exception
{
if(s.charAt(0) != '<') goto _L2; else goto _L1
_L1:
if(s.charAt(s.length() - 1) != '>')
throw new Exception("> nicht gefunden!");
if(s.charAt(1) == '/')
endtoken(s.substring(2, s.length() - 1));
else
begintoken(s.substring(1, s.length() - 1));
goto _L3
_L2:
if(state != TITLE) goto _L5; else goto _L4
_L4:
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
" ";
append();
s;
append();
toString();
formatstring;
goto _L3
_L5:
if(state < H2 || state > H5) goto _L3; else goto _L6
_L6:
new StringBuilder();
this;
JVM INSTR dup_x1 ;
formatstring;
append();
" ";
append();
s;
append();
toString();
formatstring;
_L3:
}
public String formated()
{
return formatstring;
}
private String formatstring;
private int state;
private int prevstate;
private int tablebegin;
private int spalten;
private int zeilen;
private int NONE;
private int HTML;
private int H2;
private int H3;
private int H4;
private int H5;
private int HEAD;
private int TITLE;
private int BODY;
private int TABLE;
private int TBODY;
private int TR;
private int TD;
private int ATEND;
}