Pascal compiler and sets (Dave Allison)
Tue, 8 Feb 1994 17:07:25 GMT

          From comp.compilers

Related articles
Pascal compiler and sets (1994-02-08)
Re: Pascal compiler and sets (1994-02-08)
Re: Pascal compiler and sets (1994-02-08)
Re: Pascal compiler and sets (1994-02-09)
Pascal compiler and sets (1994-02-09)
Sets in Pascal, etc. (1994-02-09)
Re: Pascal compiler and sets (1994-02-10)
[3 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Dave Allison)
Keywords: Pascal, question, comment
Organization: Compilers Central
Date: Tue, 8 Feb 1994 17:07:25 GMT


A few weeks ago I posted an article about writing a Pascal compiler which
generates a C parse tree. I have since (nearly) completed the said
compiler and have hit a problem with the implementation of sets.

How are sets usually implemented in Pascal? Is there a small limit placed
on the size of sets? I can think of a number of implementation methods,
but would like to see how it is normally done so that I dont have to do
much more work.

It turned out to be quite an easy task to write the lexical, syntax and
semantic analysers (about 24 hours work in all). There are a few nasties
in the Pascal syntax which make it more difficult than C in places.

I have noticed that there is a lot of noise words in the language which
are not really required. I modified an existing C and C++ compiler to
produce the Pascal one, and am amazed at the number of things that Pascal
doesn't have (like constant expressions) that I had to delete.

The next thing is a Modula-2 compiler. That looks like it is going to be
an even shorter job as it is almost identical to Pascal. I'll need a
co-routine library though, wonder where I can get one of those.

It's been fun doing it though.


David Allison Belfast Engineering Centre
CMIS Maintenance Wellington Buildings
ISG Design 4 Wellington Street
DDE21 Belfast BT1 6HX
Tel: +44 232 894297 UK
[It is my impression that sets are often limited to 32 members or whatever
the local word size is. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.