References on parsing / data structures

p.booth@imperial.ac.uk (Mr. P. Booth)
Mon, 3 Apr 1995 10:13:29 GMT

          From comp.compilers

Related articles
References on parsing / data structures p.booth@imperial.ac.uk (1995-04-03)
| List of all articles for this month |

Newsgroups: comp.compilers
From: p.booth@imperial.ac.uk (Mr. P. Booth)
Keywords: Fortran, analysis, question, comment
Organization: Imperial College Centre for Environmental Technology
Date: Mon, 3 Apr 1995 10:13:29 GMT

My day job involves maintaining existing Fortran software written
by a variety of programmers using various stylistic conventions.
This software uses many global (COMMON) variables in addition to
formal arguments to routines and is quite difficult to read. I
am currently teaching myself C++ using Lippmann's "C++ Primer" and
I am keen to leverage this learning by working on a "real" C++ application
that would be useful to me in my day job.


I intend writing a source code reformatter similar, in some ways, to
GNU indent, that will reformat Fortran source code with options to
generate declarations for undeclared local variables and to
capitalise symbolic names according to meaning, i.e.:


GlobalVariable = sqrt( local) * CONSTANT


I also want this tool to generate administrative comments like:


C
C Uses:
C Wind_Speed
C Latitude
C
C Modifies:
C temperature_count
C
C Returns:
C


My problem:


I haven't done a class in compiler construction and don't have knowledge
of the theory of parsing or data structures that would best suit my problem.
Can anyone recommend either good references that are relevant to this
application domain or examples of good public domain source code which will
parse source code. If the code is written in C++ then so the better.


My primary objective is developing my C++ skills. I also hope to write
something that is more useful than the available public domain tools I
have seen.




Peter


------
Peter Booth Email: P.Booth@ic.ac.uk
Imperial College Centre for Environmental Technology
48 Prince's Gardens, London SW7 2PE
0171-594 9296 (ph)
0171-581 0245 (FAX)
[Parsing Fortran is a major pain in the neck. See my Fortran subset parser in
the compilers archives here at iecc.com for an example of what you have to do.
-John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.