Package-level declarations
Types
Represents an assignment of a group of expressions (in the simplest case: one) from the right hand side to the left-hand side.
A binary operation expression, such as "a + b". It consists of a left hand expression (lhs), a right hand expression (rhs) and an operatorCode.
A statement which contains a list of statements. A common example is a function body within a FunctionDeclaration.
An expression, which calls another function. It has a list of arguments (list of Expressions) and is connected via the INVOKES edge to its FunctionDeclaration.
Represent a list/set/map comprehension or similar expression. It contains four major components: The statement, the variable, the iterable and a predicate which are combined to something like [statement(variable) : variable in iterable if predicate(variable)]
.
This class holds the variable, iterable and predicate of the CollectionComprehension.
Represents an expression containing a ternary operator: var x = condition ? valueIfTrue : valueIfFalse
;
Represents a call to a constructor, usually as an initializer.
Represents one expression. It is used as a base class for multiple different types of expressions. The only constraint is, that each expression has a type.
This node represents the initialization of an "aggregate" object, such as an array or a struct or object. The actual use can greatly differ by the individual language frontends. In order to be as accurate as possible when propagating types, the InitializerListExpression.type property MUST be set before adding any values to InitializerListExpression.initializers.
Represents a key / value pair, often found in languages that allow associative arrays or objects, such as Python, Golang or JavaScript.
This expression denotes the usage of an anonymous / lambda function. It connects the inner anonymous function to the user of a lambda function with an expression.
Represents a literal value, meaning the value is fixed and not depending on the runtime evaluation of the expression.
Represents a CallExpression to something which is a member of an object (the base). For example obj.toString()
. The type of the callee property should be a MemberExpression (unless a translation error occurred). One notable exception are function pointer calls to class methods in C++, in which the callee is a BinaryOperator with a .*
operator.
Represents access to a member of a RecordDeclaration, such as obj.property
. Another common use-case is access of a member function (method) as part of the MemberCallExpression.callee property of a MemberCallExpression.
Expressions of the form new Type[]
that represents the creation of an array, mostly used in combination with a VariableDeclaration.
Represents the creation of a new object through the new
keyword.
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.
A node where the statement could not be translated by the graph. We use ProblemExpressions whenever the CPG library requires an Expression.
Represents the specification of a range (e.g., of an array). Usually used in combination with an SubscriptExpression as the SubscriptExpression.subscriptExpression.
An expression, which refers to something which is declared, e.g. a variable. For example, the expression a = b
, which itself is an AssignExpression, contains two References, one for the variable a
and one for variable b
, which have been previously been declared.
A BinaryOperator which only evaluates BinaryOperator.rhs if BinaryOperator.lhs fulfils some condition. For the operators in de.fraunhofer.aisec.cpg.frontends.HasShortCircuitOperators.conjunctiveOperators, the rhs has to evaluate to "true" or so to continue on the lhs, whereas for the operators in de.fraunhofer.aisec.cpg.frontends.HasShortCircuitOperators.disjunctiveOperators, the lhs has to evaluate to "false" (or similar).
Represents the subscription or access of an array of the form array[index]
, where both array
(arrayExpression) and index
(subscriptExpression) are of type Expression. CPP can overload operators thus changing semantics of array access.
Represets a Type used as an expression for instance when instantiating templates
Models C++ operations that inspect types. These are typeof
, sizeof
, typeid
, alignof
and are stored as string in their operator code.
A unary operator expression, involving one expression and an operator, such as a++
.
Functions
Creates a new OperatorCallExpression to a OperatorDeclaration and also sets the appropriate fields such as CallExpression.invokes and Reference.refersTo.