Re: Pascal compiler and sets

mauney@adm.csc.ncsu.edu (Jon Mauney)
Tue, 8 Feb 1994 22:13:23 GMT

          From comp.compilers

Related articles
Pascal compiler and sets dallison@bfsec.bt.co.uk (1994-02-08)
Re: Pascal compiler and sets davisdm@widget.msfc.nasa.gov (1994-02-08)
Re: Pascal compiler and sets mauney@adm.csc.ncsu.edu (1994-02-08)
Re: Pascal compiler and sets samiam@netcom.com (1994-02-09)
Pascal compiler and sets ssimmons@convex.com (1994-02-09)
Re: Pascal compiler and sets stenuit@axp05.acset.be (1994-02-10)
Re: Pascal compiler and sets wjw@eb.ele.tue.nl (1994-02-10)
Re: Pascal compiler and sets synaptx!thymus!daveg@uunet.UU.NET (Dave Gillespie) (1994-02-10)
| List of all articles for this month |
Newsgroups: comp.compilers
From: mauney@adm.csc.ncsu.edu (Jon Mauney)
Keywords: Pascal
Organization: NCSU
References: 94-02-051
Date: Tue, 8 Feb 1994 22:13:23 GMT

dallison@bfsec.bt.co.uk (Dave Allison) writes:
>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 is my impression that sets are often limited to 32 members or whatever
>the local word size is. -John]


Back in about 1980, when I was writing my parser generators in Pascal, I
found considerable variation among compilers with respect to set
implementation. I used the 'set' type extensively for things like First
and Follow.


Compiler A placed a small upper limit on the cardinality of the set, so I
used 'packed array of boolean' instead. Compiler B did not pack arrays,
and at 1 byte per element, my set wouldn't fit into the small amount of
available memory. But compiler B had a very high limit on the size of a
set. So my code has two implementations of First and Follow, with and
without sets.


There may be some technique that is more common than others, but I doubt
that there is any truly typical implementation.
--
Jon Mauney mauney@csc.ncsu.edu
Mauney Computer Consulting (919) 828-8053
--


Post a followup to this message

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