concepts.dm.crow.parsers.cdl_parser.FunctionCallTracker#

class FunctionCallTracker[source]#

Bases: object

This class is used to track the function calls and other statements in a suite. It supports simulating the execution of the program and generating the post-condition of the program.

Methods

run()

Simulate the execution of the program and generates an equivalent return statement.

Attributes

local_variables_stack

The assignments of local variables.

assign_expressions

A list of assign expressions.

assign_expression_signatures

A dictionary of assign expressions, indexed by their signatures.

check_expressions

A list of check expressions.

expr_expressions

A list of expr expressions (i.e. bare expressions in the body).

return_expression

The return expression.

use_runtime_assign

Whether to use runtime assign expressions.

behavior_expressions

__init__(suite, init_local_variables=None, use_runtime_assign=False)[source]#
Parameters:
__new__(**kwargs)#
run()[source]#

Simulate the execution of the program and generates an equivalent return statement. This function handles if-else conditions. However, loops are not allowed.

assign_expression_signatures: Dict[Tuple[str, ...], VariableAssignmentExpression]#

A dictionary of assign expressions, indexed by their signatures.

assign_expressions: List[CrowFeatureAssignmentExpression | CrowBehaviorForeachLoopSuite | CrowBehaviorConditionSuite]#

A list of assign expressions.

behavior_expressions: List[CrowBehaviorBodyPrimitiveBase | CrowBehaviorBodySuiteBaseCrowControllerApplicationExpression | ListExpansionExpression]#
check_expressions: List[ValueOutputExpression]#

A list of check expressions.

expr_expressions: List[ValueOutputExpression]#

A list of expr expressions (i.e. bare expressions in the body).

local_variables_stack: List[Dict[str, Any]]#

The assignments of local variables.

return_expression: ValueOutputExpression | None#

The return expression. This is either None or a single expression.

use_runtime_assign: bool#

Whether to use runtime assign expressions. If this is set to True, assignment expressions for local variables will be converted into runtime assign expressions.