Util
Functions
Connects the node n
with the node branchingExp
if present or with the node branchingDecl
. The assumption is that only branchingExp
or branchingDecl
are present, e.g. C++.
Establish data-flow from a CallExpression arguments to the target FunctionDeclaration parameters. Additionally, if the call is a MemberCallExpression, it establishes a data-flow from the MemberCallExpression.base towards the MethodDeclaration.receiver.
Logs a debug message with the specified file location. This is intentionally inlined, so that the Logger will use the location of the callee of this function, rather than the Util class.
Inverse operation of attachCallParameters
Checks if the Node n
connects to the nodes in refs
over the CPGS EOG graph edges that depict the evaluation order. The parameter q defines if all edges of interest to node must connect to an edge in refs or one is enough, cn and cr define whether the passed AST nodes themselves are used to search the connections or the EOG Border nodes in the AST subnode. Finally, en defines whether the EOG edges go * from n to r in refs or the inverse.
Logs an error with the specified file location. This is intentionally inlined, so that the Logger will use the location of the callee of this function, rather than the Util class.
This function returns the set of adjacent DFG nodes that is contained in the nodes subgraph.
Removes pairs of parentheses that do not provide any further separation. E.g. "(foo)" results in "foo" and "(((foo))((bar)))" in "(foo)(bar)", whereas "(foo)(bar)" stays the same.
Split a String into multiple parts by using one or more delimiter characters. Any delimiters that are surrounded by matching opening and closing brackets are skipped. E.g. "a,(b,c)" will result in a list containing "a" and "(b,c)" when splitting on commas. Empty parts are ignored, so when splitting "a,,,,(b,c)", the same result is returned as in the previous example.
Filters the nodes in the AST subtree at root node
for Nodes with the specified code.
Logs a warning with the specified file location. This is intentionally inlined, so that the Logger will use the location of the callee of this function, rather than the Util class.