Search in sources :

Example 1 with JavaLexer

use of org.codehaus.groovy.antlr.java.JavaLexer in project groovy by apache.

the class GroovyRootDocBuilder method getJavaParser.

private static 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;
}
Also used : JavaLexer(org.codehaus.groovy.antlr.java.JavaLexer) StringReader(java.io.StringReader) JavaRecognizer(org.codehaus.groovy.antlr.java.JavaRecognizer) UnicodeEscapingReader(org.codehaus.groovy.antlr.UnicodeEscapingReader)

Example 2 with JavaLexer

use of org.codehaus.groovy.antlr.java.JavaLexer 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;
}
Also used : JavaLexer(org.codehaus.groovy.antlr.java.JavaLexer) StringReader(java.io.StringReader) JavaRecognizer(org.codehaus.groovy.antlr.java.JavaRecognizer) UnicodeEscapingReader(org.codehaus.groovy.antlr.UnicodeEscapingReader)

Aggregations

StringReader (java.io.StringReader)2 UnicodeEscapingReader (org.codehaus.groovy.antlr.UnicodeEscapingReader)2 JavaLexer (org.codehaus.groovy.antlr.java.JavaLexer)2 JavaRecognizer (org.codehaus.groovy.antlr.java.JavaRecognizer)2