fc_scan

class waflib.Tools.fc_scan.fortran_parser(incpaths)[source]

Bases: object

This parser will return:

  • the nodes corresponding to the module names that will be produced
  • the nodes corresponding to the include files used
  • the module names used by the fortran file
seen

Files already parsed

nodes

List of waflib.Node.Node representing the dependencies to return

names

List of module names to return

incpaths

List of waflib.Node.Node representing the include paths

find_deps(node)[source]

Parse a fortran file to read the dependencies used and provided

Parameters:node (waflib.Node.Node) – fortran file to read
Returns:lists representing the includes, the modules used, and the modules created by a fortran file
Return type:tuple of list of strings
start(node)[source]

Start the parsing. Use the stack self.waiting to hold the nodes to iterate on

Parameters:node (waflib.Node.Node) – fortran file
iter(node)[source]

Process a single file in the search for dependencies, extract the files used the modules used, and the modules provided.

tryfind_header(filename)[source]

Try to find an include and add it the nodes to process

Parameters:filename (string) – file name
waflib.Tools.fc_scan.conf(f)

Decorator: attach new configuration functions to waflib.Build.BuildContext and waflib.Configure.ConfigurationContext. The methods bound will accept a parameter named ‘mandatory’ to disable the configuration errors:

def configure(conf):
        conf.find_program('abc', mandatory=False)
Parameters:f (function) – method to bind
waflib.Tools.fc_scan.feature(*k)

Decorator: register a task generator method that will be executed when the object attribute ‘feature’ contains the corresponding key(s):

from waflib.Task import feature
@feature('myfeature')
def myfunction(self):
        print('that is my feature!')
def build(bld):
        bld(features='myfeature')
Parameters:k (list of string) – feature names
waflib.Tools.fc_scan.before_method(*k)

Decorator: register a task generator method which will be executed before the functions of given name(s):

from waflib.TaskGen import feature, before
@feature('myfeature')
@before_method('fun2')
def fun1(self):
        print('feature 1!')
@feature('myfeature')
def fun2(self):
        print('feature 2!')
def build(bld):
        bld(features='myfeature')
Parameters:k (list of string) – method names
waflib.Tools.fc_scan.after_method(*k)

Decorator: register a task generator method which will be executed after the functions of given name(s):

from waflib.TaskGen import feature, after
@feature('myfeature')
@after_method('fun2')
def fun1(self):
        print('feature 1!')
@feature('myfeature')
def fun2(self):
        print('feature 2!')
def build(bld):
        bld(features='myfeature')
Parameters:k (list of string) – method names
waflib.Tools.fc_scan.extension(*k)

Decorator: register a task generator method which will be invoked during the processing of source files for the extension given:

from waflib import Task
class mytask(Task):
        run_str = 'cp ${SRC} ${TGT}'
@extension('.moo')
def create_maa_file(self, node):
        self.create_task('mytask', node, node.change_ext('.maa'))
def build(bld):
        bld(source='foo.moo')

Previous topic

fc_config

Next topic

bison

This Page