targets = {}
headers = []
funcnames = []
+typedict = {}
arraydepths = {}
returntypes = {}
-currentfunc = 'main.'
-typedict = {'main.':{}}
+def initfunc(f):
+ global currentfunc
+ currentfunc = f
+ typedict[currentfunc] = {}
+ arraydepths[currentfunc] = {}
+ funcnames.append(currentfunc)
+
+initfunc("main.")
+returntypes['main.'] = 'int'
# Program level
def p_entry(t):
"statement : ENTRY TO FUNCALL"
global currentfunc
- currentfunc = t[3]
+ initfunc(t[3])
t[0] = ('entry', currentfunc)
- typedict[currentfunc] = {}
- arraydepths[currentfunc] = {}
- funcnames.append(currentfunc)
## EXECUTE
def p_execute(t):
break
if deck[i][3][0] != 'external_function':
deck.insert(i, (deck[i][0], i, None, ('entry', 'main.',())))
+
else:
for i in range(len(deck)):
(file, line, label, statement) = deck[i]