net.sf.saxon.regex

Class RegexTranslator

Known Direct Subclasses:
JDK15RegexTranslator, SurrogateRegexTranslator

public abstract class RegexTranslator
extends java.lang.Object

Abstract superclass for the various regex translators, which differ according to the target platform.

Nested Class Summary

static class
RegexTranslator.Range
A Range represents a range of consecutive Unicode codepoints

Field Summary

static int
ALL
static int
NONE
static String
NOT_ALLOWED_CLASS
static int
SOME
static String
SURROGATES1_CLASS
static String
SURROGATES2_CLASS
protected IntHashSet
captures
protected boolean
caseBlind
protected char
curChar
protected int
currentCapture
protected boolean
eos
protected boolean
ignoreWhitespace
protected boolean
inCharClassExpr
protected boolean
isXPath
protected int
length
protected int
pos
protected CharSequence
regExp
protected FastStringBuffer
result
protected int
xmlVersion

Method Summary

protected int
absorbSurrogatePair()
protected void
advance()
protected void
copyCurChar()
protected void
expect(char c)
protected static String
highSurrogateRanges(List ranges)
protected static boolean
isAsciiAlnum(char c)
protected static boolean
isBlock(String name)
protected static boolean
isJavaMetaChar(int c)
protected static String
lowSurrogateRanges(List ranges)
protected RegexSyntaxException
makeException(String key)
protected RegexSyntaxException
makeException(String key, String arg)
protected CharSequence
parseQuantExact()
protected void
recede()
protected static void
sortRangeList(List ranges)
protected abstract boolean
translateAtom()
protected void
translateBranch()
protected void
translateQuantifier()
protected void
translateQuantity()
protected void
translateRegExp()
protected void
translateTop()

Field Details

ALL

public static final int ALL
Field Value:
1

NONE

public static final int NONE
Field Value:
-1

NOT_ALLOWED_CLASS

public static final String NOT_ALLOWED_CLASS

SOME

public static final int SOME
Field Value:
0

SURROGATES1_CLASS

public static final String SURROGATES1_CLASS

SURROGATES2_CLASS

public static final String SURROGATES2_CLASS

captures

protected IntHashSet captures

caseBlind

protected boolean caseBlind

curChar

protected char curChar

currentCapture

protected int currentCapture

eos

protected boolean eos

ignoreWhitespace

protected boolean ignoreWhitespace

inCharClassExpr

protected boolean inCharClassExpr

isXPath

protected boolean isXPath

length

protected int length

pos

protected int pos

regExp

protected CharSequence regExp

result

protected final FastStringBuffer result

xmlVersion

protected int xmlVersion

Method Details

absorbSurrogatePair

protected int absorbSurrogatePair()
            throws RegexSyntaxException

advance

protected void advance()

copyCurChar

protected void copyCurChar()

expect

protected void expect(char c)
            throws RegexSyntaxException

highSurrogateRanges

protected static String highSurrogateRanges(List ranges)

isAsciiAlnum

protected static boolean isAsciiAlnum(char c)

isBlock

protected static boolean isBlock(String name)

isJavaMetaChar

protected static boolean isJavaMetaChar(int c)

lowSurrogateRanges

protected static String lowSurrogateRanges(List ranges)

makeException

protected RegexSyntaxException makeException(String key)

makeException

protected RegexSyntaxException makeException(String key,
                                             String arg)

parseQuantExact

protected CharSequence parseQuantExact()
            throws RegexSyntaxException

recede

protected void recede()

sortRangeList

protected static void sortRangeList(List ranges)

translateAtom

protected abstract boolean translateAtom()
            throws RegexSyntaxException

translateBranch

protected void translateBranch()
            throws RegexSyntaxException

translateQuantifier

protected void translateQuantifier()
            throws RegexSyntaxException

translateQuantity

protected void translateQuantity()
            throws RegexSyntaxException

translateRegExp

protected void translateRegExp()
            throws RegexSyntaxException

translateTop

protected void translateTop()
            throws RegexSyntaxException