ProblemDeclaration

class ProblemDeclaration(var problem: String = "", var type: ProblemNode.ProblemType = ProblemNode.ProblemType.TRANSLATION) : ValueDeclaration, ProblemNode

A node where the statement could not be translated by the graph. We use ProblemExpressions whenever the CPG library requires an Declaration.

Constructors

Link copied to clipboard
fun ProblemDeclaration(problem: String = "", type: ProblemNode.ProblemType = ProblemNode.ProblemType.TRANSLATION)

Functions

Link copied to clipboard
open fun accept(strategy: IStrategy<Node>, visitor: IVisitor<Node>)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun addNextDFG(next: Node)
Link copied to clipboard
fun addNextEOG(propertyEdge: PropertyEdge<Node>)
Link copied to clipboard
fun addPrevDFG(prev: Node)
Link copied to clipboard
fun addPrevEOG(propertyEdge: PropertyEdge<Node>)
Link copied to clipboard
Link copied to clipboard

Adds a usage of the variable/field and assembles the access property.

Link copied to clipboard

Adds the usage of the variable/field.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun getPossibleSubTypes(): MutableList<Type>
Link copied to clipboard
open override fun getPropagationType(): Type
Link copied to clipboard
open override fun getType(): Type
Link copied to clipboard

All usages of the variable/field with the access value.

Link copied to clipboard

All usages of the variable/field.

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
open override fun refreshType()
Link copied to clipboard
open override fun registerTypeListener(listener: HasType.TypeListener)
Link copied to clipboard
fun removeNextDFG(next: Node?)
Link copied to clipboard
fun removePrevDFG(prev: Node?)
Link copied to clipboard
Link copied to clipboard
open override fun resetTypes(type: Type)

Used to set the type and clear the possible subtypes list for when a type is more precise than the current.

Link copied to clipboard
open fun setPossibleSubTypes(possibleSubTypes: MutableList<Type>)

open override fun setPossibleSubTypes(possibleSubTypes: MutableList<Type>, @NotNull root: @NotNull MutableList<HasType>)

Set the node's possible subtypes. Listener circle detection works the same way as with setType

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

open override fun setType(type: Type, root: MutableList<HasType>)

Set the node's type. This may start a chain of type listener notifications

Link copied to clipboard

Set all usages of the variable/field.

Link copied to clipboard

Set all usages of the variable/field and assembles the access properties.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun unregisterTypeListener(listener: HasType.TypeListener)
Link copied to clipboard
open override fun updatePossibleSubtypes(types: MutableList<Type>)
Link copied to clipboard
open override fun updateType(type: Type)

Sideeffect free type modification WARNING: This should only be used by the TypeSystem Pass

Properties

Link copied to clipboard

List of annotations associated with that node.

Link copied to clipboard

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

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
var code: String? = null

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
var comment: String? = null

Optional comment of this node.

Link copied to clipboard
var file: String? = null

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
var id: Long? = null

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

Link copied to clipboard
var isImplicit: Boolean = false

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
var isInferred: Boolean = false

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
open override var language: Language<out LanguageFrontend>? = null

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

Location of the finding in source code.

Link copied to clipboard
open var name: Name

This property holds the full name using our new Name class. It is currently not persisted in the graph database.

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

Virtual property for accessing prevEOGEdges without property edges.

Link copied to clipboard

Incoming control flow edges.

Link copied to clipboard
open override var problem: String

A short description of the issue.

Link copied to clipboard
open override var scope: Scope? = null

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
open override var type: ProblemNode.ProblemType

The type of the problem: Either the statement could not be parsed or the kind of statement is not handled by the CPG yet. See ProblemType

Link copied to clipboard

Extensions

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
fun Node.applyMetadata(provider: MetadataProvider?, name: CharSequence? = EMPTY_NAME, rawNode: Any? = null, codeOverride: String? = 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
@JvmName(name = "astNodes")
fun Node.ast(): List<Node>
inline fun <T : Node> Node.ast(): List<T>
Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

All nodes which depend on this if statement

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

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

Link copied to clipboard

Returns an instance of FulfilledAndFailedPaths where FulfilledAndFailedPaths.fulfilled contains all possible shortest data flow 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.followNextEOG(predicate: (PropertyEdge<*>) -> Boolean): List<PropertyEdge<*>>?

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

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.followPrevDFG(predicate: (Node) -> Boolean): MutableList<Node>?

Returns a list of nodes which are a data flow path 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

Returns an instance of FulfilledAndFailedPaths where FulfilledAndFailedPaths.fulfilled contains all possible shortest data flow paths 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.followPrevEOG(predicate: (PropertyEdge<*>) -> Boolean): List<PropertyEdge<*>>?

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

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 all FunctionDeclaration children in this graph, starting with this Node.

Link copied to clipboard

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

Link copied to clipboard

Returns all MemberCallExpression 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
fun MetadataProvider.newAnnotation(name: CharSequence?, code: String? = null, rawNode: Any? = null): Annotation

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 ArrayCreationExpression. 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 ArrayRangeExpression. 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 ArraySubscriptionExpression. 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 ASMDeclarationStatement. 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.newBinaryOperator(operatorCode: String, code: String? = null, rawNode: Any? = null): BinaryOperator

Creates a new BinaryOperator. 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, code: String? = 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
fun MetadataProvider.newCatchClause(code: String? = null, rawNode: Any? = null): CatchClause

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

Creates a new ClassTemplateDeclaration. 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 CompoundStatement. 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 CompoundStatementExpression. 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, thenExpr: Expression?, elseExpr: Expression?, type: Type? = UnknownType.getUnknownType(), code: String? = null, 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
fun MetadataProvider.newConstructExpression(name: CharSequence? = EMPTY_NAME, code: String? = null, rawNode: Any? = null): ConstructExpression

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
fun MetadataProvider.newDeclaredReferenceExpression(name: CharSequence?, type: Type? = UnknownType.getUnknownType(), code: String? = null, rawNode: Any? = null): DeclaredReferenceExpression

Creates a new DeclaredReferenceExpression. 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 DesignatedInitializerExpression. 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.newDoStatement(code: String? = null, rawNode: Any? = null): DoStatement

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 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 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.getUnknownType(), modifiers: List<String>? = listOf(), code: String? = null, location: PhysicalLocation? = null, 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
fun MetadataProvider.newForStatement(code: String? = null, rawNode: Any? = null): ForStatement

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

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
fun MetadataProvider.newIfStatement(code: String? = null, rawNode: Any? = null): IfStatement

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.newIncludeDeclaration(includeFilename: CharSequence, code: String? = null, rawNode: Any? = null): IncludeDeclaration

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
fun MetadataProvider.newKeyValueExpression(key: Expression? = null, value: Expression? = null, code: String? = null, rawNode: Any? = null): KeyValueExpression

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
fun <T> MetadataProvider.newLiteral(value: T, type: Type? = UnknownType.getUnknownType(), code: String? = null, rawNode: Any? = null): Literal<T>

Creates a new Literal. 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.newMemberCallExpression(callee: Expression?, isStatic: Boolean = false, code: String? = null, rawNode: Any? = null): MemberCallExpression

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
fun MetadataProvider.newMemberExpression(name: CharSequence?, base: Expression, memberType: Type? = UnknownType.getUnknownType(), operatorCode: String? = ".", code: String? = null, 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?, code: String? = null, 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

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
fun MetadataProvider.newNewExpression(code: String? = null, type: Type? = UnknownType.getUnknownType(), 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
fun MetadataProvider.newParamVariableDeclaration(name: CharSequence?, type: Type? = UnknownType.getUnknownType(), variadic: Boolean = false, code: String? = null, rawNode: Any? = null): ParamVariableDeclaration

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 MetadataProvider.newPrimitiveType(name: String, modifier: ObjectType.Modifier = Modifier.SIGNED, qualifier: Type.Qualifier = Type.Qualifier()): ObjectType
Link copied to clipboard
fun MetadataProvider.newProblemDeclaration(problem: String = "", type: ProblemNode.ProblemType = ProblemNode.ProblemType.PARSING, code: String? = null, 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, code: String? = null, 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

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 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 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 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
fun MetadataProvider.newTryStatement(code: String? = null, rawNode: Any? = null): TryStatement

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
fun MetadataProvider.newTypedefDeclaration(targetType: Type, alias: Type, code: String? = null, rawNode: Any? = null): TypedefDeclaration

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

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?, referencedType: Type?, code: String? = null, 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 TypeParamDeclaration. 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(operatorType: String, postfix: Boolean, prefix: Boolean, code: String? = null, 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.newUsingDirective(code: String? = null, qualifiedName: CharSequence?, rawNode: Any? = null): UsingDirective

Creates a new UsingDirective. 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.getUnknownType(), code: String? = null, 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

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

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
fun LanguageProvider.parseType(name: CharSequence, resolveAlias: Boolean = false): @NotNull Type

Provides a nice alias to TypeParser.createFrom. In the future, this should not be used anymore since we are moving away from the TypeParser altogether.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Returns a new Inference object starting from this node.

Link copied to clipboard

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