Skip to content

symbol_table

RegisterTable

RegisterTable()

Methods:

Attributes:

Source code in src/irx/symbol_table.py
19
20
21
22
23
def __init__(self) -> None:
    """
    title: Initialize RegisterTable.
    """
    self.stack: list[int] = []

last property

last: int

append

append() -> None
Source code in src/irx/symbol_table.py
25
26
27
28
29
def append(self) -> None:
    """
    title: Append.
    """
    self.stack.append(0)

increase

increase(count: int = 1) -> int
Source code in src/irx/symbol_table.py
31
32
33
34
35
36
37
38
39
40
41
def increase(self, count: int = 1) -> int:
    """
    title: Increase.
    parameters:
      count:
        type: int
    returns:
      type: int
    """
    self.stack[-1] += count
    return self.stack[-1]

pop

pop() -> None
Source code in src/irx/symbol_table.py
52
53
54
55
56
def pop(self) -> None:
    """
    title: Pop.
    """
    self.stack.pop()

redefine

redefine(count: int) -> None
Source code in src/irx/symbol_table.py
58
59
60
61
62
63
64
65
def redefine(self, count: int) -> None:
    """
    title: Redefine.
    parameters:
      count:
        type: int
    """
    self.stack[-1] = count

reset

reset() -> None
Source code in src/irx/symbol_table.py
67
68
69
70
71
def reset(self) -> None:
    """
    title: Reset.
    """
    self.stack[-1] = 0