|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
StringCharStream.java | 0% | 0% | 0% | 0% |
|
1 |
package org.codehaus.groovy.syntax.lexer;
|
|
2 |
|
|
3 |
import org.codehaus.groovy.syntax.ReadException;
|
|
4 |
|
|
5 |
public class StringCharStream extends AbstractCharStream { |
|
6 |
private int cur; |
|
7 |
private String text;
|
|
8 |
|
|
9 | 0 |
public StringCharStream(String text) {
|
10 | 0 |
this.text = text;
|
11 | 0 |
this.cur = 0;
|
12 |
} |
|
13 |
|
|
14 | 0 |
public StringCharStream(String text, String description) {
|
15 | 0 |
super(description);
|
16 | 0 |
this.text = text;
|
17 | 0 |
this.cur = 0;
|
18 |
} |
|
19 |
|
|
20 | 0 |
public char consume() throws ReadException { |
21 | 0 |
if (this.cur >= this.text.length()) { |
22 | 0 |
return CharStream.EOS;
|
23 |
} |
|
24 |
|
|
25 | 0 |
char c = this.text.charAt(this.cur); |
26 |
|
|
27 | 0 |
++this.cur;
|
28 |
|
|
29 | 0 |
return c;
|
30 |
} |
|
31 |
|
|
32 | 0 |
public void close() throws ReadException { |
33 |
// do nothing
|
|
34 |
} |
|
35 |
} |
|
36 |
|
|