net.sourceforge.pmd.lang.cpp

## Class ContinuationReader

- java.lang.Object
- - java.io.Reader
  - - net.sourceforge.pmd.lang.cpp.ContinuationReader

All Implemented Interfaces:
  Closeable, AutoCloseable, 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

Fields
`protected PushbackReader` `in`

### Fields inherited from class java.io.Reader

`lock`

### Constructor Summary

Constructors
Constructor and Description
`ContinuationReader(Reader in)`

### Method Summary

Methods
`void` `close()`
`int` `read(char[] cbuf, int off, int len)`

### Methods inherited from class java.io.Reader

`mark, markSupported, read, read, read, ready, reset, skip`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### in

    protected final PushbackReader in

### Constructor Detail

#### ContinuationReader

    public ContinuationReader(Reader in)

### Method Detail

#### 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 interface `AutoCloseable`
Specified by:
  `close` in class `Reader`
Throws:
  `IOException`