net.sourceforge.pmd.lang.cpp
Class ContinuationReader
java.lang.Object
java.io.Reader
net.sourceforge.pmd.lang.cpp.ContinuationReader
- All Implemented Interfaces:
- Closeable, Readable
public class ContinuationReader
- extends Reader
A custom Reader
which completely omits C/C++ continuation character
sequences from an underlying reader. Specifically the sequences \ \n
(backslash, carriage return), or \ \r \n
(backslash, line feed,
carriage return).
This reader exists because to modify a JavaCC lexer to understand arbitrary
continuations inside of any token is cumbersome, and just removing them from
the input entirely is easier to implement. See this discussion on the JavaCC
mailing list on line
continuation character.
Field Summary |
protected PushbackReader |
in
the original stream is wrapped in this pushback reader. |
Method Summary |
void |
close()
|
int |
read(char[] cbuf,
int off,
int len)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
in
protected final PushbackReader in
- the original stream is wrapped in this pushback reader.
ContinuationReader
public ContinuationReader(Reader in)
- Creates a new
ContinuationReader
which filters the given reader.
- Parameters:
in
- the given reader
read
public int read(char[] cbuf,
int off,
int len)
throws IOException
- Specified by:
read
in class Reader
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Specified by:
close
in class Reader
- Throws:
IOException
Copyright © 2002-2015 InfoEther. All Rights Reserved.