Interface RegexParser
- All Known Implementing Classes:
JavaRegexParser,JSRegexParser,OracleDBRegexParser,PythonRegexParser,RubyRegexParser
public interface RegexParser
-
Method Details
-
parse
Runs the parser and produces an AST.- Throws:
RegexSyntaxException- when the pattern or the flags are not well-formedUnsupportedRegexException- when the pattern cannot be translated to an equivalent ECMAScript pattern
-
getFlags
AbstractRegexObject getFlags()Returns aTruffleObjectrepresenting 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 callingparse(). -
getNamedCaptureGroups
AbstractRegexObject getNamedCaptureGroups()Returns a map from the names of capture groups to their indices. If the regular expression had no named capture groups, returns null. This method has to be called after callingparse().
-