|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hotsax.html.sax.HtmlParser
public class HtmlParser
Encapsulates yacc() parser functionality in a Java class for quick code development
Field Summary | |
---|---|
static short |
ANGLE_CLOSE
|
static short |
ANGLE_END_CLOSE
|
static short |
ANGLE_END_OPEN
|
static short |
ANGLE_OPEN
|
static short |
ATTR
|
static short |
CDATA_END
|
static short |
CDATA_START
|
static short |
COMMENT_END
|
static short |
COMMENT_START
|
String |
DEFAULT_LEXER_NAME
|
static short |
DOCTYPE_START
|
static short |
EOF
|
static short |
EQUAL
|
(package private) static boolean |
interactive
|
static short |
NAME
|
static short |
PI_CLOSE
|
static short |
PI_OPEN
|
static short |
SOF
|
(package private) int |
statemax
|
(package private) int |
stateptr
|
(package private) int |
stateptrmax
|
(package private) int[] |
statestk
|
static short |
STRING
|
static short |
TEXT
|
(package private) int |
valptr
|
(package private) HtmlParserVal[] |
valstk
|
static short |
VALUE
|
(package private) int |
yychar
|
(package private) static short[] |
yycheck
|
(package private) boolean |
yydebug
|
(package private) static short[] |
yydefred
|
(package private) static short[] |
yydgoto
|
static short |
YYERRCODE
|
(package private) int |
yyerrflag
|
(package private) static short |
YYFINAL
|
(package private) static short[] |
yygindex
|
(package private) static short[] |
yylen
|
(package private) static short[] |
yylhs
|
(package private) HtmlParserVal |
yylval
|
(package private) int |
yym
|
(package private) static short |
YYMAXTOKEN
|
(package private) int |
yyn
|
(package private) static String[] |
yyname
|
(package private) int |
yynerrs
|
(package private) static short[] |
yyrindex
|
(package private) static String[] |
yyrule
|
(package private) String |
yys
|
(package private) static short[] |
yysindex
|
(package private) static int |
YYSTACKSIZE
|
(package private) int |
yystate
|
(package private) static short[] |
yytable
|
(package private) static int |
YYTABLESIZE
|
(package private) String |
yytext
|
(package private) HtmlParserVal |
yyval
|
Constructor Summary | |
---|---|
HtmlParser()
Create new HtmlParser with no reader. |
|
HtmlParser(Reader r)
Create new HtmlParser with specified reader |
Method Summary | |
---|---|
void |
addSemanticLexer(String name,
SemanticLexer lexer)
Add a new Semantic Lexer to the hash of available lexers. |
(package private) void |
debug(String msg)
|
(package private) void |
dump_stacks(int count)
|
ParserDelegate |
getDelegate()
|
ParserDelegate |
getParserDelegate()
Get the current ParserDelegate |
Reader |
getReader()
Return the reader the parser is using. |
SemanticLexer |
getSemanticLexer(String name)
Check the possibility of an alternate lexer for this semantic state. |
(package private) boolean |
init_stacks()
|
void |
lexerInit()
Initialize the lexer hash. |
static void |
main(String[] args)
|
void |
revertSemanticLexer()
Revert the SemanticLexer to the default value. |
void |
run()
A default run method, used for operating this parser object in the background. |
void |
setParserDelegate(ParserDelegate delegate)
Set the ParserDelegate. |
void |
setReader(Reader r)
Set the reader the parser is using. |
void |
setSemanticLexer(String name)
Change the lexer to the one specified in the name. |
(package private) void |
state_drop(int cnt)
|
(package private) int |
state_peek(int relative)
|
(package private) int |
state_pop()
|
(package private) void |
state_push(int state)
|
(package private) void |
val_drop(int cnt)
|
(package private) void |
val_init()
|
(package private) HtmlParserVal |
val_peek(int relative)
|
(package private) HtmlParserVal |
val_pop()
|
(package private) void |
val_push(HtmlParserVal val)
|
void |
yyerror(String error)
|
(package private) void |
yylexdebug(int state,
int ch)
|
(package private) int |
yyparse()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
boolean yydebug
int yynerrs
int yyerrflag
int yychar
static final int YYSTACKSIZE
int[] statestk
int stateptr
int stateptrmax
int statemax
String yytext
HtmlParserVal yyval
HtmlParserVal yylval
HtmlParserVal[] valstk
int valptr
public static final short SOF
public static final short ANGLE_OPEN
public static final short ANGLE_CLOSE
public static final short ANGLE_END_OPEN
public static final short ANGLE_END_CLOSE
public static final short ATTR
public static final short EQUAL
public static final short VALUE
public static final short STRING
public static final short TEXT
public static final short COMMENT_START
public static final short COMMENT_END
public static final short NAME
public static final short PI_OPEN
public static final short PI_CLOSE
public static final short DOCTYPE_START
public static final short CDATA_START
public static final short CDATA_END
public static final short EOF
public static final short YYERRCODE
static final short[] yylhs
static final short[] yylen
static final short[] yydefred
static final short[] yydgoto
static final short[] yysindex
static final short[] yyrindex
static final short[] yygindex
static final int YYTABLESIZE
static final short[] yytable
static final short[] yycheck
static final short YYFINAL
static final short YYMAXTOKEN
static final String[] yyname
static final String[] yyrule
public final String DEFAULT_LEXER_NAME
static boolean interactive
int yyn
int yym
int yystate
String yys
Constructor Detail |
---|
public HtmlParser(Reader r)
public HtmlParser()
Method Detail |
---|
void debug(String msg)
void state_push(int state)
int state_pop()
void state_drop(int cnt)
int state_peek(int relative)
boolean init_stacks()
void dump_stacks(int count)
void val_init()
void val_push(HtmlParserVal val)
HtmlParserVal val_pop()
void val_drop(int cnt)
HtmlParserVal val_peek(int relative)
public ParserDelegate getDelegate()
public void yyerror(String error)
public void setParserDelegate(ParserDelegate delegate)
ParserDelegate
- to setpublic ParserDelegate getParserDelegate()
public void lexerInit()
public SemanticLexer getSemanticLexer(String name)
public void setSemanticLexer(String name)
public void revertSemanticLexer() throws UnspecifiedSemanticLexerException
UnspecifiedSemanticLexerException
- thrown if the Default lexer disappeared.public void addSemanticLexer(String name, SemanticLexer lexer)
yyparser.addSemanyicLexer("style", new StyleLexer(yyparser.getReader(), yyparser));
name
- The lower case name of the tag or attribute this should key on.lexer
- The SemanticLexer to use when this name token appears.setSemanticLexer
public Reader getReader()
public void setReader(Reader r)
public static void main(String[] args) throws IOException
IOException
void yylexdebug(int state, int ch)
int yyparse()
public void run()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |