1
2 package hotsax.html.sax;
3
4 import java.io.*;
5
6 public interface SemanticLexer {
7
8 /***
9 * Wrapper for jflex generated yylex() method.
10 * @return the HtmlParser.XXXX token id.
11 * @exception IOException thrown if the input could not be read
12 */
13 public int _yylex() throws IOException;
14
15 /***
16 * Ser the Reader for the lexer.
17 * @param r Reader to set
18 */
19 public void setReader(Reader r);
20
21 /***
22 * Get the current Reader
23 * @return the Reader for this SemanticLexer
24 */
25 public Reader getReader();
26
27 /***
28 * Set the Lexer state. Usually called by the HtmlParser and set to
29 * HtmlLexer.YYINITIAL
30 * @param state the state to set/reset the lexer state to
31 */
32 public void yybegin(int state);
33
34 /***
35 * Sets the buffer from another SemanticLexer, probably the default one.
36 * @param lexer The SemanticLexer to read the buffer from.
37 */
38 public void setBuffer(SemanticLexer lexer);
39
40 /***
41 * Return the character buffer of the lexer. Exposes private yy_buffer
42 * @return the yy_buffer
43 */
44 public char[] getyyBuffer();
45
46 /***
47 * Return the current position of the lexer. Exposes private yy_currentPos
48 * @return the yy_currentPos
49 */
50 public int getyyCurrentPos();
51
52 /***
53 * Return the marked position of the lexer. Exposes private yy_markedPos
54 * @return the yy_markedPos
55 */
56 public int getyyMarkedPos();
57
58 /***
59 * Return the pushback position of the lexer. Exposes private yy_pushbackPos
60 * @return the yy_pushbackPos
61 */
62 public int getyyPushbackPos();
63
64 /***
65 * Return the end read of the buffer of the lexer. Exposes private yy_endRead
66 * @return the yy_endRead
67 */
68 public int getyyEndRead();
69
70 /***
71 * Return the start read of the buffer of the lexer. Exposes private yy_startRead
72 * @return the yy_startRead
73 */
74 public int getyyStartRead();
75
76 /***
77 * Debugs the yy_buffer. Prints the content of the buffer on System.out
78 */
79 public void printBuffer();
80 }