By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,058 Members | 1,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,058 IT Pros & Developers. It's quick & easy.

parsing fortran

P: n/a
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)

Nov 24 '06 #1
Share this Question
Share on Google+
12 Replies


P: n/a

pu**********@gmail.com wrote:
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)
Sorry, but No.

Just as no one at a Ford dealership can provide you with the repair
manuals for your Subaru SUV, fortran is completely off-topic in
comp.lang.c

In addition to that, we don't do other peoples homework for them, and
we aren't a source-code supply shop.

Sorry

--
Lew

Nov 24 '06 #2

P: n/a
pu**********@gmail.com wrote:
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)
How many thousands of Euros will you pay me for this?

Richard
Nov 24 '06 #3

P: n/a
pu**********@gmail.com wrote:
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)
The source code of g95 is at http://ftp.g95.org/g95_source.tgz , and
that of gfortran (part of gcc) is at
http://quatramaran.ens.fr/~coudert/g...cc-svn.tar.bz2 . Both g95
and gfortran are Fortran 95 compilers written in C. I suggest
continuing this thread in comp.lang.fortran if necessary.

Nov 24 '06 #4

P: n/a

<pu**********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)
There's an open-source Basic interpreter on my website which will get you
started in the language parsing game. There is also an associated book - you
have to pay for a copy, I'm afraid, but it's not expensive.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.
Nov 25 '06 #5

P: n/a
pu**********@gmail.com wrote:
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)
Ask in comp.lang.fortran or comp.compilers.

Nov 25 '06 #6

P: n/a
In article <Wc********************@bt.com"Malcolm" <re*******@btinternet.comwrites:
<pu**********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)
There's an open-source Basic interpreter on my website which will get you
started in the language parsing game. There is also an associated book - you
have to pay for a copy, I'm afraid, but it's not expensive.
Parsing Fortran is not exactly trivial. You need a lot of look-ahead.
For instance, when you see the initial part of a line as:
REALR(5)
you do not yet know whether it is a declaration or a statement. Is it
a declaration of the array R of 5-elements of REAL's or is it an
assignment to the 5-th element of the array REALR? And as keywords are
not reserved, it is possible to have the following declaration:
REALREAL
which declares REAL as a variable of type REAL.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Nov 26 '06 #7

P: n/a

"Dik T. Winter" <Di********@cwi.nlwrote in message
news:J9********@cwi.nl...
In article <Wc********************@bt.com"Malcolm"
<re*******@btinternet.comwrites:
<pu**********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)
>
There's an open-source Basic interpreter on my website which will get
you
started in the language parsing game. There is also an associated book -
you
have to pay for a copy, I'm afraid, but it's not expensive.

Parsing Fortran is not exactly trivial. You need a lot of look-ahead.
For instance, when you see the initial part of a line as:
REALR(5)
you do not yet know whether it is a declaration or a statement. Is it
a declaration of the array R of 5-elements of REAL's or is it an
assignment to the 5-th element of the array REALR? And as keywords are
not reserved, it is possible to have the following declaration:
REALREAL
which declares REAL as a variable of type REAL.
It's a lot harder to parse someone else's language specification than to
make up your own as you go along, which was partly why MiniBasic is my own
flavour of BASIC - very recognisable, but with a few quirks.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.

Nov 26 '06 #8

P: n/a
On Nov 25, 7:33 am, "santosh" <santosh....@gmail.comwrote:
purushota...@gmail.com wrote:
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)Ask in comp.lang.fortran or comp.compilers.
Alternatively, you could investigate "The classification of FORTRAN
statements" by Arthur Sale, available at
http://eprints.utas.edu.au/122/. I have implemented this algorithm
(actually the modified version as described in "A Modification of
Sale's Algorithm to Accommodate FORTRAN 77" by J. K. Slape and Peter J.
L. Wallis) and I don't mind sharing it with you if you can convince me
this is not homework. What exactly are you trying to do?

Nov 26 '06 #9

P: n/a
jburgy wrote:
On Nov 25, 7:33 am, "santosh" <santosh....@gmail.comwrote:
purushota...@gmail.com wrote:
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)Ask in comp.lang.fortran or comp.compilers.

Alternatively, you could investigate "The classification of FORTRAN
statements" by Arthur Sale, available at
http://eprints.utas.edu.au/122/. I have implemented this algorithm
(actually the modified version as described in "A Modification of
Sale's Algorithm to Accommodate FORTRAN 77" by J. K. Slape and Peter J.
L. Wallis) and I don't mind sharing it with you if you can convince me
this is not homework. What exactly are you trying to do?
Why don't you address the OP?

Nov 26 '06 #10

P: n/a

<pu**********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)
There is a Fortran parser in GCC but that probably does not answer your
question. Which version of Fortran. If its "old" Fortran 77 then its tricky
as spaces are ignored most places except strings. There are no reserved
words so for example this is legal Fortran 77...

r e a l r e a l
real read(6),format(2)
format(1)=6
write(6,1)format(1)
1 f o r m a t ('1', F6.1)
s t o p
e n d


Nov 27 '06 #11

P: n/a
"David Wade" <g8***@yahoo.comwrites:
<pu**********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
>Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)

There is a Fortran parser in GCC but that probably does not answer your
question. Which version of Fortran. If its "old" Fortran 77 then its tricky
as spaces are ignored most places except strings. There are no reserved
words so for example this is legal Fortran 77...

r e a l r e a l
real read(6),format(2)
format(1)=6
write(6,1)format(1)
1 f o r m a t ('1', F6.1)
s t o p
e n d
My favourite: setting the variable called DO10I = 1.5 is only
detectably not a loop (DO 10 I = 1,5) at the ".". We have come a long
way.

--
Ben.
Nov 27 '06 #12

P: n/a
On Mon, 27 Nov 2006 00:48:21 -0000, "David Wade" <g8***@yahoo.com>
wrote:
>
<pu**********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
Hi Can anyone guide me by providing me the code ,for the following
requirement:
desining parser for fortran language(parsing fortran)

There is a Fortran parser in GCC but that probably does not answer your
question. Which version of Fortran. If its "old" Fortran 77 then its tricky
as spaces are ignored most places except strings. There are no reserved
words so for example this is legal Fortran 77... <snip example>
And in F90/95 and F03 the old 'fixed-form' is still provided, although
there is now the _option_ of 'free-form' that has normal lexing but
still has unreserved keywords, which are at least as bad for parsing
as C typedefs (and C++ classnames etc.).

- David.Thompson1 at worldnet.att.net
Dec 18 '06 #13

This discussion thread is closed

Replies have been disabled for this discussion.