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.
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
ContinuationReader
public ContinuationReader(Reader in)
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-2012 InfoEther. All Rights Reserved.