Fixed issue with do statements with counter where artihmetic expressions couldn't be used as conditions only contants or variables, created the program 1

This commit is contained in:
Mariano Uvalle 2019-05-04 22:31:21 -05:00
parent 34d4697aa9
commit c7d211f0b5
9 changed files with 426 additions and 101 deletions

View file

@ -22,13 +22,13 @@ typesStack = []
jumpsStack = []
exitsStack = []
avail = []
for i in range(50):
for i in range(200):
avail.append('$' + str(i))
# Operations related to the table of symbols
symbols = {}
# Our variables start at direction 50, the temps take the first 49 directions.
currentIndex = 50
currentIndex = 200
# Multi dimensional variables dimensions just for declaration.
globalDimension1 = 0
@ -809,8 +809,6 @@ def p_action_26(p):
jumpsStack.append(quadrupletIndex)
resultQuadruplets.append(f'gotoF {str(temp)} _\n')
quadrupletIndex += 1
if (isTemp(operand2)):
avail = [operand2.replace('*', '$')] + avail
if (isTemp(operand1)):
avail = [operand1.replace('*', '$')] + avail