Clover coverage report - PMD - 3.9 Coverage timestamp: Tue Dec 19 2006 09:38:44 EST FRAMES NO FRAMES |
file stats: | LOC: | 112 |  | Methods: | 0
| NCLOC: | 15 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
CharStream.java | - | - | - | - |

1 |  | /* Generated By:JavaCC: Do not edit this line. CharStream.java Version 4.0 */
2 |  | package net.sourceforge.pmd.ast;
3 |  |
4 |  | /**
5 |  | * This interface describes a character stream that maintains line and
6 |  | * column number positions of the characters. It also has the capability
7 |  | * to backup the stream to some extent. An implementation of this
8 |  | * interface is used in the TokenManager implementation generated by
9 |  | * JavaCCParser.
10 |  | * <p/>
11 |  | * All the methods except backup can be implemented in any fashion. backup
12 |  | * needs to be implemented correctly for the correct operation of the lexer.
13 |  | * Rest of the methods are all used to get information like line number,
14 |  | * column number and the String that constitutes a token and are not used
15 |  | * by the lexer. Hence their implementation won't affect the generated lexer's
16 |  | * operation.
17 |  | */
18 |  |
19 |  | public interface CharStream {
20 |  |
21 |  | /**
22 |  | * Returns the next character from the selected input. The method
23 |  | * of selecting the input is the responsibility of the class
24 |  | * implementing this interface. Can throw any java.io.IOException.
25 |  | */
26 |  | char readChar() throws java.io.IOException;
27 |  |
28 |  | /**
29 |  | * Returns the column position of the character last read.
30 |  | *
31 |  | * @see #getEndColumn
32 |  | * @deprecated
33 |  | */
34 |  | int getColumn();
35 |  |
36 |  | /**
37 |  | * Returns the line number of the character last read.
38 |  | *
39 |  | * @see #getEndLine
40 |  | * @deprecated
41 |  | */
42 |  | int getLine();
43 |  |
44 |  | /**
45 |  | * Returns the column number of the last character for current token (being
46 |  | * matched after the last call to BeginTOken).
47 |  | */
48 |  | int getEndColumn();
49 |  |
50 |  | /**
51 |  | * Returns the line number of the last character for current token (being
52 |  | * matched after the last call to BeginTOken).
53 |  | */
54 |  | int getEndLine();
55 |  |
56 |  | /**
57 |  | * Returns the column number of the first character for current token (being
58 |  | * matched after the last call to BeginTOken).
59 |  | */
60 |  | int getBeginColumn();
61 |  |
62 |  | /**
63 |  | * Returns the line number of the first character for current token (being
64 |  | * matched after the last call to BeginTOken).
65 |  | */
66 |  | int getBeginLine();
67 |  |
68 |  | /**
69 |  | * Backs up the input stream by amount steps. Lexer calls this method if it
70 |  | * had already read some characters, but could not use them to match a
71 |  | * (longer) token. So, they will be used again as the prefix of the next
72 |  | * token and it is the implemetation's responsibility to do this right.
73 |  | */
74 |  | void backup(int amount);
75 |  |
76 |  | /**
77 |  | * Returns the next character that marks the beginning of the next token.
78 |  | * All characters must remain in the buffer between two successive calls
79 |  | * to this method to implement backup correctly.
80 |  | */
81 |  | char BeginToken() throws java.io.IOException;
82 |  |
83 |  | /**
84 |  | * Returns a string made up of characters from the marked token beginning
85 |  | * to the current buffer position. Implementations have the choice of returning
86 |  | * anything that they want to. For example, for efficiency, one might decide
87 |  | * to just return null, which is a valid implementation.
88 |  | */
89 |  | String GetImage();
90 |  |
91 |  | /**
92 |  | * Returns an array of characters that make up the suffix of length 'len' for
93 |  | * the currently matched token. This is used to build up the matched string
94 |  | * for use in actions in the case of MORE. A simple and inefficient
95 |  | * implementation of this is as follows :
96 |  | * <p/>
97 |  | * {
98 |  | * String t = GetImage();
99 |  | * return t.substring(t.length() - len, t.length()).toCharArray();
100 |  | * }
101 |  | */
102 |  | char[] GetSuffix(int len);
103 |  |
104 |  | /**
105 |  | * The lexer calls this function to indicate that it is done with the stream
106 |  | * and hence implementations can free any resources held by this class.
107 |  | * Again, the body of this function can be just empty and it will not
108 |  | * affect the lexer's operation.
109 |  | */
110 |  | void Done();
111 |  |
112 |  | }