|Implementation decision firstname.lastname@example.org (Michael Risse) (1998-09-22)|
|Re: Implementation decision email@example.com (1998-09-22)|
|Re: Implementation decision firstname.lastname@example.org (Quinn Tyler Jackson) (1998-09-26)|
|Re: Implementation decision email@example.com (Michael McKernan) (1998-09-26)|
|From:||Michael McKernan <firstname.lastname@example.org>|
|Date:||26 Sep 1998 01:15:09 -0400|
Michael Risse <email@example.com> 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.
Return to the
Search the comp.compilers archives again.