|
|
Up |
|
|
  |
Author: GerryGerry Date: May 22, 2008 12:13
The Gray parser generator, written by Anton Ertl, takes the
grammar specification for a target language and generates a
parser for that language by directly compiling executable code
for the parser. This parser will then compile a program written
in the target language. As such Gray is an on-line tool as it
must be present whenever a target language program is compiled
and executed.
I've modified the code generation part of Gray to generate a
parser as Forth source code thereby making Gray an off-line tool
i.e. the generated parser may then be run independently of Gray.
I've tested it with the simple examples contained in the Gray
distibution and with simple examples of my own.
Does anyone have or know of a moderately complex Gray
application that I can feed into this tool in order to give it a
more severe test and improve confidence in its operation?
Gerry
|
| |
|
| | 13 Comments |
|
  |
Author: Marcel HendrixMarcel Hendrix Date: May 22, 2008 13:09
Gerry jackson9000.fsnet.co.uk> writes Re: Modified version of the Gray parser generator
[..]
> Does anyone have or know of a moderately complex Gray
> application that I can feed into this tool in order to give it a
> more severe test and improve confidence in its operation?
I could send you my PL1 language with (i)Forth backend. It uses
Gray, but I don't know if it tracks with the latest version.
It might not be easy to make it run, but it will test everything :-)
Here's a piece of PL1:
-- The standard Sieve ---------------------------------------------
anew -work PL/1
(* PL/1; the infamous Sieve *)
PROGRAM Sieve;
CONST
size=8190;
|
| Show full article (1.41Kb) |
|
| | no comments |
|
  |
Author: GerryGerry Date: May 22, 2008 23:26
On 22 May, 21:09, m...@iae.nl (Marcel Hendrix) wrote:
> Gerry jackson9000.fsnet.co.uk> writes Re: Modified version of the Gray parser generator
> [..]
>
>> Does anyone have or know of a moderately complex Gray
>> application that I can feed into this tool in order to give it a
>> more severe test and improve confidence in its operation?
>
> I could send you my PL1 language with (i)Forth backend. It uses
> Gray, but I don't know if it tracks with the latest version.
>
> It might not be easy to make it run, but it will test everything :-)
>
[snip]
>
> I can send the files if you like the challenge.
>
Yes that seems to be what I am looking for. I'd be grateful if you
could send me the files and I'll see what I can do with them.
|
| Show full article (0.77Kb) |
| no comments |
|
  |
Author: Anton ErtlAnton Ertl Date: May 23, 2008 10:38
Gerry jackson9000.fsnet.co.uk> writes:
>The Gray parser generator, written by Anton Ertl, takes the
>grammar specification for a target language and generates a
>parser for that language by directly compiling executable code
>for the parser. This parser will then compile a program written
>in the target language. As such Gray is an on-line tool as it
>must be present whenever a target language program is compiled
>and executed.
>
>I've modified the code generation part of Gray to generate a
>parser as Forth source code thereby making Gray an off-line tool
>i.e. the generated parser may then be run independently of Gray.
Why do you want to do that?
I think that the possibility to generate executable code is one of the
cool features of Forth, and Gray demonstrates this nicely.
|
| Show full article (1.85Kb) |
| no comments |
|
  |
Author: Anton ErtlAnton Ertl Date: May 23, 2008 10:56
mhx@iae.nl (Marcel Hendrix) writes:
>Gerry jackson9000.fsnet.co.uk> writes Re: Modified version of the Gray parser generator
>[..]
>> Does anyone have or know of a moderately complex Gray
>> application that I can feed into this tool in order to give it a
>> more severe test and improve confidence in its operation?
>
>I could send you my PL1 language with (i)Forth backend.
>It uses
>Gray, but I don't know if it tracks with the latest version.
Gray has remained very stable in the last 15 years or so (basically
ever since it was converted to Forth-94). Of course, if you
iForthized it, all bets are off.
|
| Show full article (1.09Kb) |
| 3 Comments |
|
  |
Author: GerryGerry Date: May 23, 2008 13:19
> Gerry jackson9000.fsnet.co.uk> writes:
>>The Gray parser generator, written by Anton Ertl, takes the
>>grammar specification for a target language and generates a
>>parser for that language by directly compiling executable code
>>for the parser. This parser will then compile a program written
>>in the target language. As such Gray is an on-line tool as it
>>must be present whenever a target language program is compiled
>>and executed.
>
>>I've modified the code generation part of Gray to generate a
>>parser as Forth source code thereby making Gray an off-line tool
>>i.e. the generated parser may then be run independently of Gray.
>
> Why do you want to do that?
>
First let me say that I have no wish to denigrate Gray at all, its a
nice application that works well. I can think of several reasons for
doing what I have (not all of which apply to me):
|
| Show full article (4.21Kb) |
| no comments |
|
  |
Author: Marcel HendrixMarcel Hendrix Date: May 23, 2008 13:35
> mhx@iae.nl (Marcel Hendrix) writes:
>>Gerry jackson9000.fsnet.co.uk> writes Re: Modified version of the Gray parser generator
>>[..]
>>> Does anyone have or know of a moderately complex Gray
>>> application that I can feed into this tool in order to give it a
>>> more severe test and improve confidence in its operation?
>>I could send you my PL1 language with (i)Forth backend.
Of course not, I'm not a masochist :-)
>>It uses
>>Gray, but I don't know if it tracks with the latest version.
> Gray has remained very stable in the last 15 years or so (basically
> ever since it was converted to Forth-94). Of course, if you
> iForthized it, all bets are off.
|
| Show full article (1.45Kb) |
| no comments |
|
  |
Author: Anton ErtlAnton Ertl Date: May 24, 2008 01:16
Gerry jackson9000.fsnet.co.uk> writes:
>> Gerry jackson9000.fsnet.co.uk> writes:
>>>I've modified the code generation part of Gray to generate a
>>>parser as Forth source code thereby making Gray an off-line tool
>>>i.e. the generated parser may then be run independently of Gray.
>>
>> Why do you want to do that?
...
>2. It ought to be easier to embed a standalone parser in another
>application e.g. it hasn't been too difficult to generate a
>conventional BNF parser as a front-end to Gray.
I think it's harder. Now you have an extra generate step that you
have to manage.
>3. If speed is critical a Forth system generating optimised machine
>code can be used to compile the standalone parser
The same is true for the generate-on-startup parser.
|
| Show full article (3.54Kb) |
| no comments |
|
  |
Author: Anton ErtlAnton Ertl Date: May 24, 2008 02:06
mhx@iae.nl (Marcel Hendrix) writes:
>> mhx@iae.nl (Marcel Hendrix) writes:
>>>It uses
>>>Gray, but I don't know if it tracks with the latest version.
>
>> Gray has remained very stable in the last 15 years or so (basically
>> ever since it was converted to Forth-94). Of course, if you
>> iForthized it, all bets are off.
>
>Well, I fine-tooth-combed one of the first versions for alignment issues
>so that it could run on the transputer. AFAIR, a later version did not run,
>so I am being careful here.
Yes, the first version was developed on a 68020-based machine, so I
could not test for alignment issues and did not program for them.
However, looking in the RCS, I see that I checked in an
alignment-clean version in 1993, so that has been fixed since then.
>I don't 'iForthize' programs that I think that are perfect.
|
| Show full article (1.53Kb) |
| no comments |
|
  |
|
|
  |
Author: Anton ErtlAnton Ertl Date: May 24, 2008 04:09
>However, looking in the RCS, I see that I checked in an
>alignment-clean version in 1993, so that has been fixed since then.
And actually it already says in the CHANGES file of Release 2:
|Gray now runs on computers with memory alignment restrictions, too.
The dates of all files in that directory are June 28 1991.
- anton
|
| |
| no comments |
|
|
|
|