Skip to content

Commit

Permalink
adding is_function info
Browse files Browse the repository at this point in the history
  • Loading branch information
tutugordillo committed Jul 10, 2024
1 parent 75564f5 commit e6987f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/parser/cfg_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, identifier : str, instructions: List[CFGInstruction], type_bl
self._jump_to = None
self._falls_to = None
self.assignment_dict = assignment_dict

self.is_function_call = False

def get_block_id(self) -> str:
return self.block_id
Expand All @@ -39,6 +39,12 @@ def get_jump_to(self) -> str:
def get_falls_to(self) -> str:
return self._falls_to

def is_function_call(self) -> bool:
return self.is_function_call

def set_function_call(self, v) -> None:
self.is_function_call = v

def set_instructions(self, new_instructions: List[CFGInstruction]) -> None:
self._instructions = new_instructions

Expand Down
3 changes: 3 additions & 0 deletions src/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def parse_block(block_json: Dict[str,Any]) -> CFGBlock:

block = CFGBlock(block_id,list_cfg_instructions, block_type, assignment_dict)

if block_type == "FunctionCall":
block.set_function_call(True)

return block_id, block, block_exit

def parse_object(object_name, json_object) -> CFGObject:
Expand Down

0 comments on commit e6987f9

Please sign in to comment.