public final class PythonRegexLexer extends RegexLexer
RegexLexer.ErrorHandler, RegexLexer.ParseGroupNameResult, RegexLexer.ParseGroupNameResultStatenamedCaptureGroups, pattern, position, source| Constructor and Description |
|---|
PythonRegexLexer(RegexSource source,
PythonREMode mode) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
caseFold(CodePointSetAccumulator charClass)
Case folds a given character class.
|
protected boolean |
featureEnabledAZPositionAssertions()
Returns
true if \A and \Z position assertions are supported. |
protected boolean |
featureEnabledBoundedQuantifierEmptyMin()
Returns
true if empty minimum values in bounded quantifiers (e.g. |
protected boolean |
featureEnabledCharClassFirstBracketIsLiteral()
Returns
true if the first character in a character class must be interpreted as part
of the character set, even if it is the closing bracket ']'. |
protected boolean |
featureEnabledForwardReferences()
Returns
true if forward references are allowed. |
protected boolean |
featureEnabledGroupComments()
Returns
true if group comments (e.g. |
protected boolean |
featureEnabledIgnoreCase()
Returns
true if ignore-case mode is currently enabled. |
protected boolean |
featureEnabledLineComments()
Returns
true if line comments (e.g. |
protected boolean |
featureEnabledOctalEscapes()
Returns
true if octal escapes (e.g. |
protected boolean |
featureEnabledUnicodePropertyEscapes()
Returns
true if unicode property escapes (e.g. |
protected CodePointSet |
getDotCodePointSet()
Returns the code point set represented by the dot operator.
|
protected CodePointSet |
getIdContinue()
Returns the set of all codepoints a group identifier may continue with.
|
protected CodePointSet |
getIdStart()
Returns the set of all codepoints a group identifier may begin with.
|
PythonLocaleData |
getLocaleData() |
protected int |
getMaxBackReferenceDigits()
Returns the maximum number of digits to parse when parsing a back-reference.
|
protected CodePointSet |
getPredefinedCharClass(char c)
Returns the CodePointSet associated with the given predefined character class (e.g.
|
protected RegexSyntaxException |
handleBoundedQuantifierOutOfOrder()
Handle
{2,1}. |
protected Token |
handleBoundedQuantifierSyntaxError()
Handle syntax errors in bounded quantifiers (missing }, non-digit characters).
|
protected RegexSyntaxException |
handleCCRangeOutOfOrder(int rangeStart)
Handle out of order character class range elements, e.g.
|
protected void |
handleCCRangeWithPredefCharClass(int rangeStart)
Handle non-codepoint character class range elements, e.g.
|
protected RegexSyntaxException |
handleEmptyGroupName()
Handle empty group name in group references.
|
protected RegexSyntaxException |
handleGroupRedefinition(String name,
int newId,
int oldId) |
protected void |
handleIncompleteEscapeX()
Handle incomplete hex escapes, e.g.
|
protected void |
handleInvalidBackReference(int reference)
Handle group references to non-existent groups.
|
protected void |
handleInvalidBackReference(String reference)
Handle group references to non-existent groups.
|
protected RegexSyntaxException |
handleInvalidGroupBeginQ()
Handle groups starting with
(? and invalid next char. |
protected void |
handleOctalOutOfRange()
Handle octal values larger than 255.
|
protected void |
handleUnfinishedEscape()
Handle unfinished escape (e.g.
|
protected void |
handleUnfinishedGroupComment()
Handle unfinished group comment
(#...). |
protected RegexSyntaxException |
handleUnfinishedGroupQ()
Handle unfinished group with question mark
(?. |
protected RegexSyntaxException |
handleUnmatchedLeftBracket()
Handle unmatched
[. |
protected void |
handleUnmatchedRightBrace()
Handle unmatched }.
|
protected void |
handleUnmatchedRightBracket()
Handle unmatched
]. |
protected int |
parseCodePointInGroupName()
Parse the next codepoint in a group name and return it.
|
protected Token |
parseCustomEscape(char c)
Parse any escape sequence starting with
\ and the argument c. |
protected int |
parseCustomEscapeChar(char c,
boolean inCharClass)
Parse an escape character sequence (inside character class, or other escapes have already
been tried) starting with
\ and the argument {code c}. |
protected int |
parseCustomEscapeCharFallback(int c,
boolean inCharClass)
Parse an escape character sequence (inside character class, or other escapes have already
been tried) starting with
\ and the code point c.This method is called after
all other means of parsing the escape sequence have been exhausted. |
protected Token |
parseCustomGroupBeginQ(char charAfterQuestionMark)
Parse group starting with
(?. |
protected Token |
parseGroupLt()
Parse group starting with
(<. |
void |
popLocalFlags() |
RegexSyntaxException |
syntaxErrorAtAbs(String msg,
int i) |
RegexSyntaxException |
syntaxErrorHere(String msg) |
advance, advance, atEnd, charClass, consumeChar, consumingLookahead, consumingLookahead, count, count, countDecimalDigits, countFrom, countUpTo, curChar, findChars, finishSurrogatePair, getLastAtomPosition, getLastTokenPosition, getNamedCaptureGroups, hasNamedCaptureGroups, hasNext, isDecimalDigit, isEscaped, isHexDigit, isOctalDigit, lookahead, lookahead, lookbehind, next, numberOfCaptureGroupsSoFar, parseGroupName, parseIntSaturated, parseOctal, registerNamedCaptureGroup, retreat, syntaxError, totalNumberOfCaptureGroupspublic PythonRegexLexer(RegexSource source, PythonREMode mode)
public PythonLocaleData getLocaleData()
public void popLocalFlags()
protected boolean featureEnabledIgnoreCase()
RegexLexertrue if ignore-case mode is currently enabled.featureEnabledIgnoreCase in class RegexLexerprotected boolean featureEnabledAZPositionAssertions()
RegexLexertrue if \A and \Z position assertions are supported.featureEnabledAZPositionAssertions in class RegexLexerprotected boolean featureEnabledBoundedQuantifierEmptyMin()
RegexLexertrue if empty minimum values in bounded quantifiers (e.g. {,1}) are
allowed and treated as zero.featureEnabledBoundedQuantifierEmptyMin in class RegexLexerprotected boolean featureEnabledCharClassFirstBracketIsLiteral()
RegexLexertrue if the first character in a character class must be interpreted as part
of the character set, even if it is the closing bracket ']'.featureEnabledCharClassFirstBracketIsLiteral in class RegexLexerprotected boolean featureEnabledForwardReferences()
RegexLexertrue if forward references are allowed.featureEnabledForwardReferences in class RegexLexerprotected boolean featureEnabledGroupComments()
RegexLexertrue if group comments (e.g. (# ... )) are supported.featureEnabledGroupComments in class RegexLexerprotected boolean featureEnabledLineComments()
RegexLexertrue if line comments (e.g. # ... ) are supported.featureEnabledLineComments in class RegexLexerprotected boolean featureEnabledOctalEscapes()
RegexLexertrue if octal escapes (e.g. \012) are supported.featureEnabledOctalEscapes in class RegexLexerprotected boolean featureEnabledUnicodePropertyEscapes()
RegexLexertrue if unicode property escapes (e.g. \p{...}) are supported.featureEnabledUnicodePropertyEscapes in class RegexLexerprotected CodePointSet getDotCodePointSet()
RegexLexergetDotCodePointSet in class RegexLexerprotected CodePointSet getIdContinue()
RegexLexergetIdContinue in class RegexLexerprotected CodePointSet getIdStart()
RegexLexergetIdStart in class RegexLexerprotected int getMaxBackReferenceDigits()
RegexLexergetMaxBackReferenceDigits in class RegexLexerprotected void caseFold(CodePointSetAccumulator charClass)
RegexLexercaseFold in class RegexLexerprotected CodePointSet getPredefinedCharClass(char c)
RegexLexer\d).
Note that the CodePointSet returned by this function has already been case-folded and negated.
getPredefinedCharClass in class RegexLexerprotected RegexSyntaxException handleBoundedQuantifierOutOfOrder()
RegexLexer{2,1}.handleBoundedQuantifierOutOfOrder in class RegexLexerprotected Token handleBoundedQuantifierSyntaxError() throws RegexSyntaxException
RegexLexerhandleBoundedQuantifierSyntaxError in class RegexLexerRegexSyntaxExceptionprotected RegexSyntaxException handleCCRangeOutOfOrder(int rangeStart)
RegexLexer[b-a].handleCCRangeOutOfOrder in class RegexLexerprotected void handleCCRangeWithPredefCharClass(int rangeStart)
RegexLexer[\w-a].handleCCRangeWithPredefCharClass in class RegexLexerprotected RegexSyntaxException handleEmptyGroupName()
RegexLexerhandleEmptyGroupName in class RegexLexerprotected RegexSyntaxException handleGroupRedefinition(String name, int newId, int oldId)
handleGroupRedefinition in class RegexLexerprotected void handleIncompleteEscapeX()
RegexLexer\x1.handleIncompleteEscapeX in class RegexLexerprotected void handleInvalidBackReference(int reference)
RegexLexerhandleInvalidBackReference in class RegexLexerprotected void handleInvalidBackReference(String reference)
RegexLexerhandleInvalidBackReference in class RegexLexerprotected RegexSyntaxException handleInvalidGroupBeginQ()
RegexLexer(? and invalid next char.handleInvalidGroupBeginQ in class RegexLexerprotected void handleOctalOutOfRange()
RegexLexerhandleOctalOutOfRange in class RegexLexerprotected void handleUnfinishedEscape()
RegexLexer\).handleUnfinishedEscape in class RegexLexerprotected void handleUnfinishedGroupComment()
RegexLexer(#...).handleUnfinishedGroupComment in class RegexLexerprotected RegexSyntaxException handleUnfinishedGroupQ()
RegexLexer(?.handleUnfinishedGroupQ in class RegexLexerprotected void handleUnmatchedRightBrace()
RegexLexerhandleUnmatchedRightBrace in class RegexLexerprotected RegexSyntaxException handleUnmatchedLeftBracket()
RegexLexer[.handleUnmatchedLeftBracket in class RegexLexerprotected void handleUnmatchedRightBracket()
RegexLexer].handleUnmatchedRightBracket in class RegexLexerprotected int parseCodePointInGroupName()
throws RegexSyntaxException
RegexLexerparseCodePointInGroupName in class RegexLexerRegexSyntaxExceptionprotected Token parseCustomEscape(char c)
RegexLexer\ and the argument c.parseCustomEscape in class RegexLexerprotected int parseCustomEscapeChar(char c,
boolean inCharClass)
RegexLexer\ and the argument {code c}.parseCustomEscapeChar in class RegexLexerprotected int parseCustomEscapeCharFallback(int c,
boolean inCharClass)
RegexLexer\ and the code point c.This method is called after
all other means of parsing the escape sequence have been exhausted.parseCustomEscapeCharFallback in class RegexLexerprotected Token parseCustomGroupBeginQ(char charAfterQuestionMark)
RegexLexer(?.parseCustomGroupBeginQ in class RegexLexerprotected Token parseGroupLt()
RegexLexer(<.parseGroupLt in class RegexLexerpublic RegexSyntaxException syntaxErrorAtAbs(String msg, int i)
public RegexSyntaxException syntaxErrorHere(String msg)