diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2006-06-22 10:25:57 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2006-06-22 10:25:57 +0000 |
commit | d5a5da520b1eddd10a7dde79b0e7df281ee1abaa (patch) | |
tree | f19a3ce2d0e327bc02771dee39a4b0ccea7aeccf /numpy/f2py/lib/parsefortran.py | |
parent | 1fe0237f46025a44779ad98974b9a587b6aa6ac8 (diff) | |
download | numpy-d5a5da520b1eddd10a7dde79b0e7df281ee1abaa.tar.gz |
Cont. impl. Fortran parser.
Diffstat (limited to 'numpy/f2py/lib/parsefortran.py')
-rw-r--r-- | numpy/f2py/lib/parsefortran.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/numpy/f2py/lib/parsefortran.py b/numpy/f2py/lib/parsefortran.py index 380c10ffd..71355a9ad 100644 --- a/numpy/f2py/lib/parsefortran.py +++ b/numpy/f2py/lib/parsefortran.py @@ -16,7 +16,7 @@ import traceback from numpy.distutils.misc_util import yellow_text, red_text from readfortran import FortranFileReader, FortranStringReader -from block import Block +from block_statements import BeginSource class FortranParser: @@ -37,8 +37,7 @@ class FortranParser: def parse(self): import init try: - main = Block(self) - main.fill() + main = BeginSource(self) return main except KeyboardInterrupt: raise @@ -53,11 +52,11 @@ class FortranParser: def test_pyf(): string = """ python module foo - interface + interface tere subroutine bar real r end subroutine bar - end interface + end interface tere end python module foo """ reader = FortranStringReader(string, True, True) @@ -79,8 +78,15 @@ module foo if (.true.) then call smth end if + aaa : if (.false.) then + else if (a) then aaa + else aaa + end if aaa + hey = 1 end subroutine bar + abstract interface + end interface end module foo """ reader = FortranStringReader(string, True, False) @@ -109,7 +115,7 @@ def simple_main(): parser = FortranParser(reader) block = parser.parse() - print block + #print block def profile_main(): import hotshot, hotshot.stats @@ -127,3 +133,4 @@ if __name__ == "__main__": #test_pyf() simple_main() #profile_main() + |