10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-06-20 20:22:11 +02:00
irpf90/src/subroutines.py
2009-09-04 18:37:10 +02:00

30 lines
633 B
Python

#!/usr/bin/python
from subroutine import *
from irpf90_t import *
def create_subroutines():
from preprocessed_text import preprocessed_text
result = {}
for filename, text in preprocessed_text:
buffer = []
inside = False
for line in text:
if isinstance(line,Subroutine):
inside = True
if inside:
buffer.append(line)
if isinstance(line,End):
if inside:
v = Sub(buffer)
result[v.name] = v
buffer = []
inside = False
return result
subroutines = create_subroutines()
if __name__ == '__main__':
for v in subroutines.keys():
print v