3 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
6 from waflib import Utils,Task,TaskGen,Logs
7 from waflib.TaskGen import feature,before_method,after_method,extension
8 from waflib.Configure import conf
9 INC_REGEX="""(?:^|['">]\s*;)\s*(?:|#\s*)INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])"""
10 USE_REGEX="""(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)"""
11 MOD_REGEX="""(?:^|;)\s*MODULE(?!\s*PROCEDURE)(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)"""
12 re_inc=re.compile(INC_REGEX,re.I)
13 re_use=re.compile(USE_REGEX,re.I)
14 re_mod=re.compile(MOD_REGEX,re.I)
15 class fortran_parser(object):
16 def __init__(self,incpaths):
20 self.incpaths=incpaths
21 def find_deps(self,node):
26 for line in txt.splitlines():
29 incs.append(m.group(1))
32 uses.append(m.group(1))
35 mods.append(m.group(1))
36 return(incs,uses,mods)
40 nd=self.waiting.pop(0)
44 incs,uses,mods=self.find_deps(node)
49 self.tryfind_header(x)
52 if not name in self.names:
53 self.names.append(name)
56 if not name in self.names:
57 self.names.append(name)
58 def tryfind_header(self,filename):
60 for n in self.incpaths:
61 found=n.find_resource(filename)
63 self.nodes.append(found)
64 self.waiting.append(found)
67 if not filename in self.names:
68 self.names.append(filename)