Package net.sf.saxon.functions.regex
Class RegexTranslator
java.lang.Object
net.sf.saxon.functions.regex.RegexTranslator
- Direct Known Subclasses:
JDK15RegexTranslator
Abstract superclass for the various regex translators, which differ according to the target platform.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA Range represents a range of consecutive Unicode codepoints -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected IntHashSetprotected booleanprotected charprotected intprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected intstatic final intstatic final Stringprotected intprotected CharSequenceprotected final FastStringBufferstatic final intstatic final Stringstatic final Stringprotected List<RegexSyntaxException> protected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected voidadvance()protected voidprotected voidexpect(char c) protected static StringhighSurrogateRanges(List<RegexTranslator.Range> ranges) protected static booleanisAsciiAlnum(char c) protected static booleanisJavaMetaChar(int c) protected static StringlowSurrogateRanges(List<RegexTranslator.Range> ranges) protected RegexSyntaxExceptionmakeException(String key) protected RegexSyntaxExceptionmakeException(String key, String arg) protected CharSequenceprotected voidrecede()protected abstract booleanIf what follows is an Atom, translate it and return true; otherwise return falseprotected voidprotected voidprotected voidprotected voidprotected void
-
Field Details
-
regExp
-
xmlVersion
protected int xmlVersion -
xsdVersion
protected int xsdVersion -
isXPath
protected boolean isXPath -
isXPath30
protected boolean isXPath30 -
ignoreWhitespace
protected boolean ignoreWhitespace -
inCharClassExpr
protected boolean inCharClassExpr -
caseBlind
protected boolean caseBlind -
expandComplementBlockNames
protected boolean expandComplementBlockNames -
pos
protected int pos -
length
protected int length -
curChar
protected char curChar -
eos
protected boolean eos -
currentCapture
protected int currentCapture -
captures
-
result
-
warnings
-
NONE
public static final int NONE- See Also:
-
SOME
public static final int SOME- See Also:
-
ALL
public static final int ALL- See Also:
-
SURROGATES1_CLASS
- See Also:
-
SURROGATES2_CLASS
- See Also:
-
NOT_ALLOWED_CLASS
- See Also:
-
-
Constructor Details
-
RegexTranslator
public RegexTranslator()
-
-
Method Details
-
translateTop
- Throws:
RegexSyntaxException
-
translateRegExp
- Throws:
RegexSyntaxException
-
translateBranch
- Throws:
RegexSyntaxException
-
translateAtom
If what follows is an Atom, translate it and return true; otherwise return false- Returns:
- true if we found an atom
- Throws:
RegexSyntaxException- if the regex syntax is incorrect
-
translateQuantifier
- Throws:
RegexSyntaxException
-
translateQuantity
- Throws:
RegexSyntaxException
-
parseQuantExact
- Throws:
RegexSyntaxException
-
copyCurChar
protected void copyCurChar() -
advance
protected void advance() -
absorbSurrogatePair
- Throws:
RegexSyntaxException
-
recede
protected void recede() -
expect
- Throws:
RegexSyntaxException
-
makeException
-
makeException
-
isJavaMetaChar
protected static boolean isJavaMetaChar(int c) -
highSurrogateRanges
-
lowSurrogateRanges
-
isAsciiAlnum
protected static boolean isAsciiAlnum(char c)
-