Util

object Util

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

fun addDFGEdgesForMutuallyExclusiveBranchingExpression(n: Node, branchingExp: Node?, branchingDecl: Node?)

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++.

Link copied to clipboard

Establish dataflow from call arguments to the target FunctionDeclaration parameters

Link copied to clipboard
fun containsOnOuterLevel(input: String, marker: Char): Boolean
Link copied to clipboard

Inverse operation of .attachCallParameters

Link copied to clipboard
fun <T> distinctBy(by: Function<in T, *>): Predicate<T>
Link copied to clipboard
fun eogConnect(q: Util.Quantifier = Quantifier.ALL, cn: Util.Connect = Connect.SUBTREE, en: Util.Edge, n: Node?, cr: Util.Connect = Connect.SUBTREE, props: Map<Properties, Any?> = mutableMapOf(), refs: List<Node?>): Boolean

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.

Link copied to clipboard
fun errorWithFileLocation(node: Node, log: Logger, format: String?, vararg arguments: Any?)
fun <S> errorWithFileLocation(lang: LanguageFrontend, astNode: S, log: Logger, format: String?, vararg arguments: Any?)
Link copied to clipboard

This function returns the set of adjacent DFG nodes that is contained in the nodes subgraph.

Link copied to clipboard
Link copied to clipboard
fun getParentName(language: Language<out LanguageFrontend>?, name: String): String
Link copied to clipboard
fun getSimpleName(language: Language<out LanguageFrontend>?, name: String): String
Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard
fun <T> reverse(input: Stream<T>): Stream<T>
Link copied to clipboard

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.

Link copied to clipboard
fun subnodesOfCode(node: Node?, searchCode: String): List<Node>

Filters the nodes in the AST subtree at root node for Nodes with the specified code.

Link copied to clipboard
fun warnWithFileLocation(node: Node, log: Logger, format: String?, vararg arguments: Any?)
fun <S> warnWithFileLocation(lang: LanguageFrontend, astNode: S, log: Logger, format: String?, vararg arguments: Any?)