01: package hotsax.html.sax;
02:
03: /*
04: * Yytoken, holds the latest token from the lexer
05: */
06:
07: class Yytoken {
08: public int m_index;
09: public String m_text;
10:
11: public final static int UNDEFINED = HtmlParser.UNDEFINED; // represents an error or uninitialized token
12: public final static int SOF = HtmlParser.SOF; // start of file
13: public final static int TAG_START = HtmlParser.TAG_START;
14: public final static int TAG_END = HtmlParser.TAG_END;
15: public final static int TAG_EMPTY = HtmlParser.TAG_EMPTY;
16: public final static int ATTR = HtmlParser.ATTR;
17: public final static int VAL = HtmlParser.VAL;
18: public final static int TEXT = HtmlParser.TEXT;
19: public final static int COMMENT = HtmlParser.COMMENT;
20: public final static int PI = HtmlParser.PI;
21: public final static int DOCTYPE = HtmlParser.DOCTYPE;
22: public final static int CDATA = HtmlParser.CDATA;
23: public final static int TAG_START_COMPLETE = HtmlParser.TAG_START_COMPLETE; // represents trailing ">" indicating all attrs collected
24: public final static int EOF = HtmlParser.EOF;
25:
26: Yytoken(int index, String text) {
27: m_index = index;
28: m_text = text;
29: }
30:
31: /*
32: private String types[] = {
33: "UNDEFINED", "SOF", "TAG_START", "TAG_END", "TAG_EMPTY"
34: , "ATTR", "VAL", "TEXT", "COMMENT", "PI"
35: , "DOCTYPE", "CDATA", "TAG_START_COMPLETE"
36: , "EOF"};
37:
38: */
39: public String toString() {
40: return ": |" + m_text + "| type(" + m_index + "):"
41: + HtmlParser.yyname[m_index];
42: }
43: }
|