Search in sources :

Example 1 with SLInvokeNode

use of com.oracle.truffle.sl.nodes.call.SLInvokeNode in project graal by oracle.

the class SLNodeFactory method createCall.

/**
 * Returns an {@link SLInvokeNode} for the given parameters.
 *
 * @param functionNode The function being called
 * @param parameterNodes The parameters of the function call
 * @param finalToken A token used to determine the end of the sourceSelection for this call
 * @return An SLInvokeNode for the given parameters. null if functionNode or any of the
 *         parameterNodes are null.
 */
public SLExpressionNode createCall(SLExpressionNode functionNode, List<SLExpressionNode> parameterNodes, Token finalToken) {
    if (functionNode == null || containsNull(parameterNodes)) {
        return null;
    }
    final SLExpressionNode result = new SLInvokeNode(functionNode, parameterNodes.toArray(new SLExpressionNode[parameterNodes.size()]));
    final int startPos = functionNode.getSourceCharIndex();
    final int endPos = finalToken.charPos + finalToken.val.length();
    result.setSourceSection(startPos, endPos - startPos);
    return result;
}
Also used : SLExpressionNode(com.oracle.truffle.sl.nodes.SLExpressionNode) SLInvokeNode(com.oracle.truffle.sl.nodes.call.SLInvokeNode)

Aggregations

SLExpressionNode (com.oracle.truffle.sl.nodes.SLExpressionNode)1 SLInvokeNode (com.oracle.truffle.sl.nodes.call.SLInvokeNode)1