JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for COMP-FORTRAN-90 Archives


COMP-FORTRAN-90 Archives

COMP-FORTRAN-90 Archives


COMP-FORTRAN-90@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

COMP-FORTRAN-90 Home

COMP-FORTRAN-90 Home

COMP-FORTRAN-90  1997

COMP-FORTRAN-90 1997

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Fortran parser (was Re: overriding 31 character ...)

From:

[log in to unmask]

Reply-To:

[log in to unmask]

Date:

Sat, 29 Nov 1997 01:26:22 -0500 (EST)

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (118 lines)

I have not heard anything on this since Michel Olagnon's response to David B.
Serafini's proposal.

> Date: Wed, 12 Nov 1997 10:47:36 -0600 (CST)
> From: "David B. Serafini" <[log in to unmask]>
> <snip>
> In the spirit of the GNU and Linux efforts, I think we, the F90 community,
> should join together to produce a portable, free F90 code parser written
>in F90
> and use it to build tools such as this one.  Once the parser is in
>place, most
> of the tools (a pretty printer that produced TeX output, for example, or a
> "lint" type of program checker, etc).  If we all worked together on
>this, I bet
> we could do it in short order.  I think most of the work has already
>been done
> in various places, it's just a matter of packaging it all together in a
> consistent form, developing and documenting an API, and distributing it.
> <snip>

As I have an interest in parsing Fortran 90 I thought I should comment. I
have a strong suspicion that while much of the work has been done separately
the lack of coordination has resulted in code which will take almost as much
effort to integrate as it would take to develope it from scratch. Further, I
have a strong suspicion that much of the code has been written in C and is
not highly portable.

I would still encourage the pursuit of this project. I would  suggest that we
accept code in other languages where ever necessary, but require Fortran
compatible file formats (perhaps using f2c for file I/O), relatively simple
API's for such codes (so that Fortran bindings are not onerous), and think
about creating true F90 replacements in the long term.

As I view this, this project is about creating tools usefull for Fortran
programmers, with an emphasis on F90/95 programmers, and an emphasis on tools
related to parsing Fortran. Such parsing related tools might include a
regular expression package, a parser generator, a parser, a Fortran source to
source translator, a Fortran source code checker (lint), a g77 like compiler,
a better C2F translator, etc, It is possible that such a project might
eventually include non-parser related codes. Of the projects that I identify
above:

1. Regular expression package: One of the most common parsing tasks involves
the parsing of regular expressions. There does not appear to be a well
establishe Fortran based package for this task. There was an article in a
recent ACM journal, I believe Transactions on Programming Languages, that
discussed in detail the characteristics of the ideal regular expression
package. It appears that most (all?) widely available such packages are not
as robust or flexible as the ideal. I believe that this article could serve
as the basis of the developement of a strong Fortran 90 based regular
expression package.

2. Parser generator: One of the reasons for the lack of Fortran parsers is
the lack of tools that facilitate the construction of such parsers. It should
be possible to create such a tool based on pre-existing C/C++/Java code. Such
tools (I cite only freely available tools) include

    A. Lex/YACC: perhaps the best known such tool with numerous variants,
FLEX, YACC++, etc. These are based on LALR(1) parsing technology. The LALR
implies bottom up parsing, which can be difficult to understand, the (1)
implies that it can easilly handle only lookaheads of one token which means
it is not well suited for complex grammars.

    B. PCCTS/ANTLR: The Purdue compiler construction tool set was originally
created to facilitate the parsing of Fortran for an Army funded project. It
was originally written in C, but the main tool, ANTLR, has been rewritten in
Java and now incorporates most of the functionality of the rest of the
toolset. It uses LL(k) parsing technology. The LL implies top down parsing,
which is typically easier to understand than LALR parsing but can typically
handle a smaller set of grammars at a given amount of lookahead. The (k)
implies that it can in principle handle lookaheads of arbitrary numbers of
tokens (it uses a special algorith to simplify processing for such cases).
The higher lookahead makes it more suitable for complex grammars. It has its
own newsgroup, comp.compilers.tools.pccts.

    C. PRECCX: The Prettier Compiler constructor extended. I know little
about this but I believe it is written in C and accepts LL(k) grammars and
generates output for processing by YACC. It is supported by a group based in
the UK.

    D. ELI: A compiler generator written in C. I believe it accepts LL(k)
grammars. It is supported primarilly  by a group based at the University of
Colorado, under William Waite, in cooperation with Australian and German
academics. It relies on a large number of other C based tools for
intermediate processing, e.g., Funnelweb, Tcl/Tk, (YACC?), etc., and appears
to be strongly tied to Unix.

    E. Cocktail: Only partly in the public domain. I believe current
non-public domain versions accept LALR(k) grammars, and generate either C++,
Modula 2, or Oberon code.

Of the above compilers I suspect that YACC or ANTLR most likely have the
appropriate combination of simplicity and flexibility to serve as a basis for
a Fortran compiler generator. 

3. Parser: I know of only one apparently freely available parser for Fortran
90, William Waite's parser for Eli. Because of Eli's strong reliance on other
tools and lack of portability outside the Unix world, I would be reluctant to
recommend the direct use of this parser. However, Waite's paper describing
the parser should serve as a guide to the creation of a parser, either
handwritten or using a tool such as PCCTS.

4. The utilization of a parser for a source to source translator or a general
purpose compiler requires the definition of an AST (abstract syntax tree). It
would be best to define a common form for such transformations, which
suggests that we whould be aware of the forms used by some potential
backends. As perhaps the most widely used backend is that of gcc we should
have someone investigate its requirements.

5. We will also need specification of the parser's equivalent of a .mod file
for the compiler, lint, etc.





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

December 2023
February 2023
November 2022
September 2022
February 2022
January 2022
June 2021
November 2020
September 2020
June 2020
May 2020
April 2020
December 2019
October 2019
September 2019
March 2019
February 2019
January 2019
November 2018
October 2018
September 2018
August 2018
July 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
December 2015
November 2015
October 2015
September 2015
August 2015
June 2015
April 2015
March 2015
January 2015
December 2014
November 2014
October 2014
August 2014
July 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
July 2013
June 2013
May 2013
April 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
August 2010
July 2010
June 2010
March 2010
February 2010
January 2010
December 2009
October 2009
August 2009
July 2009
June 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager