Re: Implementation decision

Michael McKernan <mck@pobox.com>
26 Sep 1998 01:15:09 -0400

          From comp.compilers

Related articles
Implementation decision trimaran@uni-paderborn.de (Michael Risse) (1998-09-22)
Re: Implementation decision dwight@pentasoft.com (1998-09-22)
Re: Implementation decision qjackson@wave.home.com (Quinn Tyler Jackson) (1998-09-26)
Re: Implementation decision mck@pobox.com (Michael McKernan) (1998-09-26)
| List of all articles for this month |

From: Michael McKernan <mck@pobox.com>
Newsgroups: comp.compilers
Date: 26 Sep 1998 01:15:09 -0400
Organization: Compilers Central
References: 98-09-103
Keywords: types, parse

Michael Risse <trimaran@uni-paderborn.de> writes:


> In declarations we have typespecifiers such as 'void', 'float',
> 'int', 'unsigned' etc. The programmer is not allowed to use these
> things in any desired combination. There are some constraints.
> My question is: How to implement these constraints ?
>


An early solution which is, I believe, still widely used is given in:


Arithmetizing Declarations: An Application to COBOL
Conway, M. E. Speroni, J. CACM January, 1963


The paper is undoubtedly hard to find, but the idea is
straightforward. One assigns numbers to the attributes and creates a
constant bit matrix such that each row represents an attribute and the
columns represent those attributes which conflict with it. During the
parsing of each declaration, a bit vector is created for the
attributes that are actually present, then in semantics, the logical
sum of the rows selected by the vector bits is formed. A non-zero
result indicates a conflict. The construct is commonly called a
consistency matrix, which term is probably from the original paper.
--


Post a followup to this message

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