SubgraphWalker

Helper class for graph walking: Walking through ast-, cfg-, ...- edges

Types

Link copied to clipboard
class Border

For better readability: result.entries instead of result.get(0) when working with getEOGPathEdges. Can be used for all subgraphs in subgraphs, e.g. AST entries and exits in a EOG subgraph, EOG entries and exits in a CFG subgraph.

Link copied to clipboard
Link copied to clipboard

This class traverses the graph in a similar way as the IterativeGraphWalker, but with the added feature, that a ScopeManager is populated with the scope information of the current node. This way, we can call functions on the supplied scopeManager and emulate that we are currently in the scope of the "consumed" node in the callback. This can be useful for resolving declarations or other scope-related tasks.

Functions

Link copied to clipboard

Flattens the tree, starting at Node n into a list.

Link copied to clipboard
fun getAllEdgeFields(classType: Class<*>): Collection<Field>

Returns all the fields for a specific class type. Because this information is static during runtime, we do cache this information in fieldCache for performance reasons.

Link copied to clipboard

Retrieves a list of AST children of the specified node by iterating all edge fields that are of type AstEdge.

Link copied to clipboard

Function returns two lists in a list. The first list contains all eog nodes with no predecessor in the subgraph with root 'n'. The second list contains eog edges that have no successor in the subgraph with root 'n'. The first List marks the entry and the second marks the exit nodes of the cfg in this subgraph.