Package com.sun.msv.datatype.regexp
Class Token
- java.lang.Object
-
- com.sun.msv.datatype.regexp.Token
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
RangeToken,Token.CharToken,Token.ClosureToken,Token.ConcatToken,Token.ConditionToken,Token.ModifierToken,Token.ParenToken,Token.StringToken,Token.UnionToken
class Token extends java.lang.Object implements java.io.SerializableThis class represents a node in parse tree.- Version:
- Token.java,v 1.7 2003/02/25 14:43:13 sandygao Exp
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classToken.CharTokenThis class represents a node in parse tree.(package private) static classToken.ClosureTokenThis class represents a node in parse tree.(package private) static classToken.ConcatTokenThis class represents a node in parse tree.(package private) static classToken.ConditionToken(?(condition)yes-pattern|no-pattern)(package private) static classToken.FixedStringContainer(package private) static classToken.ModifierToken(ims-ims: ....(package private) static classToken.ParenTokenThis class represents a node in parse tree.(package private) static classToken.StringTokenThis class represents a node in parse tree.(package private) static classToken.UnionTokenThis class represents a node in parse tree.
-
Field Summary
Fields Modifier and Type Field Description (package private) static intANCHOR(package private) static intBACKREFERENCEprivate static java.lang.String[]blockNames(package private) static java.lang.StringblockRangesprivate static java.util.Hashtablecategoriesprivate static java.util.Hashtablecategories2private static java.lang.String[]categoryNames(package private) static intCHAR(package private) static intCHAR_FINAL_QUOTE(package private) static intCHAR_INIT_QUOTE(package private) static intCHAR_LETTER(package private) static intCHAR_MARK(package private) static intCHAR_NUMBER(package private) static intCHAR_OTHER(package private) static intCHAR_PUNCTUATION(package private) static intCHAR_SEPARATOR(package private) static intCHAR_SYMBOL(package private) static intCLOSURE(package private) static intCONCAT(package private) static intCONDITION(package private) static booleanCOUNTTOKENS(package private) static intDOT(package private) static intEMPTY(package private) static intFC_ANY(package private) static intFC_CONTINUE(package private) static intFC_TERMINAL(package private) static intINDEPENDENT(package private) static intLOOKAHEAD(package private) static intLOOKBEHIND(package private) static intMODIFIERGROUP(package private) static intNEGATIVELOOKAHEAD(package private) static intNEGATIVELOOKBEHINDprivate static intNONBMP_BLOCK_START(package private) static int[]nonBMPBlockRanges(package private) static intNONGREEDYCLOSURE(package private) static java.util.Hashtablenonxs(package private) static intNRANGE(package private) static intPAREN(package private) static intRANGE(package private) static intSTRING(package private) static Tokentoken_0to9private static Tokentoken_ccsCombing Character Sequence in Perl 5.6.(package private) static Tokentoken_dot(package private) static Tokentoken_emptyprivate static Tokentoken_grapheme(package private) static Tokentoken_linebeginning(package private) static Tokentoken_linebeginning2(package private) static Tokentoken_lineend(package private) static Tokentoken_not_0to9(package private) static Tokentoken_not_spaces(package private) static Tokentoken_not_wordchars(package private) static Tokentoken_not_wordedge(package private) static Tokentoken_spaces(package private) static Tokentoken_stringbeginning(package private) static Tokentoken_stringend(package private) static Tokentoken_stringend2(package private) static Tokentoken_wordbeginning(package private) static Tokentoken_wordchars(package private) static Tokentoken_wordedge(package private) static Tokentoken_wordend(package private) static inttokens(package private) inttype(package private) static intUNION(package private) static intUTF16_MAX(package private) static java.lang.StringviramaString
-
Constructor Summary
Constructors Modifier Constructor Description protectedToken(int type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddChild(Token tok)protected voidaddRange(int start, int end)(package private) intanalyzeFirstCharacter(RangeToken result, int options)protected voidcompactRanges()(package private) static TokencomplementRanges(Token tok)private static Token.CharTokencreateAnchor(int ch)(package private) static Token.StringTokencreateBackReference(int refno)(package private) static Token.CharTokencreateChar(int ch)(package private) static Token.ClosureTokencreateClosure(Token tok)(package private) static Token.UnionTokencreateConcat()(package private) static Token.ConcatTokencreateConcat(Token tok1, Token tok2)(package private) static Token.ConditionTokencreateCondition(int refno, Token condition, Token yespat, Token nopat)(package private) static TokencreateEmpty()(package private) static Token.ParenTokencreateLook(int type, Token child)(package private) static Token.ModifierTokencreateModifierGroup(Token child, int add, int mask)(package private) static Token.ClosureTokencreateNGClosure(Token tok)(package private) static RangeTokencreateNRange()(package private) static Token.ParenTokencreateParen(Token child, int pnumber)(package private) static RangeTokencreateRange()(package private) static Token.StringTokencreateString(java.lang.String str)(package private) static Token.UnionTokencreateUnion()(package private) voidfindFixedString(Token.FixedStringContainer container, int options)(package private) intgetChar()(package private) TokengetChild(int index)(package private) static TokengetCombiningCharacterSequence()(package private) static TokengetGraphemePattern()(package private) intgetMax()(package private) intgetMaxLength()(package private) intgetMin()(package private) intgetMinLength()How many characters are needed?(package private) intgetParenNumber()protected static RangeTokengetRange(java.lang.String name, boolean positive)protected static RangeTokengetRange(java.lang.String name, boolean positive, boolean xs)(package private) intgetReferenceNumber()(package private) java.lang.StringgetString()protected voidintersectRanges(Token tok)protected static booleanisRegisterNonXS(java.lang.String name)private static booleanisSet(int options, int flag)private booleanisShorterThan(Token tok)(package private) booleanmatch(int ch)protected voidmergeRanges(Token tok)protected static voidregisterNonXS(java.lang.String name)This method is called by only getRange().private static voidsetAlias(java.lang.String newName, java.lang.String name, boolean positive)(package private) voidsetMax(int max)(package private) voidsetMin(int min)(package private) intsize()A number of children.protected voidsortRanges()protected voidsubtractRanges(Token tok)java.lang.StringtoString()java.lang.StringtoString(int options)
-
-
-
Field Detail
-
COUNTTOKENS
static final boolean COUNTTOKENS
- See Also:
- Constant Field Values
-
tokens
static int tokens
-
CHAR
static final int CHAR
- See Also:
- Constant Field Values
-
DOT
static final int DOT
- See Also:
- Constant Field Values
-
CONCAT
static final int CONCAT
- See Also:
- Constant Field Values
-
UNION
static final int UNION
- See Also:
- Constant Field Values
-
CLOSURE
static final int CLOSURE
- See Also:
- Constant Field Values
-
RANGE
static final int RANGE
- See Also:
- Constant Field Values
-
NRANGE
static final int NRANGE
- See Also:
- Constant Field Values
-
PAREN
static final int PAREN
- See Also:
- Constant Field Values
-
EMPTY
static final int EMPTY
- See Also:
- Constant Field Values
-
ANCHOR
static final int ANCHOR
- See Also:
- Constant Field Values
-
NONGREEDYCLOSURE
static final int NONGREEDYCLOSURE
- See Also:
- Constant Field Values
-
STRING
static final int STRING
- See Also:
- Constant Field Values
-
BACKREFERENCE
static final int BACKREFERENCE
- See Also:
- Constant Field Values
-
LOOKAHEAD
static final int LOOKAHEAD
- See Also:
- Constant Field Values
-
NEGATIVELOOKAHEAD
static final int NEGATIVELOOKAHEAD
- See Also:
- Constant Field Values
-
LOOKBEHIND
static final int LOOKBEHIND
- See Also:
- Constant Field Values
-
NEGATIVELOOKBEHIND
static final int NEGATIVELOOKBEHIND
- See Also:
- Constant Field Values
-
INDEPENDENT
static final int INDEPENDENT
- See Also:
- Constant Field Values
-
MODIFIERGROUP
static final int MODIFIERGROUP
- See Also:
- Constant Field Values
-
CONDITION
static final int CONDITION
- See Also:
- Constant Field Values
-
UTF16_MAX
static final int UTF16_MAX
- See Also:
- Constant Field Values
-
type
int type
-
token_dot
static Token token_dot
-
token_0to9
static Token token_0to9
-
token_wordchars
static Token token_wordchars
-
token_not_0to9
static Token token_not_0to9
-
token_not_wordchars
static Token token_not_wordchars
-
token_spaces
static Token token_spaces
-
token_not_spaces
static Token token_not_spaces
-
token_empty
static Token token_empty
-
token_linebeginning
static Token token_linebeginning
-
token_linebeginning2
static Token token_linebeginning2
-
token_lineend
static Token token_lineend
-
token_stringbeginning
static Token token_stringbeginning
-
token_stringend
static Token token_stringend
-
token_stringend2
static Token token_stringend2
-
token_wordedge
static Token token_wordedge
-
token_not_wordedge
static Token token_not_wordedge
-
token_wordbeginning
static Token token_wordbeginning
-
token_wordend
static Token token_wordend
-
FC_CONTINUE
static final int FC_CONTINUE
- See Also:
- Constant Field Values
-
FC_TERMINAL
static final int FC_TERMINAL
- See Also:
- Constant Field Values
-
FC_ANY
static final int FC_ANY
- See Also:
- Constant Field Values
-
categories
private static final java.util.Hashtable categories
-
categories2
private static final java.util.Hashtable categories2
-
categoryNames
private static final java.lang.String[] categoryNames
-
CHAR_INIT_QUOTE
static final int CHAR_INIT_QUOTE
- See Also:
- Constant Field Values
-
CHAR_FINAL_QUOTE
static final int CHAR_FINAL_QUOTE
- See Also:
- Constant Field Values
-
CHAR_LETTER
static final int CHAR_LETTER
- See Also:
- Constant Field Values
-
CHAR_MARK
static final int CHAR_MARK
- See Also:
- Constant Field Values
-
CHAR_NUMBER
static final int CHAR_NUMBER
- See Also:
- Constant Field Values
-
CHAR_SEPARATOR
static final int CHAR_SEPARATOR
- See Also:
- Constant Field Values
-
CHAR_OTHER
static final int CHAR_OTHER
- See Also:
- Constant Field Values
-
CHAR_PUNCTUATION
static final int CHAR_PUNCTUATION
- See Also:
- Constant Field Values
-
CHAR_SYMBOL
static final int CHAR_SYMBOL
- See Also:
- Constant Field Values
-
blockNames
private static final java.lang.String[] blockNames
-
blockRanges
static final java.lang.String blockRanges
- See Also:
- Constant Field Values
-
nonBMPBlockRanges
static final int[] nonBMPBlockRanges
-
NONBMP_BLOCK_START
private static final int NONBMP_BLOCK_START
- See Also:
- Constant Field Values
-
nonxs
static java.util.Hashtable nonxs
-
viramaString
static final java.lang.String viramaString
- See Also:
- Constant Field Values
-
token_grapheme
private static Token token_grapheme
-
token_ccs
private static Token token_ccs
Combing Character Sequence in Perl 5.6.
-
-
Method Detail
-
createLook
static Token.ParenToken createLook(int type, Token child)
-
createParen
static Token.ParenToken createParen(Token child, int pnumber)
-
createClosure
static Token.ClosureToken createClosure(Token tok)
-
createNGClosure
static Token.ClosureToken createNGClosure(Token tok)
-
createConcat
static Token.ConcatToken createConcat(Token tok1, Token tok2)
-
createConcat
static Token.UnionToken createConcat()
-
createUnion
static Token.UnionToken createUnion()
-
createEmpty
static Token createEmpty()
-
createRange
static RangeToken createRange()
-
createNRange
static RangeToken createNRange()
-
createChar
static Token.CharToken createChar(int ch)
-
createAnchor
private static Token.CharToken createAnchor(int ch)
-
createBackReference
static Token.StringToken createBackReference(int refno)
-
createString
static Token.StringToken createString(java.lang.String str)
-
createModifierGroup
static Token.ModifierToken createModifierGroup(Token child, int add, int mask)
-
createCondition
static Token.ConditionToken createCondition(int refno, Token condition, Token yespat, Token nopat)
-
size
int size()
A number of children.
-
getChild
Token getChild(int index)
-
addChild
void addChild(Token tok)
-
addRange
protected void addRange(int start, int end)
-
sortRanges
protected void sortRanges()
-
compactRanges
protected void compactRanges()
-
mergeRanges
protected void mergeRanges(Token tok)
-
subtractRanges
protected void subtractRanges(Token tok)
-
intersectRanges
protected void intersectRanges(Token tok)
-
setMin
void setMin(int min)
-
setMax
void setMax(int max)
-
getMin
int getMin()
-
getMax
int getMax()
-
getReferenceNumber
int getReferenceNumber()
-
getString
java.lang.String getString()
-
getParenNumber
int getParenNumber()
-
getChar
int getChar()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toString
public java.lang.String toString(int options)
-
getMinLength
final int getMinLength()
How many characters are needed?
-
getMaxLength
final int getMaxLength()
-
isSet
private static final boolean isSet(int options, int flag)
-
analyzeFirstCharacter
final int analyzeFirstCharacter(RangeToken result, int options)
-
isShorterThan
private final boolean isShorterThan(Token tok)
-
findFixedString
final void findFixedString(Token.FixedStringContainer container, int options)
-
match
boolean match(int ch)
-
getRange
protected static RangeToken getRange(java.lang.String name, boolean positive)
-
getRange
protected static RangeToken getRange(java.lang.String name, boolean positive, boolean xs)
-
registerNonXS
protected static void registerNonXS(java.lang.String name)
This method is called by only getRange(). So this method need not MT-safe.
-
isRegisterNonXS
protected static boolean isRegisterNonXS(java.lang.String name)
-
setAlias
private static void setAlias(java.lang.String newName, java.lang.String name, boolean positive)
-
getGraphemePattern
static Token getGraphemePattern()
-
getCombiningCharacterSequence
static Token getCombiningCharacterSequence()
-
-