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
public abstract class BackslashEscapeTranslator extends EscapeTranslator
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 Constructor Description BackslashEscapeTranslator(TextDocument builder)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected int
abortEscape(int off, int maxOff)
protected int
gobbleMaxWithoutEscape(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 int
handleBackslash(int maxOff, int firstBackslashOff)
protected int
recordEscape(int startOffsetInclusive, int endOffsetExclusive, Chars translation)
-
Methods inherited from class net.sourceforge.pmd.lang.ast.impl.javacc.EscapeTranslator
ensureOpen, locationAt, translateDocument
-
-
-
-
Constructor Detail
-
BackslashEscapeTranslator
public BackslashEscapeTranslator(TextDocument builder)
-
-
Method Detail
-
gobbleMaxWithoutEscape
protected int gobbleMaxWithoutEscape(int maxOff) throws MalformedSourceException
Description copied from class:EscapeTranslator
Returns the max offset, EXclusive, up to which we can cut the input array from the bufpos to dump it into the output array.- Overrides:
gobbleMaxWithoutEscape
in 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
protected int recordEscape(int startOffsetInclusive, int endOffsetExclusive, Chars translation)
- Overrides:
recordEscape
in classEscapeTranslator
-
abortEscape
protected int abortEscape(int off, int maxOff)
-
-