-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import Any, Optional | ||
from dynapyt.analyses.BaseAnalysis import BaseAnalysis | ||
from dynapyt.instrument.IIDs import IIDs | ||
|
||
|
||
class TestAnalysis(BaseAnalysis): | ||
def begin_execution(self) -> None: | ||
print("begin execution") | ||
|
||
def enter_control_flow(self, dyn_ast: str, iid: int, cond_value: bool) -> Optional[bool]: | ||
print(f"enter control flow event with condition {cond_value}") | ||
|
||
def enter_if(self, dyn_ast: str, iid: int, cond_value: bool) -> Optional[bool]: | ||
print(f"if condition evaluates to {cond_value}") | ||
|
||
def exit_if(self, dyn_ast: str, iid: int): | ||
print(f"done with if statement") | ||
|
||
def exit_control_flow(self, dyn_ast: str, iid: int) -> None: | ||
print(f"done with control flow statement") | ||
|
||
def end_execution(self) -> None: | ||
print("end execution") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
begin execution | ||
enter control flow event with condition False | ||
if condition evaluates to False | ||
enter control flow event with condition False | ||
if condition evaluates to False | ||
enter control flow event with condition True | ||
if condition evaluates to True | ||
foo is equal to 50 | ||
done with control flow statement | ||
done with if statement | ||
end execution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
foo = 45 + 5 | ||
if foo > 50: | ||
print("foo is greater than 50") | ||
elif foo == 45: | ||
print("foo is equal to 45") | ||
elif foo == 50: | ||
print("foo is equal to 50") | ||
else: | ||
print("foo is less than 50") |