Package-level declarations

Types

Link copied to clipboard
class DFA(states: Set<State> = setOf()) : FSM

A representation of a deterministic finite automaton (DFA).

Link copied to clipboard
open class DFAOrderEvaluator(val dfa: DFA, val consideredBases: Set<Node>, val nodeToRelevantMethod: Map<Node, Set<String>>, val consideredResetNodes: Set<Node> = emptySet(), val thisPositionOfNode: Map<Node, Int> = mapOf(), val eliminateUnreachableCode: Boolean = true)

This class uses a DFA to evaluate if the order of statements in the CPG is correct. It needs the following inputs:

Link copied to clipboard
data class Edge(val op: String, val base: String? = null, val nextState: State)

Represents an edge of the automaton. The edge label consists of an operation (typically a method name) and a base which allows us to differentiate between multiple objects.

Link copied to clipboard
sealed class FSM

A representation of a generic finite state automaton. Can either a NFA or a DFA.

Link copied to clipboard
class NFA(states: Set<State> = setOf()) : FSM

A representation of a non-deterministic finite automaton (NFA).

Link copied to clipboard
class State(name: Int, isStart: Boolean = false, isAcceptingState: Boolean = false)

A simple class representing a state in an FSM.

Link copied to clipboard
data class Trace(val state: State, val cpgNode: Node, val edge: Edge)

Holds the information generated during an order evaluation using the DFAOrderEvaluator. It is used to provide full traceability of the order evaluation in DFA.executionTrace.