Class BackslashEscapeTranslator
java.lang.Object
net.sourceforge.pmd.lang.ast.impl.javacc.EscapeTranslator
net.sourceforge.pmd.lang.ast.impl.javacc.BackslashEscapeTranslator
- Direct Known Subclasses:
JavaEscapeTranslator
A base class for readers that handle escapes starting with a backslash.
-
Field Summary
Fields inherited from class net.sourceforge.pmd.lang.ast.impl.javacc.EscapeTranslator
bufpos, input -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intabortEscape(int off, int maxOff) protected intgobbleMaxWithoutEscape(int maxOff) Returns the max offset, EXclusive, up to which we can cut the input array from the bufpos to dump it into the output array.protected abstract inthandleBackslash(int maxOff, int firstBackslashOff) protected intrecordEscape(int startOffsetInclusive, int endOffsetExclusive, Chars translation) Methods inherited from class net.sourceforge.pmd.lang.ast.impl.javacc.EscapeTranslator
ensureOpen, locationAt, translateDocument
-
Constructor Details
-
BackslashEscapeTranslator
-
-
Method Details
-
gobbleMaxWithoutEscape
Description copied from class:EscapeTranslatorReturns the max offset, EXclusive, up to which we can cut the input array from the bufpos to dump it into the output array.- Overrides:
gobbleMaxWithoutEscapein classEscapeTranslator- Parameters:
maxOff- Max offset up to which to read ahead- Throws:
MalformedSourceException
-
handleBackslash
protected abstract int handleBackslash(int maxOff, int firstBackslashOff) throws MalformedSourceException - Throws:
MalformedSourceException
-
recordEscape
- Overrides:
recordEscapein classEscapeTranslator
-
abortEscape
protected int abortEscape(int off, int maxOff)
-