OperatorCallExpression

This special call expression is used when an operator (such as a BinaryOperator) is overloaded. In this case, we replace the original BinaryOperator with an OperatorCallExpression, which points to its respective OperatorDeclaration.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Additional problem nodes. These nodes represent problems which occurred during processing of a node (i.e. only partially processed).

Link copied to clipboard

Returns a list of all Nodes, starting from the current Node, which are the beginning of an EOG path created by the EvaluationOrderGraphPass. Typical examples include all top-level declarations, such as functions and variables. For a more detailed explanation, see EOGStarterHolder.

Link copied to clipboard

List of annotations associated with that node.

Link copied to clipboard
Link copied to clipboard

The list of arguments of this call expression, backed by a list of Edge objects.

Link copied to clipboard

Index of the argument if this node is used in a function call or parameter list.

Link copied to clipboard

The list of arguments as a simple list. This is a delegated property delegated to argumentEdges.

Link copied to clipboard
open override var assignedTypes: Set<Type>

This property refers to a list of Type nodes which are assigned to that Node. This could be different from the HasType.type. A common example is that a node could contain an interface as a HasType.type, but the actual implementation of the type as one of the assignedTypes. This could potentially also be empty, if we don't see any assignments to this expression.

Link copied to clipboard

Returns all Assignment child edges in this graph, starting with this Node.

Link copied to clipboard

Returns all AssignExpression child edges in this graph, starting with this Node.

Link copied to clipboard

Virtual property to return a list of the node's children. Uses the SubgraphWalker to retrieve the appropriate nodes.

Link copied to clipboard

A shortcut to return all AstEdge edges starting from this node.

Link copied to clipboard
Link copied to clipboard
open override val base: Expression?

The base object. This is basically a shortcut to accessing the base of the callee, if it has one (i.e., if it implements HasBase). This is the case for example, if it is a MemberExpression.

Link copied to clipboard

Returns all Block child edges in this graph, starting with this Node.

Link copied to clipboard

Returns all BreakStatement child edges in this graph, starting with this Node.

Link copied to clipboard
Link copied to clipboard

Returns all CallExpression children in this graph, starting with this Node.

Link copied to clipboard

Returns all CastExpression children in this graph, starting with this Node.

Link copied to clipboard
var code: String?

Original code snippet of this node. Most nodes will have a corresponding "code", but in cases where nodes are created artificially, it may be null.

Link copied to clipboard

Optional comment of this node.

Link copied to clipboard

Returns all ContinueStatement child edges in this graph, starting with this Node.

Link copied to clipboard
open override var ctx: TranslationContext?

Because we are updating type information in the properties of the node, we need a reference to managers such as the TypeManager instance which is responsible for this particular node. All managers are bundled in TranslationContext. It is set in Node.applyMetadata when a ContextProvider is provided.

Link copied to clipboard

This is a very basic implementation of Cyclomatic Complexity.

Link copied to clipboard

A shortcut to return all Dataflow edges starting from this node.

Link copied to clipboard
open override val declarations: List<Declaration>
Link copied to clipboard

Returns all DoStatement child edges in this graph, starting with this Node.

Link copied to clipboard

Returns all FieldDeclaration children in this graph, starting with this Node.

Link copied to clipboard
var file: String?

Name of the containing file. It can be null for artificially created nodes or if just analyzing snippets of code without an associated file name.

Link copied to clipboard

Returns all ForEachStatement child edges in this graph, starting with this Node.

Link copied to clipboard

Returns all ForStatement child edges in this graph, starting with this Node.

Link copied to clipboard

Returns all FunctionDeclaration children in this graph, starting with this Node.

Link copied to clipboard
var id: Long?

Required field for object graph mapping. It contains the node id.

Link copied to clipboard

Returns all IfStatement child edges in this graph, starting with this Node.

Link copied to clipboard

Returns all ImportDeclaration children in this graph, starting with this Node.

Link copied to clipboard

Connection to its FunctionDeclaration. This will be populated by the SymbolResolver. This will have an effect on the type

Link copied to clipboard

A virtual property to quickly access the list of declarations that this call invokes without property edges.

Link copied to clipboard

Specifies, whether this node is implicit, i.e. is not really existing in source code but only exists implicitly. This mostly relates to implicit casts, return statements or implicit this expressions.

Link copied to clipboard

If a node is marked as being inferred, it means that it was created artificially and does not necessarily have a real counterpart in the scanned source code. However, the nodes represented should have been part of parser output and represents missing code that is inferred by the CPG construction, e.g. missing functions, records, files etc.

Link copied to clipboard

Returns all LabelStatement child edges in this graph, starting with this Node.

Link copied to clipboard
open override var language: Language<*>?

The language of this node. This property is set in Node.applyMetadata by a LanguageProvider at the time when the node is created.

Link copied to clipboard

Returns all Literal children in this graph, starting with this Node.

Link copied to clipboard

A list of local variables (or other values) associated to this statement, defined by their ValueDeclaration extracted from Block because for, while, if, and switch can declare locals in their condition or initializers.

Link copied to clipboard

Virtual property to access localEdges without property edges.

Link copied to clipboard
open override var location: PhysicalLocation?

Location of the finding in source code.

Link copied to clipboard

Returns all MemberCallExpression children in this graph, starting with this Node.

Link copied to clipboard

Returns all MemberExpression children in this graph, starting with this Node.

Link copied to clipboard

Returns all MethodDeclaration children in this graph, starting with this Node.

Link copied to clipboard
open override var name: Name

The Name of this call expression, based on its callee.

Link copied to clipboard

Returns all RecordDeclaration children in this graph, starting with this Node.

Link copied to clipboard
Link copied to clipboard

The nodes which are control-flow dominated, i.e., the children of the Control Dependence Graph (CDG).

Link copied to clipboard

Virtual property for accessing nextDFGEdges without property edges.

Link copied to clipboard

Outgoing data flow edges

Link copied to clipboard

Virtual property for accessing nextEOGEdges without property edges.

Link copied to clipboard

Outgoing control flow edges.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Outgoing Program Dependence Edges.

Link copied to clipboard

Returns all Node children in this graph, starting with this Node.

Link copied to clipboard
open override val operatorArguments: List<Expression>

Arguments forwarded to the operator. This might not necessarily be all of the regular "arguments", since often the the first argument is part of the operatorBase.

Link copied to clipboard
open override val operatorBase: Expression

Some languages allow to even overload "()", meaning that basically a normal call to callee is overloaded. In this case we want the operatorBase to point to callee, so we can take its type to lookup the necessary OperatorDeclaration.

Link copied to clipboard

Returns all OperatorCallExpression children in this graph, starting with this Node.

Link copied to clipboard
open override var operatorCode: String?

The operator code, identifying an operation executed on one or more Expressions

Link copied to clipboard

Returns all OperatorDeclaration children in this graph, starting with this Node.

Link copied to clipboard

Returns all ParameterDeclaration children in this graph, starting with this Node.

Link copied to clipboard
Link copied to clipboard

The nodes which dominate this node via the control-flow, i.e., the parents of the Control Dependence Graph (CDG).

Link copied to clipboard

Virtual property for accessing prevDFGEdges without property edges.

Link copied to clipboard

Incoming data flow edges

Link copied to clipboard

Virtual property for accessing prevEOGEdges without property edges.

Link copied to clipboard

Incoming control flow edges.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Incoming Program Dependence Edges.

Link copied to clipboard

Return all ProblemNode children in this graph (either stored directly or in Node.additionalProblems), starting with this Node.

Link copied to clipboard

Returns all RecordDeclaration children in this graph, starting with this Node.

Link copied to clipboard

Returns all Reference children in this graph, starting with this Node.

Link copied to clipboard

Returns all ReturnStatement child edges in this graph, starting with this Node.

Link copied to clipboard
open override var scope: Scope?

The scope this node "lives" in / in which it is defined. This property is set in Node.applyMetadata by a ScopeProvider at the time when the node is created.

Link copied to clipboard

The list of argument types (aka the signature).

Link copied to clipboard

Returns all Statement child edges in this graph, starting with this Node.

Link copied to clipboard

Returns all SwitchStatement child edges in this graph, starting with this Node.

Link copied to clipboard

Specifies, whether this call has any template arguments.

Link copied to clipboard

If the CallExpression instantiates a template, the call can provide template arguments.

Link copied to clipboard
Link copied to clipboard

If the CallExpression instantiates a Template the CallExpression is connected to the template which is instantiated. This is required by the expansion pass to access the Template directly. The invokes edge will still point to the realization of the template.

Link copied to clipboard

Returns all ThrowExpression child edges in this graph, starting with this Node.

Link copied to clipboard

Returns the TranslationUnitDeclaration where this node is located in.

Link copied to clipboard

Returns all TryStatement child edges in this graph, starting with this Node.

Link copied to clipboard
open override var type: Type

This property refers to the definite Type that the Node has. If you are unsure about what it's type is, you should prefer to set it to the UnknownType. It is usually one of the following:

Link copied to clipboard

A list of TypeObserver objects that will be informed about type changes, usually by informObservers.

Link copied to clipboard

Returns all VariableDeclaration children in this graph, starting with this Node.

Link copied to clipboard

Returns all WhileStatement child edges in this graph, starting with this Node.

Functions

Link copied to clipboard
open fun accept(strategy: IStrategy<Node>, visitor: IVisitor<Node>)
Link copied to clipboard
open override fun addArgument(expression: Expression)

Adds the expression to the list of arguments.

fun addArgument(expression: Expression, name: String? = null)

Adds the specified expression with an optional name to this call.

Link copied to clipboard
open fun addAssignedType(type: Type)

Adds type to the list of HasType.assignedTypes and informs all observers about the change.

Link copied to clipboard
open fun addAssignedTypes(types: Set<Type>)

Adds all types to the list of HasType.assignedTypes and informs all observers about the change.

Link copied to clipboard
open override fun addDeclaration(declaration: Declaration)

Adds the specified declaration to this declaration holder. Ideally, the declaration holder should use the addIfNotContains method to consistently add declarations.

Link copied to clipboard
open fun <T : Node, P : AstEdge<T>> addIfNotContains(collection: AstEdges<T, P>, declaration: T)
open fun <T : Node, P : Edge<T>> addIfNotContains(collection: EdgeList<T, P>, declaration: T)
open fun <T : Declaration> addIfNotContains(collection: MutableCollection<T>, declaration: T)

open fun <T : Node, P : Edge<T>> addIfNotContains(collection: EdgeList<T, out P>, declaration: T, outgoing: Boolean)

Adds a declaration to a collection of property edges, which contain the declarations

Link copied to clipboard
fun addTemplateParameter(templateParam: Node, templateInitialization: TemplateDeclaration.TemplateInitialization? = TemplateInitialization.EXPLICIT)

Adds a template parameter to this call expression. A parameter can either be an Expression (usually a Literal) or a Type.

Link copied to clipboard
inline fun <T> Node?.allChildren(noinline predicate: (T) -> Boolean? = null): List<T>

Flattens the AST beginning with this node and returns all nodes of type T. For convenience, an optional predicate function predicate can be supplied, which will be applied via Collection.filter

Link copied to clipboard
inline fun <EdgeType : Edge<out Node>> Node.allEdges(noinline predicate: (EdgeType) -> Boolean = { true }): Collection<EdgeType>

This function returns a subgraph containing all Edges starting from this Node that are of the specific EdgeType. Optionally, a predicate can be used to filter the edges even further.

Link copied to clipboard
fun Node.applyMetadata(provider: MetadataProvider?, name: CharSequence? = EMPTY_NAME, rawNode: Any? = null, localNameOnly: Boolean = false, defaultNamespace: Name? = null)

Applies various metadata on this Node, based on the kind of provider in provider. This can include:

Link copied to clipboard

Creates a new AssignExpression with a = AssignExpression.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Creates a new BinaryOperator with a = BinaryOperator.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard

Creates a new AssignExpression with a = AssignExpression.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard
open override fun assignedTypeChanged(assignedTypes: Set<Type>, src: HasType)

This callback function will be invoked, if the observed node changes its HasType.assignedTypes.

Link copied to clipboard

Creates a new AssignExpression with a += AssignExpression.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard
@JvmName(name = "astNodes")
fun Node.ast(): List<Node>
Link copied to clipboard

Creates a single AstEdge starting from this node (wrapped in a EdgeSingletonList container).

Link copied to clipboard
fun <NodeType : Node> Node.astEdgesOf(onAdd: (AstEdge<NodeType>) -> Unit? = null, onRemove: (AstEdge<NodeType>) -> Unit? = null): AstEdges<NodeType, AstEdge<NodeType>>

Creates an AstEdges container starting from this node.

Link copied to clipboard

Creates a single optional AstEdge starting from this node (wrapped in a EdgeSingletonList container).

Link copied to clipboard
Link copied to clipboard
fun Node.collectAllNextCDGPaths(interproceduralAnalysis: Boolean): List<List<Node>>

Iterates the next CDG edges until there are no more edges available (or until a loop is detected). Returns a list of possible paths (each path is represented by a list of nodes).

Link copied to clipboard

Iterates the next EOG edges until there are no more edges available (or until a loop is detected). Returns a list of possible paths (each path is represented by a list of nodes).

Link copied to clipboard

Iterates the next full DFG edges until there are no more edges available (or until a loop is detected). Returns a list of possible paths (each path is represented by a list of nodes).

Link copied to clipboard

Iterates the next PDG edges until there are no more edges available (or until a loop is detected). Returns a list of possible paths (each path is represented by a list of nodes).

Link copied to clipboard
fun Node.collectAllPrevCDGPaths(interproceduralAnalysis: Boolean): List<List<Node>>

Iterates the prev CDG edges until there are no more edges available (or until a loop is detected). Returns a list of possible paths (each path is represented by a list of nodes).

Link copied to clipboard
fun Node.collectAllPrevEOGPaths(interproceduralAnalysis: Boolean): List<List<Node>>

Iterates the prev PDG edges until there are no more edges available (or until a loop is detected). Returns a list of possible paths (each path is represented by a list of nodes).

Link copied to clipboard

Iterates the prev full DFG edges until there are no more edges available (or until a loop is detected). Returns a list of possible paths (each path is represented by a list of nodes).

Link copied to clipboard
fun Node.collectAllPrevPDGPaths(interproceduralAnalysis: Boolean): List<List<Node>>

Iterates the prev PDG edges until there are no more edges available (or until a loop is detected). Returns a list of possible paths (each path is represented by a list of nodes).

Link copied to clipboard
fun Expression.conditional(condition: Expression, thenExpression: Expression, elseExpression: Expression): ConditionalExpression

Creates a new ConditionalExpression with a = BinaryOperator.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard

All nodes which depend on this if statement

Link copied to clipboard
operator fun Expression.dec(): UnaryOperator

Creates a new UnaryOperator with a -- UnaryOperator.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard
inline fun <T : Node> Node.dfgFrom(): List<T>
Link copied to clipboard

If a node should be removed from the graph, just removing it from the AST is not enough (see issue #60). It will most probably be referenced somewhere via DFG or EOG edges. Thus, if it needs to be disconnected completely, we will have to take care of correctly disconnecting these implicit edges.

Link copied to clipboard

Creates a new BinaryOperator with a / BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard
inline fun <EdgeType : Edge<out Node>> Node.edges(noinline predicate: (EdgeType) -> Boolean = { true }): Collection<EdgeType>

Returns all Edges of EdgeType directly attached to this Node. Optionally, a predicate can be used to filter the edges even further.

Link copied to clipboard

Creates a new BinaryOperator with a == BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

A helper function that can be used for EdgeSingletonList.onChanged. It unregisters this TypeObserver with the old node and registers it with the new one.

Link copied to clipboard
fun Node.firstParentOrNull(predicate: (Node) -> Boolean): Node?

This function tries to find the first parent node that satisfies the condition specified in predicate. It starts searching in the searchNode, moving up-wards using the Node.astParent attribute.

Link copied to clipboard
fun Node.followNextCDGUntilHit(collectFailedPaths: Boolean = true, findAllPossiblePaths: Boolean = true, interproceduralAnalysis: Boolean = false, predicate: (Node) -> Boolean): FulfilledAndFailedPaths

Returns an instance of FulfilledAndFailedPaths where FulfilledAndFailedPaths.fulfilled contains all possible shortest data flow paths (with ControlDependence) between the starting node this and the end node fulfilling predicate. The paths are represented as lists of nodes. Paths which do not end at such a node are included in FulfilledAndFailedPaths.failed.

Link copied to clipboard
fun Node.followNextEOG(predicate: (Edge<*>) -> Boolean): List<Edge<*>>?

Returns a list of edges which are from the evaluation order between the starting node this and an edge fulfilling predicate. If the return value is not null, a path from this to such an edge is possible but not mandatory.

Link copied to clipboard
fun Node.followNextEOGEdgesUntilHit(collectFailedPaths: Boolean = true, findAllPossiblePaths: Boolean = true, predicate: (Node) -> Boolean): FulfilledAndFailedPaths

Returns an instance of FulfilledAndFailedPaths where FulfilledAndFailedPaths.fulfilled contains all possible shortest evaluation paths between the starting node this and the end node fulfilling predicate. The paths are represented as lists of nodes. Paths which do not end at such a node are included in FulfilledAndFailedPaths.failed.

Link copied to clipboard
fun Node.followNextFullDFGEdgesUntilHit(collectFailedPaths: Boolean = true, findAllPossiblePaths: Boolean = true, predicate: (Node) -> Boolean): FulfilledAndFailedPaths

Returns an instance of FulfilledAndFailedPaths where FulfilledAndFailedPaths.fulfilled contains all possible shortest data flow paths (with FullDataflowGranularity) between the starting node this and the end node fulfilling predicate. The paths are represented as lists of nodes. Paths which do not end at such a node are included in FulfilledAndFailedPaths.failed.

Link copied to clipboard
fun Node.followNextPDGUntilHit(collectFailedPaths: Boolean = true, findAllPossiblePaths: Boolean = true, interproceduralAnalysis: Boolean = false, predicate: (Node) -> Boolean): FulfilledAndFailedPaths

Returns an instance of FulfilledAndFailedPaths where FulfilledAndFailedPaths.fulfilled contains all possible shortest data flow paths (with ProgramDependences) between the starting node this and the end node fulfilling predicate. The paths are represented as lists of nodes. Paths which do not end at such a node are included in FulfilledAndFailedPaths.failed.

Link copied to clipboard
fun Node.followPrevCDGUntilHit(collectFailedPaths: Boolean = true, findAllPossiblePaths: Boolean = true, interproceduralAnalysis: Boolean = false, predicate: (Node) -> Boolean): FulfilledAndFailedPaths

Returns an instance of FulfilledAndFailedPaths where FulfilledAndFailedPaths.fulfilled contains all possible shortest data flow paths (with ControlDependence) between the starting node this and the end node fulfilling predicate (backwards analysis). The paths are represented as lists of nodes. Paths which do not end at such a node are included in FulfilledAndFailedPaths.failed.

Link copied to clipboard
fun Node.followPrevEOG(predicate: (Edge<*>) -> Boolean): List<Edge<*>>?

Returns a list of edges which are from the evaluation order between the starting node this and an edge fulfilling predicate. If the return value is not null, a path from this to such an edge is possible but not mandatory.

Link copied to clipboard
fun Node.followPrevEOGEdgesUntilHit(collectFailedPaths: Boolean = true, findAllPossiblePaths: Boolean = true, predicate: (Node) -> Boolean): FulfilledAndFailedPaths

Returns an instance of FulfilledAndFailedPaths where FulfilledAndFailedPaths.fulfilled contains all possible shortest evaluation paths between the end node this and the start node fulfilling predicate. The paths are represented as lists of nodes. Paths which do not end at such a node are included in FulfilledAndFailedPaths.failed.

Link copied to clipboard

Returns a list of nodes which are a data flow path (with FullDataflowGranularity) between the starting node this and the end node fulfilling predicate. If the return value is not null, a data flow from this to such a node is possible but not mandatory.

Link copied to clipboard
fun Node.followPrevFullDFGEdgesUntilHit(collectFailedPaths: Boolean = true, findAllPossiblePaths: Boolean = true, predicate: (Node) -> Boolean): FulfilledAndFailedPaths

Returns an instance of FulfilledAndFailedPaths where FulfilledAndFailedPaths.fulfilled contains all possible shortest data flow paths (with FullDataflowGranularity) between the end node this and the starting node fulfilling predicate. The paths are represented as lists of nodes. Paths which do not end at such a node are included in FulfilledAndFailedPaths.failed.

Link copied to clipboard
fun Node.followPrevPDGUntilHit(collectFailedPaths: Boolean = true, findAllPossiblePaths: Boolean = true, interproceduralAnalysis: Boolean = false, predicate: (Node) -> Boolean): FulfilledAndFailedPaths

Returns an instance of FulfilledAndFailedPaths where FulfilledAndFailedPaths.fulfilled contains all possible shortest data flow paths (with ProgramDependences) between the starting node this and the end node fulfilling predicate (backwards analysis). The paths are represented as lists of nodes. Paths which do not end at such a node are included in FulfilledAndFailedPaths.failed.

Link copied to clipboard
fun Node.followXUntilHit(x: (Node) -> List<Node>, collectFailedPaths: Boolean = true, findAllPossiblePaths: Boolean = true, predicate: (Node) -> Boolean): FulfilledAndFailedPaths

Returns an instance of FulfilledAndFailedPaths where FulfilledAndFailedPaths.fulfilled contains all possible shortest data flow paths (with x specifying how to fetch more nodes) between the starting node this and the end node fulfilling predicate (backwards analysis). The paths are represented as lists of nodes. Paths which do not end at such a node are included in FulfilledAndFailedPaths.failed.

Link copied to clipboard

Creates a new BinaryOperator with a >= BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Creates a new BinaryOperator with a > BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

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

Checks, if expression is part of the arguments.

Link copied to clipboard
open override fun hashCode(): Int

Implementation of hash code. We are including the name and the location in this hash code as a compromise between including too few attributes and performance. Please note that this means, that two nodes that might be semantically equal, such as two record declarations with the same name but different location (e.g. because of header files) will be sorted into different hash keys.

Link copied to clipboard
operator fun Expression.inc(): UnaryOperator

Creates a new UnaryOperator with a ++ UnaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Creates a new UnaryOperator with a ++ UnaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard
Link copied to clipboard

This function SHOULD be used be an implementing class to inform observers about type changes. While the implementing class can technically do this on its own, it is strongly recommended to use this function to harmonize the behaviour of propagating types.

Link copied to clipboard
Link copied to clipboard
operator fun <N : Expression> Expression?.invoke(): N?
Link copied to clipboard

Checks, whether the given Type is a primitive in the language specified in the LanguageProvider.

Link copied to clipboard

Creates a new BinaryOperator with a <= BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

This utility function tries to create a fake PhysicalLocation in order to somewhat differentiate the different nodes. This is primarily needed for the mermaid graph printer, which relies on Node.hashCode, which in turn relies on Node.location.

Link copied to clipboard

Creates a new BinaryOperator with a < BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Creates a new BinaryOperator with a - BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

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

Creates a new Annotation. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new AnnotationMember. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new AssertStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newAssignExpression(operatorCode: String = "=", lhs: List<Expression> = listOf(), rhs: List<Expression> = listOf(), rawNode: Any? = null): AssignExpression

Creates a new AssignExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new BinaryOperator or a ShortCircuitOperator if the language implements HasShortCircuitOperators and if the operatorCode is contained in HasShortCircuitOperators.operatorCodes. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new Block. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new BreakStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newCallExpression(callee: Expression? = null, fqn: CharSequence? = null, template: Boolean = false, rawNode: Any? = null): CallExpression

Creates a new CallExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new CaseStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new CastExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new CatchClause. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newConditionalExpression(condition: Expression, thenExpression: Expression? = null, elseExpression: Expression? = null, type: Type = unknownType(), rawNode: Any? = null): ConditionalExpression

Creates a new ConditionalExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ConstructExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ConstructorDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ContinueStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new DeclarationStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new DefaultStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new DeleteExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new DistinctLanguageBlock. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new DoStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new EmptyStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new EnumConstantDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new EnumDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ExpressionList. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newFieldDeclaration(name: CharSequence?, type: Type = unknownType(), modifiers: List<String>? = listOf(), initializer: Expression? = null, implicitInitializerAllowed: Boolean = false, rawNode: Any? = null): FieldDeclaration

Creates a new FieldDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ForEachStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ForStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newFunctionDeclaration(name: CharSequence?, localNameOnly: Boolean = false, rawNode: Any? = null): FunctionDeclaration

Creates a new FunctionDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new FunctionTemplateDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new GotoStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new IfStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newImportDeclaration(import: Name, wildcardImport: Boolean = false, alias: Name? = null, rawNode: Any? = null): ImportDeclaration

Creates a new ImportDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new IncludeDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new InitializerListExpression. This is the top-most Node that a LanguageFrontend or Handler should create. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new KeyValueExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new LabelStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new LambdaExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new LookupScopeStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new MemberCallExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newMemberExpression(name: CharSequence?, base: Expression, memberType: Type = unknownType(), operatorCode: String? = ".", rawNode: Any? = null): MemberExpression

Creates a new MemberExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newMethodDeclaration(name: CharSequence?, isStatic: Boolean = false, recordDeclaration: RecordDeclaration? = null, rawNode: Any? = null): MethodDeclaration

Creates a new MethodDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun LanguageProvider.newName(name: CharSequence, localNameOnly: Boolean = false, namespace: Name? = null): Name

Generates a Name object from the given name. If localNameOnly is set, only the localName is used, otherwise the namespace is added to generate a fqn if the name is not a fqn anyway.

Link copied to clipboard

Creates a new NamespaceDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new NewArrayExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newNewExpression(type: Type = unknownType(), rawNode: Any? = null): NewExpression

Creates a new NewExpression. This is the top-most Node that a LanguageFrontend or Handler should create. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new MemberCallExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newOperatorDeclaration(name: CharSequence, operatorCode: String, recordDeclaration: RecordDeclaration? = null, rawNode: Any? = null): OperatorDeclaration

Creates a new OperatorDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newParameterDeclaration(name: CharSequence?, type: Type = unknownType(), variadic: Boolean = false, rawNode: Any? = null): ParameterDeclaration

Creates a new ParameterDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newProblemDeclaration(problem: String = "", problemType: ProblemNode.ProblemType = ProblemNode.ProblemType.PARSING, rawNode: Any? = null): ProblemDeclaration

Creates a new ProblemDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newProblemExpression(problem: String = "", type: ProblemNode.ProblemType = ProblemNode.ProblemType.PARSING, rawNode: Any? = null): ProblemExpression

Creates a new ProblemExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
Link copied to clipboard
fun MetadataProvider.newRangeExpression(floor: Expression? = null, ceiling: Expression? = null, rawNode: Any? = null): RangeExpression

Creates a new RangeExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new RecordDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new RecordTemplateDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newReference(name: CharSequence?, type: Type = unknownType(), rawNode: Any? = null): Reference

Creates a new Reference. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ReturnStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new SubscriptExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new SwitchStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new SynchronizedStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ThrowExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new TranslationUnitDeclaration. This is the top-most Node that a LanguageFrontend or Handler should create. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new TryStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new TupleDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new TypedefDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newTypeExpression(name: CharSequence?, type: Type = unknownType(), rawNode: Any? = null): TypeExpression

Creates a new TypeExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newTypeIdExpression(operatorCode: String, type: Type = unknownType(), referencedType: Type = unknownType(), rawNode: Any? = null): TypeIdExpression

Creates a new TypeIdExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new TypeParameterDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newUnaryOperator(operatorCode: String, postfix: Boolean, prefix: Boolean, rawNode: Any? = null): UnaryOperator

Creates a new UnaryOperator. This is the top-most Node that a LanguageFrontend or Handler should create. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newVariableDeclaration(name: CharSequence?, type: Type = unknownType(), implicitInitializerAllowed: Boolean = false, rawNode: Any? = null): VariableDeclaration

Creates a new VariableDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new WhileStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

The "object identifier" of a node can be used to differentiate different "objects" that a node (most likely a Reference) refers to.

Link copied to clipboard
fun LanguageProvider.objectType(name: CharSequence, generics: List<Type> = listOf(), rawNode: Any? = null): Type

This function returns an ObjectType with the given name. If a respective Type does not yet exist (in the current scope), it will be created. In order to avoid unnecessary allocation of simple types, we do a pre-check within this function, whether a built-in type exist with the particular name.

Link copied to clipboard

A small utility extension function that uses the language information in a LanguageProvider (such as a Node, a Language, a LanguageFrontend or a Handler) to parse a fully qualified name.

Link copied to clipboard

Creates a new BinaryOperator with a + BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

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

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

Link copied to clipboard
operator fun Expression.plusAssign(rhs: Expression)

Creates a new BinaryOperator with a + BinaryOperator.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard

This function constructs a new primitive Type. Primitive or built-in types are defined in Language.builtInTypes. This function will look up the type by its name, if it fails to find an appropriate build-in type, a TranslationException is thrown. Therefore, this function should primarily be called by language frontends if they are sure that this type is a built-in type, e.g., when constructing literals. It can be useful, if frontends want to check, whether all literal types are correctly registered as built-in types.

Link copied to clipboard
fun Node.printDFG(maxConnections: Int = 25): String

Utility function to print the DFG using printGraph.

Link copied to clipboard
fun <T : Edge<Node>> Node.printGraph(nextEdgeGetter: KProperty1<Node, MutableCollection<T>>, prevEdgeGetter: KProperty1<Node, MutableCollection<T>>, maxConnections: Int = 25): String

This function prints a partial graph, limited to a particular set of edges, starting with the current Node as Markdown, with an embedded Mermaid graph. The output can either be pasted into a Markdown document (and then rendered) or directly pasted into GitHub issues, discussions or pull requests (see https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/).

Link copied to clipboard

Registers the given typeObservers to be informed about type updates. This also immediately invokes both TypeObserver.typeChanged and TypeObserver.assignedTypeChanged.

Link copied to clipboard

Creates a new BinaryOperator with a + BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard
open override 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
open override 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.

Link copied to clipboard
fun setArgument(index: Int, argument: Expression)
Link copied to clipboard

Returns a new Inference object starting from this node. This will check, whether inference is enabled at all (using InferenceConfiguration.enabled). Otherwise null, will be returned.

Link copied to clipboard

Creates a new ThrowExpression in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard

Creates a new BinaryOperator with a * BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun typeChanged(newType: Type, src: HasType)

This callback function will be invoked, if the observed node changes its HasType.type.

Link copied to clipboard

Creates a new UnaryOperator with a - UnaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Creates a new UnknownType and sets the appropriate language, if this MetadataProvider includes a LanguageProvider.

Link copied to clipboard

Unregisters the given typeObservers from the list of observers.

Link copied to clipboard

This is a small utility function to "unwrap" a Reference that it is wrapped in (multiple) Expression nodes. This will only work on expression that only have one "argument" (such as a unary operator), in order to avoid ambiguous results. This can be useful for data-flow analysis, if you want to quickly retrieve the reference that is affected by an operation. For example in C++ it is common to take an address of a variable and cast it into an appropriate type:

Link copied to clipboard
fun updateTemplateParameters(initializationType: Map<Node?, TemplateDeclaration.TemplateInitialization?>, orderedInitializationSignature: List<Node>)