KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hotsax > html > sax > Yytoken


1 package hotsax.html.sax;
2
3
4 /*
5  * Yytoken, holds the latest token from the lexer
6  */

7
8 class Yytoken {
9     public int m_index;
10     public String JavaDoc m_text;
11
12     public final static int UNDEFINED = HtmlParser.UNDEFINED; // represents an error or uninitialized token
13
public final static int SOF =HtmlParser.SOF; // start of file
14
public final static int TAG_START =HtmlParser.TAG_START;
15     public final static int TAG_END = HtmlParser.TAG_END;
16     public final static int TAG_EMPTY = HtmlParser.TAG_EMPTY;
17     public final static int ATTR = HtmlParser.ATTR;
18     public final static int VAL = HtmlParser.VAL;
19     public final static int TEXT = HtmlParser.TEXT;
20     public final static int COMMENT = HtmlParser.COMMENT;
21     public final static int PI = HtmlParser.PI;
22     public final static int DOCTYPE = HtmlParser.DOCTYPE;
23     public final static int CDATA = HtmlParser.CDATA;
24     public final static int TAG_START_COMPLETE = HtmlParser.TAG_START_COMPLETE; // represents trailing ">" indicating all attrs collected
25
public final static int EOF = HtmlParser.EOF;
26
27     Yytoken (int index, String JavaDoc text) {
28         m_index = index;
29         m_text = text;
30     }
31
32
33     /*
34     private String types[] = {
35                   "UNDEFINED", "SOF", "TAG_START", "TAG_END", "TAG_EMPTY"
36                 , "ATTR", "VAL", "TEXT", "COMMENT", "PI"
37                 , "DOCTYPE", "CDATA", "TAG_START_COMPLETE"
38                 , "EOF"};
39
40      */

41     public String JavaDoc toString() {
42         return ": |"+m_text+ "| type(" + m_index + "):" + HtmlParser.yyname[m_index];
43     }
44 }
45
Popular Tags