Package-level declarations

Types

Link copied to clipboard
data class CallResolutionResult(val source: Expression, val arguments: List<Expression>, var candidateFunctions: Set<FunctionDeclaration>, var viableFunctions: Set<FunctionDeclaration>, var signatureResults: Map<FunctionDeclaration, SignatureResult>, var bestViable: Set<FunctionDeclaration>, var success: CallResolutionResult.SuccessKind, var actualStartScope: Scope?)

This is the result of SymbolResolver.resolveWithArguments. It holds all necessary intermediate results (such as candidateFunctions, viableFunctions) as well as the final result (see bestViable) of the call resolution.

Link copied to clipboard

A generic exception that can be thrown while building the configuration. This exception indicates that the requested configuration is not possible.

Link copied to clipboard
Link copied to clipboard

This class holds configuration options for the inference of certain constructs and auto-guessing when executing language frontends.

Link copied to clipboard
annotation class PleaseBeCareful

Annotation used to mark functions that could potentially be dangerous, in a way that could modify or alter the CPG tree structure that one does not intent to.

Link copied to clipboard
annotation class PopulatedByPass(val value: KClass<out Pass<*>>)

This annotation denotes that, this property is populates by a pass. Optionally, also specifying which Pass class is responsible.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class ResolveInFrontend(val method: String)

Functions marked with this annotation are using features of the ScopeManager to resolve symbols (or scopes) during frontend parsing. This is something which we discourage. However, in non-context free languages such as C++ this is unavoidable to some degree.

Link copied to clipboard

The scope manager builds a multi-tree structure of nodes associated to a scope. These scopes capture the validity of certain (Variable-, Field-, Record-)declarations but are also used to identify outer scopes that should be the target of a jump (continue, break, throw).

Link copied to clipboard
Link copied to clipboard
sealed class SignatureResult

SignatureResult will be the result of the function FunctionDeclaration.matchesSignature which calculates whether the provided CallExpression will match the signature of the current FunctionDeclaration.

Link copied to clipboard

The configuration for the TranslationManager holds all information that is used during the translation.

Link copied to clipboard
class TranslationContext(val config: TranslationConfiguration, val scopeManager: ScopeManager, val typeManager: TypeManager, var currentComponent: Component? = null)

The translation context holds all necessary managers and configurations needed during the translation process.

Link copied to clipboard

Main entry point for all source code translation for all language front-ends.

Link copied to clipboard
class TranslationResult(translationManager: TranslationManager, var finalCtx: TranslationContext) : Node, StatisticsHolder

The global (intermediate) result of the translation. A LanguageFrontend will initially populate it and a Pass can extend it.

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard

This computed property returns the common type in a Collection of Type objects. For example, if two types A and B both derive from the interface C`` then C` would be returned.

Functions

Link copied to clipboard
fun FunctionDeclaration.matchesSignature(signature: List<Type>, arguments: List<Expression>? = null, useDefaultArguments: Boolean = false): SignatureResult
Link copied to clipboard

A utility function that checks whether our Reference refers to a Type. This is used by many passes that replace certain Reference nodes with other nodes, e.g., the ResolveCallExpressionAmbiguityPass.

Link copied to clipboard
fun Type.tryCast(targetType: Type, hint: HasType? = null, targetHint: HasType? = null): CastResult

This function checks, if this Type can be cast into targetType. Note, this also takes the TypeOperations of the type into account, which means that pointer types of derived types will not match with a non-pointer type of its base type. But, if both are pointer types, they will match.