Top Description Inners Fields Constructors Methods
org.codehaus.groovy.antlr

public Class UnicodeEscapingReader

extends Reader
Class Inheritance
Annotations
@Deprecated
Imports
antlr.CharScanner, .Token, .TokenStreamException, java.io.IOException, .Reader

Deprecated

Translates GLS-defined unicode escapes into characters. Throws an exception in the event of an invalid unicode escape being detected.

No attempt has been made to optimize this class for speed or space.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private boolean
private CharScanner
private int
private int
private int
private int
private final Reader
private final SourceBuffer
Inherited from java.io.Reader:
lock

Constructor Summary

AccessConstructor and Description
public
UnicodeEscapingReader(Reader
The reader that this reader will filter over.
reader
,
SourceBuffer sourceBuffer)

Constructor.

Method Summary

Modifier and TypeMethod and Description
private void
checkHexDigit(int c)

Checks that the given character is indeed a hex digit.

public void
close()

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Closes this reader by calling close on the underlying reader.
public int
public int
public int
read(char[]
Destination buffer
cbuf
,
int
Offset at which to start storing characters
off
,
int
Maximum number of characters to read
len
)

Implements abstract java.io.Reader.read.

Reads characters from the underlying reader.
public int
read()

Overrides java.io.Reader.read.

Gets the next character from the underlying reader, translating escapes as required.
public void
setLexer(CharScanner lexer)

Sets the lexer that is using this reader.

private void
write(int c)

Inherited from java.io.Reader:
markmarkSupportednullReaderreadreadreadyresetskiptransferTo

Field Detail

hasNextCharback to summary
private boolean hasNextChar
lexerback to summary
private CharScanner lexer
nextCharback to summary
private int nextChar
numUnicodeEscapesFoundback to summary
private int numUnicodeEscapesFound
numUnicodeEscapesFoundOnCurrentLineback to summary
private int numUnicodeEscapesFoundOnCurrentLine
previousLineback to summary
private int previousLine
readerback to summary
private final Reader reader
sourceBufferback to summary
private final SourceBuffer sourceBuffer

Constructor Detail

UnicodeEscapingReaderback to summary
public UnicodeEscapingReader(Reader reader, SourceBuffer sourceBuffer)

Constructor.

Parameters
reader:Reader

The reader that this reader will filter over.

Method Detail

checkHexDigitback to summary
private void checkHexDigit(int c) throws IOException

Checks that the given character is indeed a hex digit.

closeback to summary
public void close() throws IOException

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Closes this reader by calling close on the underlying reader.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Reader.close.

If an I/O error occurs

See Also
java.io.Reader#close()
getUnescapedUnicodeColumnCountback to summary
public int getUnescapedUnicodeColumnCount()
getUnescapedUnicodeOffsetCountback to summary
public int getUnescapedUnicodeOffsetCount()
readback to summary
public int read(char[] cbuf, int off, int len) throws IOException

Implements abstract java.io.Reader.read.

Reads characters from the underlying reader.

Parameters
cbuf:char[]

Doc from java.io.Reader.read.

Destination buffer

off:int

Doc from java.io.Reader.read.

Offset at which to start storing characters

len:int

Doc from java.io.Reader.read.

Maximum number of characters to read

Returns:int

Doc from java.io.Reader.read.

The number of characters read, or -1 if the end of the stream has been reached

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Reader.read.

If an I/O error occurs

See Also
java.io.Reader#read(char[], int, int)
readback to summary
public int read() throws IOException

Overrides java.io.Reader.read.

Gets the next character from the underlying reader, translating escapes as required.

Returns:int

Doc from java.io.Reader.read.

The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Reader.read.

If an I/O error occurs

See Also
java.io.Reader#close()
setLexerback to summary
public void setLexer(CharScanner lexer)

Sets the lexer that is using this reader. Must be called before the lexer is used.

writeback to summary
private void write(int c)
org.codehaus.groovy.antlr back to summary

private Class UnicodeEscapingReader.DummyLexer

extends CharScanner
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Token
t

Inherited from antlr.CharScanner:
_returnTokencaseSensitivecaseSensitiveLiteralscommitToPathEOF_CHARhashStringinputStateliteralssaveConsumedInputtabsizetexttokenObjectClasstraceDepth

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
public int
public Token
Inherited from antlr.CharScanner:
appendappendcommitconsumeconsumeUntilconsumeUntilgetCaseSensitivegetCaseSensitiveLiteralsgetCommitToPathgetFilenamegetInputBuffergetInputStategetTabSizegetTextgetTokenObjectLAmakeTokenmarkmatchmatchmatchmatchNotmatchRangenewlinepanicpanicreportErrorreportErrorreportWarningresetTextrewindsetCaseSensitivesetColumnsetCommitToPathsetFilenamesetInputStatesetLinesetTabSizesetTextsetTokenObjectClasstabtestLiteralsTabletestLiteralsTabletoLowertraceIntraceIndenttraceOutuponEOF

Field Detail

tback to summary
private final Token t

Constructor Detail

DummyLexerback to summary
private DummyLexer()

Method Detail

getColumnback to summary
public int getColumn()

Overrides antlr.CharScanner.getColumn.

Annotations
@Override
getLineback to summary
public int getLine()

Overrides antlr.CharScanner.getLine.

Annotations
@Override
nextTokenback to summary
public Token nextToken() throws TokenStreamException

Implements antlr.TokenStream.nextToken.

Annotations
@Override