public final class JSRegexParser extends Object implements RegexParser
| Constructor and Description |
|---|
JSRegexParser(RegexLanguage language,
RegexSource source,
CompilationBuffer compilationBuffer) |
JSRegexParser(RegexLanguage language,
RegexSource source,
CompilationBuffer compilationBuffer,
RegexSource originalSource) |
| Modifier and Type | Method and Description |
|---|---|
RegexFlags |
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.
|
static Group |
parseRootLess(RegexLanguage language,
String pattern) |
public JSRegexParser(RegexLanguage language, RegexSource source, CompilationBuffer compilationBuffer) throws RegexSyntaxException
RegexSyntaxExceptionpublic JSRegexParser(RegexLanguage language, RegexSource source, CompilationBuffer compilationBuffer, RegexSource originalSource) throws RegexSyntaxException
RegexSyntaxExceptionpublic static Group parseRootLess(RegexLanguage language, String pattern) throws RegexSyntaxException
RegexSyntaxExceptionpublic RegexFlags 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