public final class PythonRegexParser extends Object implements RegexParser
| Constructor and Description |
|---|
PythonRegexParser(RegexLanguage language,
RegexSource source,
CompilationBuffer compilationBuffer) |
| Modifier and Type | Method and Description |
|---|---|
PythonFlags |
getFlags()
Returns a
TruffleObject representing the compilation flags which were set for the
regular expression. |
AbstractRegexObject |
getNamedCaptureGroups()
Returns a map from the names of capture groups to their indices.
|
RegexAST |
parse()
Runs the parser and produces an AST.
|
public PythonRegexParser(RegexLanguage language, RegexSource source, CompilationBuffer compilationBuffer) throws RegexSyntaxException
RegexSyntaxExceptionpublic PythonFlags getFlags()
RegexParserTruffleObject representing the compilation flags which were set for the
regular expression. The returned object responds to 'READ' messages on names which correspond
to the names of the flags as used in the language from which the flavor originates. This
method has to be called after calling RegexParser.parse().getFlags in interface RegexParserpublic AbstractRegexObject getNamedCaptureGroups()
RegexParserRegexParser.parse().getNamedCaptureGroups in interface RegexParserpublic RegexAST parse() throws RegexSyntaxException
RegexParserparse in interface RegexParserRegexSyntaxException - when the pattern or the flags are not well-formed