stdin works i think
This commit is contained in:
@@ -31,12 +31,15 @@ class Generator:
|
||||
self.global_scope = SymbolTable()
|
||||
self.current_var_scope = self.global_scope
|
||||
self.constants = {}
|
||||
self.buffers = {}
|
||||
self.structs = {}
|
||||
self.functions: dict[str, dict] = {}
|
||||
self.labels = []
|
||||
self.arg_list = []
|
||||
self.constants_reverse = {}
|
||||
self.constant_counter = 0
|
||||
self.buffer_counter = 0
|
||||
self.included_functions = []
|
||||
|
||||
def ground_type_to_node(self, ground_type: str):
|
||||
if ground_type == "string":
|
||||
@@ -58,6 +61,12 @@ class Generator:
|
||||
self.constant_counter += 1
|
||||
return "[LC" + str(self.constant_counter-1) + "]"
|
||||
|
||||
def add_buffer(self, size: int):
|
||||
buffer_name = "BUF" + str(self.buffer_counter)
|
||||
self.buffers[buffer_name] = size
|
||||
self.buffer_counter += 1
|
||||
return buffer_name
|
||||
|
||||
def add_function(self, node: FunctionNode):
|
||||
self.functions[node.name] = {
|
||||
"func": node,
|
||||
|
Reference in New Issue
Block a user