Package-level declarations

Types

Link copied to clipboard

A compilation database contains necessary information about the include paths and possible compiler flags that should be used for an individual source file. It follows the JSON Compilation Database Format Specification (see https://clang.llvm.org/docs/JSONCompilationDatabase.html).

Link copied to clipboard
Link copied to clipboard
abstract class Handler<S : Node, T, L : LanguageFrontend>(configConstructor: Supplier<S>, var frontend: L) : LanguageProvider, CodeAndLocationProvider, ScopeProvider, NamespaceProvider

A Handler is an abstract base class for a class that translates AST nodes from a raw ast type, usually supplied by a language parser into our generic CPG nodes.

Link copied to clipboard
fun interface HandlerInterface<S, T>

This functional interface specifies how a handler class should translate raw AST nodes into CPG nodes.

Link copied to clipboard

A language trait that specifies if the language has the concept of "classes". The alternative is to use structs. Note that some languages can have both and that in some languages structs and classes are essentially the same. This is mostly used to determine if an inferred record declaration can be a class or must be a struct.

Link copied to clipboard

A language trait that specifies that this language has a complex call resolution that we need to fine-tune in the language implementation.

Link copied to clipboard

A language trait that specifies, that this language has support for default arguments, e.g. in functions.

Link copied to clipboard

A language trait, that specifies that this language has "elaborated type specifiers". If so, we should consider them when parsing the types.

Link copied to clipboard

A language trait that specifies if the language supports function pointers.

Link copied to clipboard

A language trait, that specifies that this language has certain qualifiers. If so, we should consider them when parsing the types.

Link copied to clipboard

A language trait, that specifies that this language has binary operators that will short-circuit evaluation if the logical result is already known: '&&', '||' in Java or 'and','or' in Python

Link copied to clipboard

A language trait that specifies if the language has the concept of "structs". The alternative is to use classes. Note that some languages can have both and that in some languages structs and classes are essentially the same. This is mostly used to determine if an inferred record declaration can be a struct or must be a class.

Link copied to clipboard

A language trait, that specifies that this language has support for superclasses. If so, we should consider the specified superclass keyword to resolve calls etc.

Link copied to clipboard

A language trait, that specifies that this language has support for templates or generics.

Link copied to clipboard

A language trait, that specifies that this language has specifiers which let us conclude that we do not know the type. If so, we should consider them when parsing the types.

Link copied to clipboard
abstract class Language<T : LanguageFrontend> : Node

Represents a programming language. When creating new languages in the CPG, one must derive custom class from this and override the necessary fields and methods.

Link copied to clipboard

The main task of the language frontend is to translate the programming language-specific files to the common CPG nodes. It further fills the scopeManager. The language frontend must not be used after having processed the files, i.e., it won't be available in passes.

Link copied to clipboard
interface LanguageTrait

A language trait is a feature or trait that is common to a group of programming languages. Any Language that supports them should implement the desired trait interface. Examples could be the support of pointers, support for templates or generics.

Link copied to clipboard

This class is a piece of legacy code that seems to offer a functionality to register certain listeners that get executed when raw AST nodes are processed into certain nodes (specified in interestingStatements).

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class SupportsParallelParsing(val supported: Boolean = true)

Determines if the LanguageFrontend can parse multiple files in parallel. Defaults to true.

Link copied to clipboard

A generic exception that can be thrown from a LanguageFrontend, if it reaches a state where it cannot continue translating source code into the graph.