mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-12-21 11:53:32 +01:00
changed preprocessed_text.py - vijay
This commit is contained in:
parent
42c898d509
commit
3d50cbc3e4
BIN
src/build/temp.linux-x86_64-2.7/create_man.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/create_man.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/error.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/error.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/init.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/init.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/irp_stack.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/irp_stack.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/irpf90.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/irpf90.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/irpf90_t.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/irpf90_t.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/locks.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/locks.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/makefile.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/makefile.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/module.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/module.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/modules.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/modules.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/parsed_text.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/parsed_text.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/preprocessed_text.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/preprocessed_text.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/profile.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/profile.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/regexps.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/regexps.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/subroutine.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/subroutine.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/subroutines.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/subroutines.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/touches.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/touches.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/util.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/util.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/variable.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/variable.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/variables.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/variables.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/version.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/version.o
Normal file
Binary file not shown.
BIN
src/build/temp.linux-x86_64-2.7/vim.o
Normal file
BIN
src/build/temp.linux-x86_64-2.7/vim.o
Normal file
Binary file not shown.
3912
src/create_man.c
Normal file
3912
src/create_man.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/create_man.so
Executable file
BIN
src/create_man.so
Executable file
Binary file not shown.
2334
src/error.c
Normal file
2334
src/error.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/error.so
Executable file
BIN
src/error.so
Executable file
Binary file not shown.
2404
src/init.c
Normal file
2404
src/init.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/init.so
Executable file
BIN
src/init.so
Executable file
Binary file not shown.
2488
src/irp_stack.c
Normal file
2488
src/irp_stack.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/irp_stack.so
Executable file
BIN
src/irp_stack.so
Executable file
Binary file not shown.
3053
src/irpf90.c
Normal file
3053
src/irpf90.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/irpf90.exe
Executable file
BIN
src/irpf90.exe
Executable file
Binary file not shown.
BIN
src/irpf90.so
Executable file
BIN
src/irpf90.so
Executable file
Binary file not shown.
14596
src/irpf90_t.c
Normal file
14596
src/irpf90_t.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/irpf90_t.so
Executable file
BIN
src/irpf90_t.so
Executable file
Binary file not shown.
2029
src/locks.c
Normal file
2029
src/locks.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/locks.so
Executable file
BIN
src/locks.so
Executable file
Binary file not shown.
4550
src/makefile.c
Normal file
4550
src/makefile.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/makefile.so
Executable file
BIN
src/makefile.so
Executable file
Binary file not shown.
7953
src/module.c
Normal file
7953
src/module.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/module.so
Executable file
BIN
src/module.so
Executable file
Binary file not shown.
2567
src/modules.c
Normal file
2567
src/modules.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/modules.so
Executable file
BIN
src/modules.so
Executable file
Binary file not shown.
16797
src/parsed_text.c
Normal file
16797
src/parsed_text.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/parsed_text.so
Executable file
BIN
src/parsed_text.so
Executable file
Binary file not shown.
20889
src/preprocessed_text.c
Normal file
20889
src/preprocessed_text.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
# IRPF90 is a Fortran90 preprocessor written in Python for programming using
|
||||
# the Implicit Reference to Parameters (IRP) method.
|
||||
# Copyright (C) 2009 Anthony SCEMAMA
|
||||
# Copyright (C) 2009 Anthony SCEMAMA
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -20,8 +20,8 @@
|
||||
# Anthony Scemama
|
||||
# LCPQ - IRSAMC - CNRS
|
||||
# Universite Paul Sabatier
|
||||
# 118, route de Narbonne
|
||||
# 31062 Toulouse Cedex 4
|
||||
# 118, route de Narbonne
|
||||
# 31062 Toulouse Cedex 4
|
||||
# scemama@irsamc.ups-tlse.fr
|
||||
|
||||
from irpf90_t import *
|
||||
@ -133,7 +133,7 @@ def get_type (i, filename, line, is_doc):
|
||||
|
||||
if firstword in simple_dict:
|
||||
return [ simple_dict[firstword](i,line,filename) ], is_doc
|
||||
|
||||
|
||||
if firstword in [ "select", "selectcase" ]:
|
||||
return [ Select(i,line,filename) ] , is_doc
|
||||
|
||||
@ -141,7 +141,7 @@ def get_type (i, filename, line, is_doc):
|
||||
|
||||
if firstword[0] == '#':
|
||||
result = [ Simple_line(i,line,filename) ]
|
||||
error.warn ( result[0] ,
|
||||
error.warn ( result[0] ,
|
||||
"""irpf90 may not work with preprocessor directives. You can use
|
||||
Irp_if ... Irp_else ... Irp_endif
|
||||
instead of
|
||||
@ -167,7 +167,7 @@ instead of
|
||||
# Detect errors
|
||||
if firstword == "dowhile":
|
||||
error.fail( Do(i,line,filename) , "'do while' should be in 2 words." )
|
||||
|
||||
|
||||
return [ Simple_line(i,line,filename) ], is_doc
|
||||
|
||||
|
||||
@ -343,7 +343,7 @@ def form(text):
|
||||
return Free_form
|
||||
if line.text.rstrip()[-1] == '&':
|
||||
return Free_form
|
||||
return Fixed_form
|
||||
return Fixed_form
|
||||
|
||||
######################################################################
|
||||
def add_operators(text):
|
||||
@ -355,7 +355,11 @@ def add_operators(text):
|
||||
for line in text:
|
||||
buffer = line.text
|
||||
if "+=" in buffer:
|
||||
line.text = re.sub(re_incr,r'\1\2=\2+(\4)', buffer)
|
||||
if "if" in buffer:
|
||||
re_incr = re.compile(r"(.*)(\))(\s*)(.*)(\+=)(.*$)",re.S)
|
||||
line.text = re.sub(re_incr,r'\1\2\4=\4+(\6)', buffer)
|
||||
else:
|
||||
line.text = re.sub(re_incr,r'\1\2=\2+(\4)', buffer)
|
||||
elif "-=" in buffer:
|
||||
line.text = re.sub(re_decr,r'\1\2=\2-(\4)', buffer)
|
||||
elif "*=" in buffer:
|
||||
@ -374,7 +378,7 @@ def remove_comments(text,form):
|
||||
return line
|
||||
else:
|
||||
return re_comment.split(line)[1].rstrip()
|
||||
|
||||
|
||||
if form == Free_form:
|
||||
for line in text:
|
||||
if type(line) in [ Openmp, Doc, Directive] :
|
||||
@ -445,7 +449,7 @@ def remove_continuation(text,form):
|
||||
buffer = ""
|
||||
return result
|
||||
|
||||
|
||||
|
||||
######################################################################
|
||||
def irp_simple_statements(text):
|
||||
'''Processes simple statements'''
|
||||
@ -472,7 +476,7 @@ def irp_simple_statements(text):
|
||||
Empty_line(line.i,"!",f),
|
||||
]
|
||||
return result
|
||||
|
||||
|
||||
def process_irp_read (line):
|
||||
assert type(line) == Irp_read
|
||||
return process_irp_rw(line,'read' ,Irp_read )
|
||||
@ -502,7 +506,7 @@ def irp_simple_statements(text):
|
||||
result.append ( Simple_line (line.i, " print *, '%s = ', %s"%(m,m), line.filename) )
|
||||
result.append ( Simple_line (line.i, " print *, ''", line.filename) )
|
||||
return result
|
||||
|
||||
|
||||
def process_assert(line):
|
||||
assert type(line) == Assert
|
||||
if command_line.do_assert:
|
||||
@ -608,7 +612,7 @@ def irp_simple_statements(text):
|
||||
def process_program(line):
|
||||
assert type(line) == Program
|
||||
program_name = line.lower.split()[1]
|
||||
temp = [ Program(0,"program irp_program",program_name) ]
|
||||
temp = [ Program(0,"program irp_program",program_name) ]
|
||||
if command_line.do_profile:
|
||||
temp += [ Simple_line(0,"call irp_init_timer()",line.filename) ]
|
||||
if command_line.do_openmp:
|
||||
@ -648,8 +652,8 @@ def irp_simple_statements(text):
|
||||
break
|
||||
result += buffer
|
||||
return result
|
||||
|
||||
|
||||
|
||||
|
||||
######################################################################
|
||||
def change_includes(text):
|
||||
'''Deals with include files'''
|
||||
@ -686,7 +690,7 @@ def process_old_style_do(text):
|
||||
text[i] = Enddo(line.i," enddo",line.filename)
|
||||
return
|
||||
error.fail(text[begin],"Old-style do loops should end with 'continue' or 'end do'")
|
||||
|
||||
|
||||
result = []
|
||||
for i in range(len(text)):
|
||||
line = text[i]
|
||||
@ -705,7 +709,7 @@ def process_old_style_do(text):
|
||||
######################################################################
|
||||
def change_single_line_ifs(text):
|
||||
'''Changes:
|
||||
if (test) result
|
||||
if (test) result
|
||||
|
||||
to
|
||||
|
||||
@ -788,7 +792,7 @@ def check_begin_end(text):
|
||||
error.fail(text[begin],type(line).str+" is not closed")
|
||||
error.fail(text[begin],type(line).str + " is not closed")
|
||||
|
||||
|
||||
|
||||
level = 0
|
||||
for i,line in enumerate(text):
|
||||
if type(line) == Begin_doc:
|
||||
@ -864,6 +868,6 @@ def debug():
|
||||
print line
|
||||
print irpf90_files
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == '__main__':
|
||||
debug()
|
||||
|
||||
|
BIN
src/preprocessed_text.so
Executable file
BIN
src/preprocessed_text.so
Executable file
Binary file not shown.
2710
src/profile.c
Normal file
2710
src/profile.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/profile.so
Executable file
BIN
src/profile.so
Executable file
Binary file not shown.
1546
src/regexps.c
Normal file
1546
src/regexps.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/regexps.so
Executable file
BIN
src/regexps.so
Executable file
Binary file not shown.
4223
src/subroutine.c
Normal file
4223
src/subroutine.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/subroutine.so
Executable file
BIN
src/subroutine.so
Executable file
Binary file not shown.
2224
src/subroutines.c
Normal file
2224
src/subroutines.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/subroutines.so
Executable file
BIN
src/subroutines.so
Executable file
Binary file not shown.
2561
src/touches.c
Normal file
2561
src/touches.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/touches.so
Executable file
BIN
src/touches.so
Executable file
Binary file not shown.
5800
src/util.c
Normal file
5800
src/util.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/util.so
Executable file
BIN
src/util.so
Executable file
Binary file not shown.
15213
src/variable.c
Normal file
15213
src/variable.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/variable.so
Executable file
BIN
src/variable.so
Executable file
Binary file not shown.
3746
src/variables.c
Normal file
3746
src/variables.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/variables.so
Executable file
BIN
src/variables.so
Executable file
Binary file not shown.
1176
src/version.c
Normal file
1176
src/version.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/version.so
Executable file
BIN
src/version.so
Executable file
Binary file not shown.
BIN
src/vim.so
Executable file
BIN
src/vim.so
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user