split interpretation into two steps: Tokenization and Lexing
This commit is contained in:
@@ -8,8 +8,8 @@ from draw.Iinstruction import Iinstruction
|
||||
class Function_scope(Iterable):
|
||||
"""This class serves as a container for Instructions"""
|
||||
|
||||
def __init__(self, child_instructions: List[Iinstruction], name: str, return_type: str, args: List[str]) -> None:
|
||||
self.contents = child_instructions
|
||||
def __init__(self, name: str, return_type: str, args: List[str]) -> None:
|
||||
self.contents = []
|
||||
self.name = name
|
||||
self.return_type = return_type
|
||||
self.args = args
|
||||
@@ -26,5 +26,11 @@ class Function_scope(Iterable):
|
||||
w = max(w, inst.getblkwidth())
|
||||
return int(w)
|
||||
|
||||
def _add_instruction(self, inst: Iinstruction):
|
||||
self.contents.append(inst)
|
||||
|
||||
def _add_instructions(self, inst: List[Iinstruction]):
|
||||
self.contents.extend(inst)
|
||||
|
||||
def __iter__(self):
|
||||
return self.contents.__iter__()
|
||||
Reference in New Issue
Block a user