public static final class TruffleLanguage.ParsingRequest extends Object
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getArgumentNames()
Argument names.
|
Source |
getSource()
The source code to parse.
|
public Source getSource()
nullpublic List<String> getArgumentNames()
parsing is an
instance of CallTarget that can be
invoked without or with some parameters. If the invocation requires some arguments, and
the TruffleLanguage.ParsingRequest.getSource() references them, it is essential to name them. Example that uses
the argument names:
public void parseWithParams(TruffleLanguage.Envenv) {Sourcemultiply =Source.newBuilder("js", "a * b", "mul.js").build();CallTargetmethod = env.parsePublic(multiply, "a", "b");NumberfortyTwo = (Number) method.call(6, 7); assert 42 == fortyTwo.intValue();Numberten = (Number) method.call(2, 5); assert 10 == ten.intValue(); }
CallTarget.call(java.lang.Object...)