Added necessary stacks for translation
This commit is contained in:
parent
743ea07796
commit
a64bd11a78
2 changed files with 4 additions and 2 deletions
|
|
@ -9,8 +9,9 @@ quadrupletIndex = 1
|
|||
# Auxiliary stacks.
|
||||
operandsStack = []
|
||||
operatorsStack = []
|
||||
typesStack = []
|
||||
jumpsStack = []
|
||||
auxStack = []
|
||||
exitsStack = []
|
||||
avail = []
|
||||
for i in range(50):
|
||||
avail.append('T' + str(i))
|
||||
|
|
@ -24,7 +25,7 @@ def addSymbol(name, symbolType):
|
|||
global currentIndex
|
||||
initialValue = 0 if symbolType == 'integer' else 0.0
|
||||
symbols[name] = {
|
||||
'symbolType': symbolType,
|
||||
'type': symbolType,
|
||||
'value': initialValue,
|
||||
'direction': currentIndex
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
program test
|
||||
integer :: a, b
|
||||
real :: c
|
||||
a = (2 + 1) + 4 * 2 / 3 * b
|
||||
b = a
|
||||
end program
|
||||
Loading…
Add table
Add a link
Reference in a new issue