module documentation

process_file(filename)

takes templated file .xxx.src and produces .xxx file where .xxx is .pyf .f90 or .f using the following template rules:

'<..>' denotes a template.

All function and subroutine blocks in a source file with names that contain '<..>' will be replicated according to the rules in '<..>'.

The number of comma-separated words in '<..>' will determine the number of replicates.

'<..>' may have two different forms, named and short. For example,

named:

<p=d,s,z,c> where anywhere inside a block '<p>' will be replaced with 'd', 's', 'z', and 'c' for each replicate of the block.

<_c> is already defined: <_c=s,d,c,z> <_t> is already defined: <_t=real,double precision,complex,double complex>

short:
<s,d,c,z>, a short form of the named, useful when no <p> appears inside a block.

In general, '<..>' contains a comma separated list of arbitrary expressions. If these expression must contain a comma|leftarrow|rightarrow, then prepend the comma|leftarrow|rightarrow with a backslash.

If an expression matches '<index>' then it will be replaced by <index>-th expression.

Note that all '<..>' forms in a block must have the same number of comma-separated entries.

Predefined named template rules:
<prefix=s,d,c,z> <ftype=real,double precision,complex,double complex> <ftypereal=real,double precision,0,1> <ctype=float,double,complex_float,complex_double> <ctypereal=float,double,0,1>
Variable function​_start​_re Undocumented
Variable include​_src​_re Undocumented
Variable item​_re Undocumented
Variable list​_re Undocumented
Variable named​_re Undocumented
Variable routine​_end​_re Undocumented
Variable routine​_start​_re Undocumented
Variable template​_name​_re Undocumented
Variable template​_re Undocumented
Function conv Undocumented
Function expand​_sub Undocumented
Function find​_and​_remove​_repl​_patterns Undocumented
Function find​_repl​_patterns Undocumented
Function main Undocumented
Function parse​_structure Return a list of tuples for each function or subroutine each tuple is the start and end of a subroutine or function to be expanded.
Function process​_file Undocumented
Function process​_str Undocumented
Function resolve​_includes Undocumented
Function unique​_key Obtain a unique key given a dictionary.
Variable ​_special​_names Undocumented
function_start_re =

Undocumented

include_src_re =

Undocumented

item_re =

Undocumented

list_re =

Undocumented

named_re =

Undocumented

routine_end_re =

Undocumented

routine_start_re =

Undocumented

template_name_re =

Undocumented

template_re =

Undocumented

def conv(astr):

Undocumented

def expand_sub(substr, names):

Undocumented

def find_and_remove_repl_patterns(astr):

Undocumented

def find_repl_patterns(astr):

Undocumented

def main():

Undocumented

def parse_structure(astr):
Return a list of tuples for each function or subroutine each tuple is the start and end of a subroutine or function to be expanded.
def process_file(source):

Undocumented

def process_str(allstr):

Undocumented

def resolve_includes(source):

Undocumented

def unique_key(adict):
Obtain a unique key given a dictionary.
_special_names =

Undocumented