RE: Writing a Fortran parser...

meek_at_skyway.usask.ca
Date: 08/26/04


Date: 26 AUG 04 08:56:07 GMT

In a previous article, Rich Townsend <rhdt@barVOIDtol.udel.edu> wrote:
>Hi all --
>
>I've recently been kicking around the idea of writing a (limited)
>Fortran 77/90/95 parser, since I'm wanting to write a set of toolbox
>utilities to perform preprocessing & dependency checking (yes, I know
>stuff already exists, but it doesn't meet my needs...).
>
>After a little digging, I found a c.l.f post by James Giles claiming
>that Fortran is LR(1), which gave me hope. However, further digging
>seemed to suggest that things are rather more compilicated than that.
>Can anyone offer any advice or insights?
>
>While on this subject, would everyone mind try to compile the following
>program:
>
>program foo
> i = 1
> if(i > 0) then j = 1.23456
> print *,thenj
>end program foo
>
>My experience so far:
>
>Lahey 6.2b for Linux : OK
>NAG 4.0a (304) for Linux : fails
>Intel 8.0.50 for Linux : fails
>Compaq 5.5-1877 for Tru64 : fails
>Sun 7.1 Patch 112762-10 for Solaris : fails
>
>Note: I'm aware that many of these compilers are out of date; I was just
>conducting a quick poll of the tools I had to hand...
>
>With this nasty little example in mind, what are the rules governing the
>appearance of blanks in source code?
>
>cheers,
>
>Rich
  You might want to try
    if(i.gt.0)j=1.2

( i.e. without the "then")
Chris



Relevant Pages

  • Re: I want to make a C# library of some classes
    ... compile the BaseParser with the generated library - seems too simple for me ... so the second thing that comes into my mind is to let them ... makes our class work to make their class work, ... would actually compile in C as well as C++. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: macro question
    ... be negative numbers and create an exponential moving average. ... is a snippet of what I had in mind. ... No I didn't try to compile it. ...
    (comp.lang.c)
  • Re: Handling Bugs
    ... Keep in mind that while you can compile your code before you distribute it ... Keep in mind that any un- handled error in the runtime is a much ... but in the runtime those un-handled errors does not ... So, the issue of making sure one's code having compile errors is important, ...
    (microsoft.public.access.formscoding)
  • Re: How to RUN C by Microsoft Visual Studio =?UTF-8?B?6YG46aCF?=
    ... Does somebody know how to compile, ... Well, your program is started, it creates a console window, does whatever it ... Set a breakpoint near the end (F9 toggles breakpoints for a line). ... Wait for the user to press a key (getc comes to mind). ...
    (microsoft.public.vc.language)
  • Re: Carrier Infinity HP
    ... Actually I do have about 10 remotes on my coffee table, so I don't mind ... digging through instructions. ... Hopefully it is an intuitive interface. ...
    (alt.home.repair)