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.
|
# Auxiliary stacks.
|
||||||
operandsStack = []
|
operandsStack = []
|
||||||
operatorsStack = []
|
operatorsStack = []
|
||||||
|
typesStack = []
|
||||||
jumpsStack = []
|
jumpsStack = []
|
||||||
auxStack = []
|
exitsStack = []
|
||||||
avail = []
|
avail = []
|
||||||
for i in range(50):
|
for i in range(50):
|
||||||
avail.append('T' + str(i))
|
avail.append('T' + str(i))
|
||||||
|
|
@ -24,7 +25,7 @@ def addSymbol(name, symbolType):
|
||||||
global currentIndex
|
global currentIndex
|
||||||
initialValue = 0 if symbolType == 'integer' else 0.0
|
initialValue = 0 if symbolType == 'integer' else 0.0
|
||||||
symbols[name] = {
|
symbols[name] = {
|
||||||
'symbolType': symbolType,
|
'type': symbolType,
|
||||||
'value': initialValue,
|
'value': initialValue,
|
||||||
'direction': currentIndex
|
'direction': currentIndex
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
program test
|
program test
|
||||||
integer :: a, b
|
integer :: a, b
|
||||||
|
real :: c
|
||||||
a = (2 + 1) + 4 * 2 / 3 * b
|
a = (2 + 1) + 4 * 2 / 3 * b
|
||||||
b = a
|
b = a
|
||||||
end program
|
end program
|
||||||
Loading…
Add table
Add a link
Reference in a new issue