|Algol 60 Syntax email@example.com (2000-01-12)|
|Re: Algol 60 Syntax firstname.lastname@example.org (Andreas von Gorup) (2000-01-15)|
|Re: Algol 60 Syntax email@example.com (2000-01-15)|
|Re: Algol 60 Syntax firstname.lastname@example.org (Munk, ir. H.) (2000-01-15)|
|Re: Algol 60 Syntax email@example.com (2000-01-15)|
|Re: Algol 60 Syntax firstname.lastname@example.org (2000-01-15)|
|Re: Algol 60 Syntax email@example.com (Steve Ross) (2000-01-15)|
|[5 later articles]|
|From:||firstname.lastname@example.org (Dan Sutton)|
|Date:||12 Jan 2000 03:50:28 -0500|
|Keywords:||algol60, parse, question|
I've written a compiler which contains a parser which works by
interpreting a Backus-Naur form syntax table, and hence, should be
able to compile anything. At the moment it's working with a language
I wrote to allow you to describe the structure of two databases and
have it write a program to transfer data from one to the other (works
out the hierarchies of the tables and everything).
Anyhow, the parser is the first stage of my ultimate goal, which is to
write a compiler which can compile any language into assembler, or
machine code, or whatever, using rules it finds in a configuration
file somewhere: it seems to me that the compiler will have a built-in
FORTH-like syntax, the vocabulary of which should allow the
description of just about anything (procedure headers, locals, etc.) -
obviously, the thing will be limited as to what it can do by what it
knows internally, but I guess that if I play my cards right, I may
even be able to describe some things in terms of others (procedures
are like functions except that functions return values, etc.) --
anyhow, the whole "universal compiler" thing has always been supposed
to be impossible but I know how to do it, so now it
Now then: to prove that this thing works, I want to write an Algol-60
compiler with it, at first, basically because who the hell hasn't
written a FORTH compiler already, anyway, and Algol-60 is about the
simplest block-structured language I can think of (give or take that
tricky FOR-loop construction).
My problem is that I can't seem to lay my hands on the syntax
definition for Algol-60 ANYWHERE - It'd be really nice if I could,
because the original (Modified Report on the programming language
Algol-60) was written using a BNF-type thing (actually, I think BNF
was developed specifically in order to describe Algol-60).
So: Does anyone out there have a copy of the bloody syntax definitions
for this language? If so, I'd be extremely appreciative if they could
email them to me (I don't care about the format: even scanned in
pictures of the paper documents would do) so that I can enter them
into this parser and see what the hell it generates.
Of course, if I can write this, the applications are endless: it seems
to me that if I can make it take, say, a Pascal program and convert it
into its internal tokenised FORTH-like language, I should be able get
it to reverse-engineer that into C source code (or Algol, or anything
else, just about) since its internal language will be pretty much
source and object independent, and should therefore be able to produce
either source in any language (assuming that it's possible to write
the program in the language in the first place) or object code without
having either available for reference, which gives us a universal
translator/reverse engineering tool...
..I do not, therefore, intend to write a COBOL compiler with it!
[The Algol60 BNF was published in the CACM in the early 1960s, and I think
was reprinted in an anniversary issue more recently. If you write an
Algol60 compiler, be sure it does the right thing with Jensen's device.
Return to the
Search the comp.compilers archives again.