Has anyone a lex/yacc specification for fortran? 
Author Message
 Has anyone a lex/yacc specification for fortran?

Has anyone already written a lexical analyzer and parser for fortran
that I could scavenge for a project I'm working on?

We're developing a set of utilities for automatically generating
module headers which include information about the variables used,
assigned, or just passing through fortran subprograms.

Incidentally, if something like this has already been done, and is
available *free*, please let me know.

_Chuck



Tue, 08 Nov 1994 01:58:47 GMT  
 Has anyone a lex/yacc specification for fortran?

Is anyone aware of 'reverse compilers' for _any_ sort of FORTRAN
object files?  I'm curious to know, for example, if I could extract
the original FORTRAN from a piece of code compiled with f77, or
MS FORTRAN 5.0.  Just curious...

--
-----------------------------------------------------------------------------
 Andrew Anselmo / Department of Mechanical Engineering / Columbia University  

Last of the V-8 Interceptors                Independently Owned and Operated.



Tue, 08 Nov 1994 14:10:55 GMT  
 Has anyone a lex/yacc specification for fortran?
   Is anyone aware of 'reverse compilers' for _any_ sort of FORTRAN
   object files?  I'm curious to know, for example, if I could extract
   the original FORTRAN from a piece of code compiled with f77, or
   MS FORTRAN 5.0.  Just curious...

Another in the never-ending "not clear on the concept" series.

In short, "no, it is simply not possible."

Please get some education about computers and languages before you do
yourself and your company some serious damage.$$
--

     "_What_ is going on here?"  "It's our memorial service."  "This?"
     "Why not?"  "I don't believe this.  They think we're dead, and
     they're having a party?"  (laughing) "Yeah, it's _perfect_!"



Tue, 08 Nov 1994 14:06:40 GMT  
 Has anyone a lex/yacc specification for fortran?

Quote:
>   Is anyone aware of 'reverse compilers' for _any_ sort of FORTRAN
>   object files?  I'm curious to know, for example, if I could extract
>   the original FORTRAN from a piece of code compiled with f77, or
>   MS FORTRAN 5.0.  Just curious...

>Another in the never-ending "not clear on the concept" series.

>In short, "no, it is simply not possible."

>Please get some education about computers and languages before you do
>yourself and your company some serious damage.$$
>--

>     "_What_ is going on here?"  "It's our memorial service."  "This?"
>     "Why not?"  "I don't believe this.  They think we're dead, and
>     they're having a party?"  (laughing) "Yeah, it's _perfect_!"

I really don't want to start a flame war, especially on a group that I find
to be quite useful, but the above comment kind of hit a sore spot.  I've been
working around and with computers for quite a long while; the reason why
I've posted this question is that I have seen some copyright notices that
state explicitly that 'reverse engineering' or 'un-compiling' of any object
files could be grounds for a lawsuit/some other type of legal action.  Good
grief, "before I do myself and my company some serious damage?" hell, without
tooting my horn _too_ much, I sometimes think that if I knew _less_ about
computers, I might have gotten my doctorate already (I'm kind of the de facto
sysop for Mechanical Engineering, and it sometimes can really take a bite
out of REAL work, like working on my CFD code!)

Any serious replies to the question of 'reverse compiling' would be welcomed.
Perhaps this question belongs in another newsgroup.  Thanks for any info.

--
-----------------------------------------------------------------------------
 Andrew Anselmo / Department of Mechanical Engineering / Columbia University  

Last of the V-8 Interceptors                Independently Owned and Operated.



Tue, 08 Nov 1994 21:54:59 GMT  
 Has anyone a lex/yacc specification for fortran?

A plea for a little bit less judgemental postings ....

It is not necessary to paint the questioner as unclear on the concept!

In point of fact, such tools have been written; from time to time. The
resulting code is not naturally easy to read (obscure comes to
mind...). There have been, in fact, special tools crafted to
disassemble things as diverse as CP/M and some large application codes ...

I am not aware of such tools targeting FORTRAN as the target language;
nor would I advise a shop to plan on selling one. I doubt the market
would be sufficiently large.

Folks like Hunter Systems (xlation of binaries for fun and profit)
probably have some very fine tools in this regard. But interesting
graphs and specialized intermediate languages are probably their
focus.

--
----------------------------------------------------------------

SunPro 2550 Garcia MTV 12-33             | (415 336 2648)  
Mountain View, CA 94043  <speaking for myself, not Sun*> Copyright 1992



Tue, 08 Nov 1994 19:39:40 GMT  
 Has anyone a lex/yacc specification for fortran?

Quote:

>>   Is anyone aware of 'reverse compilers' for _any_ sort of FORTRAN
>>   object files?  I'm curious to know, for example, if I could extract
>>   the original FORTRAN from a piece of code compiled with f77, or
>>   MS FORTRAN 5.0.  Just curious...

                <rather {*filter*} previous reply cut>

Quote:

>Any serious replies to the question of 'reverse compiling' would be welcomed.
>Perhaps this question belongs in another newsgroup.  Thanks for any info.

It would be impossible to get original source code out of an executable. When
people talk about decompiling and reverse engineering an execuatable, they mean
using a disassembler and getting the assemby instructions out (without any
comments). These are extremely difficult to understand (read: impossible).

                        Ed Hartnett



Wed, 09 Nov 1994 04:21:50 GMT  
 Has anyone a lex/yacc specification for fortran?

Quote:
> Is anyone aware of 'reverse compilers' for _any_ sort of FORTRAN
> object files?  I'm curious to know, for example, if I could extract
> the original FORTRAN from a piece of code compiled with f77, or
> MS FORTRAN 5.0.  Just curious...
> --
>  Andrew Anselmo / Department of Mechanical Engineering / Columbia University

> Last of the V-8 Interceptors                Independently Owned and Operated.

   A previous poster was correct.  It's purt-near impossible
to generate "FORTRAN" from an executable (.EXE) or an ojbect
(.OBJ).
    However, there are reverse ASSEMBLERS for many computers.
Most De{*filter*}s have reverse assemblers as part of the package.
   You could take your executable/object and generate
ASSEMBLY source code from it.
   I even know where you can get shareware reverse-ASSEMBLERS
for MS-DOS.  Call Public Brand Software at 1-800-426-3475
and ask for Disk # AL4.0.  They are also called "disassemblers".  
   If you "have to" reverse engineer a program, or reverse-
compile it, you'd be better off just writing it over from
scratch.  It would take less time and cost less money writing
it over again from scratch.  Or, if you are just trying to
avoid buying the original source code, I'd recommend buying
the original source code.  You'll end up spending less money
that way too.
    What the previous poster was referring to, is that
you are basically asking the wrong question in the first place.
Please share with us what you are trying to accomplish in
the first place. I.E., *why* do you need to reverse-compile?
Us gentle-readers might very well come up with a better solution
to help you "get there from here."

--
Dave Appel
The Grafted Branch BBS
317-881-4369

uucp: ..!uunet!grafted.UUCP!dappel
 = = Grafted Branch BBS (317) 889-6997 2 Gig on-line = =



Wed, 09 Nov 1994 09:01:16 GMT  
 Has anyone a lex/yacc specification for fortran?

Quote:
>                                                           the reason why
> I've posted this question is that I have seen some copyright notices that
> state explicitly that 'reverse engineering' or 'un-compiling' of any object
> files could be grounds for a lawsuit/some other type of legal action.

As you know, V Communication, Inc. in USA has a well-known "Commenting
Disassembler: SOURCER" which can generate assembler code for a specified
( Microsoft's or Borland's or OPTASM's ) assembler system with human
readable commetnts. This disassembler utilizes, I guess, the characteristics
of output codes of each assembler system. It can also analize BIOS call and
I/O port access.


Quote:
> In point of fact, such tools have been written; from time to time.

One of my friend have written a reverse compiler for some C compilers
on PC.
Key points of such tools are for example:
 1) Target codes are limited into object codes  generated by the specified
    compiler. So the reverse compiler can infer the original code using
    the characteristics of the compiler.
 2) Pragmatism. You must expect that only some significant part of the target
    code is reverse-compiled leaving the rest unanalyzed.
 3) Of course, reverse-compiled code is NOT the original code. It is only
    a compiler input code, and a good reverse-compiler may generate somewhat
    human readable source codes.
 4) Non-stripped codes with de{*filter*} informations are easy to be analyzed.

Anyway, such tools including "SOURCER" may violate copyrights of some
person or company. I wish everybody never to want to use or make such tools
as a fun.

--
  Satoshi Fushimi   Information & Mathematical Science Lab. Inc.    Tokyo

               fax: +81-3-3590-5353  phone: +81-3-3590-5211



Fri, 11 Nov 1994 21:10:40 GMT  
 Has anyone a lex/yacc specification for fortran?

Quote:

>>   Is anyone aware of 'reverse compilers' for _any_ sort of FORTRAN
>>   object files?  I'm curious to know, for example, if I could extract
>>   the original FORTRAN from a piece of code compiled with f77, or
>>   MS FORTRAN 5.0.  Just curious...

[Stuff deleted]
>Any serious replies to the question of 'reverse compiling' would be welcomed.
>Perhaps this question belongs in another newsgroup.  Thanks for any info.

Back in the mid to late 60's, when DATAMATION was interesting, there was
an article about such a thing having been done.  I believe that Lockheed
was replacing their IBM 7094's with Univac 1108's.  Since the source for
quite a few binaries had been lost, was heavily patched, etc., a 7094
binary to Fortran source tool was developed to help in the conversion
process.  I hope this will establish your historical precedance.

Vince.

Quote:
>--
>-----------------------------------------------------------------------------
> Andrew Anselmo / Department of Mechanical Engineering / Columbia University  

>Last of the V-8 Interceptors                Independently Owned and Operated.



Fri, 11 Nov 1994 21:57:09 GMT  
 Has anyone a lex/yacc specification for fortran?

Quote:


>>                                                           the reason why
>> I've posted this question is that I have seen some copyright notices that
>> state explicitly that 'reverse engineering' or 'un-compiling' of any object
>> files could be grounds for a lawsuit/some other type of legal action.

   [ deleted ]


>> In point of fact, such tools have been written; from time to time.

>One of my friend have written a reverse compiler for some C compilers
>on PC.
>Key points of such tools are for example:
> 1) Target codes are limited into object codes  generated by the specified
>    compiler. So the reverse compiler can infer the original code using
>    the characteristics of the compiler.
> 2) Pragmatism. You must expect that only some significant part of the target
>    code is reverse-compiled leaving the rest unanalyzed.
> 3) Of course, reverse-compiled code is NOT the original code. It is only
>    a compiler input code, and a good reverse-compiler may generate somewhat
>    human readable source codes.
> 4) Non-stripped codes with de{*filter*} informations are easy to be analyzed.

>Anyway, such tools including "SOURCER" may violate copyrights of some
>person or company. I wish everybody never to want to use or make such tools
>as a fun.

  Not that this group is so volume laden that it couldn't handle the
additional traffic, but I think this has strayed pretty far from Fortran
and there are more appropriate forums for a further discussion. However...

  I think that anyone would have a tough time making a legal case against
anyone for just decompiling a program. Even copyright laws have large
loopholes allowing copies to be made for personal - i.e. non commercial
use. It really depends on what you do with the result of the 'copying'
process as to whether you have violated some law or become liable (note
the 'may' in those warnings). It also depends on whether the court
interprets the machine-language as an expression of an idea, which is
copyrightable, or as some other form which isn't. It might restrict
the copyright to the original source language form, though that would
be rather a narrow interpretation and also seem to exclude foreign
language translations of human-readable works from protection.

  Note that if the program incorporates patented concepts, then any
exploutation of the reverse-enginneered program would probably not
be in such a grey area, since in patents the idea/concept itself is
protected.

--
Jeff Sicherman
up the net without a .sig



Sat, 12 Nov 1994 02:05:59 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Modula 2 - Lex / Yacc specifications

2. COBOL YACC/LEX specification wanted

3. FORTRAN lex and yacc

4. lex yacc fortran description

5. Looking for fortran lex/yacc combination

6. LEX and YACC based parser for FORTRAN

7. SW Tools for Analysis of Fortran Programs (lex/yacc/lint)

8. Q: Lex&YACC smalltalk version ?

9. awk lex yacc (beginner question)

10. LEX and YACC in Smalltalk

11. lex/yacc

12. Lex & Yacc for Smalltalk

 

 
Powered by phpBB® Forum Software