Skip to content

Commit

Permalink
delete usless prints
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdidehghandev committed Dec 9, 2024
1 parent 9ee28e9 commit b541673
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
class Evaluate:
def __init__(self, postfix_expr, symbol_table):
self.postfix_expr = postfix_expr
self.identifier_vals = {}
self.symbol_table = symbol_table


Expand Down Expand Up @@ -83,7 +82,6 @@ def _apply_single_op(op, a):

def get_values(self):
for token in self.postfix_expr:
print(token)
if (token.type == "ID") and (
self.symbol_table.table[token.value.lower()]["type"] == "IDENTIFIER"
and self.symbol_table.table[token.value.lower()]["value"] is None
Expand Down
10 changes: 4 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def visulaize(start_of_the_interval, end_of_the_interval, postfix_expr):

for i in np.arange(start_of_the_interval, end_of_the_interval, step):
symbol_table = SymbolTable()
print(symbol_table.table)
evaluate = Evaluate(postfix_expr,symbol_table)
y = evaluate.evaluate_with_value(i)
points.append((i, y))
Expand Down Expand Up @@ -91,8 +90,7 @@ def main(file_name):

lexer = Lexer(symbol_table, text)
tokens = lexer.tokenize()
for token in tokens:
print(token)

parser = Parser(symbol_table, tokens)
parser.parse()

Expand All @@ -103,9 +101,9 @@ def main(file_name):


while True:
print("1- without visual")
print("2- with visual")
print("3- find root")
print("1- Without visual")
print("2- With visual")
print("3- Find root")
print("4- Exit")
choice = input("--> ")

Expand Down

0 comments on commit b541673

Please sign in to comment.