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 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 Detail
-
BackslashEscapeTranslator
public BackslashEscapeTranslator(TextDocument builder)
-
-
Method Detail
-
gobbleMaxWithoutEscape
protected int gobbleMaxWithoutEscape(int maxOff) throws MalformedSourceExceptionDescription 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
protected int recordEscape(int startOffsetInclusive, int endOffsetExclusive, Chars translation)- Overrides:
recordEscapein classEscapeTranslator
-
abortEscape
protected int abortEscape(int off, int maxOff)
-
-