Class JavaRegexParser
java.lang.Object
com.oracle.truffle.regex.tregex.parser.flavors.java.JavaRegexParser
- All Implemented Interfaces:
RegexParser
-
Constructor Summary
ConstructorsConstructorDescriptionJavaRegexParser(RegexSource source, RegexASTBuilder astBuilder, CompilationBuffer compilationBuffer) -
Method Summary
Modifier and TypeMethodDescriptionstatic RegexParsercreateParser(RegexLanguage language, RegexSource source, CompilationBuffer compilationBuffer) getFlags()Returns aTruffleObjectrepresenting the compilation flags which were set for the regular expression.Returns a map from the names of capture groups to their indices.parse()Runs the parser and produces an AST.
-
Constructor Details
-
JavaRegexParser
public JavaRegexParser(RegexSource source, RegexASTBuilder astBuilder, CompilationBuffer compilationBuffer) throws RegexSyntaxException - Throws:
RegexSyntaxException
-
-
Method Details
-
createParser
public static RegexParser createParser(RegexLanguage language, RegexSource source, CompilationBuffer compilationBuffer) throws RegexSyntaxException - Throws:
RegexSyntaxException
-
parse
Description copied from interface:RegexParserRuns the parser and produces an AST.- Specified by:
parsein interfaceRegexParser
-
getFlags
Description copied from interface:RegexParserReturns 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 callingRegexParser.parse().- Specified by:
getFlagsin interfaceRegexParser
-
getNamedCaptureGroups
Description copied from interface:RegexParserReturns 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 callingRegexParser.parse().- Specified by:
getNamedCaptureGroupsin interfaceRegexParser
-