use of java.io.StringReader in project groovy-core by groovy.
the class EnumSourceParsingTest method testParseEnumImplementsMultiLine.
public void testParseEnumImplementsMultiLine() {
StringReader reader = new StringReader("enum ParseCode implements I\n" + "{\n" + " COMPLETE,\n" + " INCOMPLETE,\n" + " ERROR\n" + "}");
parse("testParseEnumImplementsMultiLine", reader);
}
use of java.io.StringReader in project groovy-core by groovy.
the class EnumSourceParsingTest method testParseEnumMultiLine.
public void testParseEnumMultiLine() {
StringReader reader = new StringReader("enum ParseCode\n" + "{\n" + " COMPLETE,\n" + " INCOMPLETE,\n" + " ERROR\n" + "}");
parse("testParseEnumMultiLine", reader);
}
use of java.io.StringReader in project groovy-core by groovy.
the class EnumSourceParsingTest method testParseEnumImplements.
public void testParseEnumImplements() {
StringReader reader = new StringReader("enum Two implements I1 {\n" + "ONE, TWO, THREE\n" + "}");
parse("testParseEnumImplements", reader);
}
use of java.io.StringReader in project groovy-core by groovy.
the class GroovyRootDocBuilder method getGroovyParser.
private GroovyRecognizer getGroovyParser(String input, SourceBuffer sourceBuffer) {
UnicodeEscapingReader unicodeReader = new UnicodeEscapingReader(new StringReader(input), sourceBuffer);
GroovyLexer lexer = new GroovyLexer(unicodeReader);
unicodeReader.setLexer(lexer);
GroovyRecognizer parser = GroovyRecognizer.make(lexer);
parser.setSourceBuffer(sourceBuffer);
return parser;
}
use of java.io.StringReader in project groovy-core by groovy.
the class GroovyRootDocBuilder method getJavaParser.
private JavaRecognizer getJavaParser(String input, SourceBuffer sourceBuffer) {
UnicodeEscapingReader unicodeReader = new UnicodeEscapingReader(new StringReader(input), sourceBuffer);
JavaLexer lexer = new JavaLexer(unicodeReader);
unicodeReader.setLexer(lexer);
JavaRecognizer parser = JavaRecognizer.make(lexer);
parser.setSourceBuffer(sourceBuffer);
return parser;
}
Aggregations