fparser Reference Guide  0.0.14
/home/docs/checkouts/readthedocs.org/user_builds/fparser-ref/checkouts/342_reference_guide/src/fparser/scripts/README.md
1 This directory contains scripts that are potentially useful for
2 running and/or testing fparser. The scripts and their use are described
3 below.
4 
5 fparser2.py
6 -----------
7 
8 Runs fparser2 on an input file and displays the de-parsed code. To see
9 any command line options add -h. This script can be used to choose
10 between parsing Fortran 2003 and Fortran 2008. An example of the use
11 of this script is:
12 
13 > cat tmp.f90
14 program test
15 end program test
16 > fparser2.py tmp.f90
17 PROGRAM test
18 END PROGRAM test
19 
20 fparser2_bench.py
21 -----------------
22 
23 Generates a synthetic Fortran source benchmark in memory and then
24 measures the time taken by fparser2 to parse it.
25 
26 parse.py
27 --------
28 
29 Runs fparser1 on an input file and displays the parser's
30 representation of that code. To see any command line options add
31 -h. An example of the use of this script is:
32 
33 > cat tmp.f90
34 program test
35 end program test
36 > parse.py tmp.f90
37 BeginSource
38  blocktype='beginsource'
39  name="<open file 'tmp3.f90', mode 'r' at 0x7f9bd0952f60> mode=free"
40  content:
41  Program
42  blocktype='program'
43  name='test'
44  item=Line('program test',(1, 1),None,None,<reader>)
45  content:
46  EndProgram
47  blocktype='program'
48  name='test'
49  item=Line('end program test',(2, 2),None,None,<reader>)
50 
51 read.py
52 -------
53 
54 Runs the fparser file reader on an input file and displays the file
55 reader's representation of that code. This is useful for testing that
56 the file reader is working as expected. Note the file reader is
57 required by both the fparser2.py and parse.py scripts. An example of
58 the use of this script is:
59 
60 > cat tmp.f90
61 program test
62 end program test
63 > read.py tmp.f90
64 line #1'program test'
65 line #2'end program test'
66 
67 script_options.py
68 -----------------
69 
70 Utility script used by fparser2.py, parse.py and read.py. This is
71 responsible for managing the common command line options in these files.