public class ForeignRegexCompiler extends Object implements RegexCompiler
ForeignRegexCompiler wraps a TruffleObject that is compatible with
RegexCompiler and lets us use it as if it were an actual RegexCompiler.| Constructor and Description |
|---|
ForeignRegexCompiler(com.oracle.truffle.api.interop.TruffleObject foreignCompiler) |
| Modifier and Type | Method and Description |
|---|---|
com.oracle.truffle.api.interop.TruffleObject |
compile(RegexSource source)
Uses the compiler to try and compile the regular expression described in
source. |
static RegexCompiler |
importRegexCompiler(com.oracle.truffle.api.interop.TruffleObject regexCompiler)
|
public ForeignRegexCompiler(com.oracle.truffle.api.interop.TruffleObject foreignCompiler)
public static RegexCompiler importRegexCompiler(com.oracle.truffle.api.interop.TruffleObject regexCompiler)
TruffleObject in a ForeignRegexCompiler, unless it already
is a RegexCompiler. Use this when accepting RegexCompilers over Truffle
interop.public com.oracle.truffle.api.interop.TruffleObject compile(RegexSource source) throws RegexSyntaxException, UnsupportedRegexException
RegexCompilersource.compile in interface RegexCompilerCompiledRegexObject or a TruffleObject compatible to
RegexObjectRegexSyntaxException - if the engine discovers a syntax error in the regular expressionUnsupportedRegexException - if the regular expression is not supported by the engine