ArgumentHolder

This interfaces denotes that Node can accept arguments. The most famous example would be a CallExpression to populate CallExpression.arguments or the ReturnStatement.returnValue of a return statement.

We do have some use-cases where we are a little "relaxed" about what is an argument. For example, we also consider the BinaryOperator.lhs and BinaryOperator.rhs of a binary operator as arguments, so we can use node builders in the Node Fluent DSL.

Inheritors

Functions

Link copied to clipboard
abstract fun addArgument(expression: Expression)

Adds the expression to the list of arguments.

Link copied to clipboard
abstract fun hasArgument(expression: Expression): Boolean

Checks, if expression is part of the arguments.

Link copied to clipboard
open operator fun minusAssign(node: Expression)
Link copied to clipboard
open operator override fun plusAssign(node: Expression)

Adds a Node to the list of "held" nodes.

Link copied to clipboard
open fun removeArgument(expression: Expression): Boolean

Removes the expression from the list of arguments.

Link copied to clipboard
open override fun replace(old: Expression, new: Expression): Boolean

Replaces the existing node specified in old with the one in new. Implementation how to do that might be specific to the holder.

Link copied to clipboard
abstract fun replaceArgument(old: Expression, new: Expression): Boolean

Replaces the existing argument specified in old with the one in new. Implementation how to do that might be specific to the argument holder.