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()
null
public 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.Env
env) {Source
multiply =Source
.newBuilder("js", "a * b", "mul.js").build();CallTarget
method = env.parsePublic(multiply, "a", "b");Number
fortyTwo = (Number
) method.call(6, 7); assert 42 == fortyTwo.intValue();Number
ten = (Number
) method.call(2, 5); assert 10 == ten.intValue(); }
CallTarget.call(java.lang.Object...)