|Implementation decision email@example.com (Michael Risse) (1998-09-22)|
|Re: Implementation decision firstname.lastname@example.org (1998-09-22)|
|Re: Implementation decision email@example.com (Quinn Tyler Jackson) (1998-09-26)|
|Re: Implementation decision firstname.lastname@example.org (Michael McKernan) (1998-09-26)|
|From:||Michael Risse <email@example.com>|
|Date:||22 Sep 1998 14:34:24 -0400|
|Keywords:||design, question, comment|
I am thinking about a question concerning the implementation of
I will describe my problem using the language C as an example.
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 ?
We can build some (or all?) of the constraints in the grammar.
This would result in a much bigger grammar.
Another way is for example writing down this analysis in the
attributed grammar ?
I think, that beside of this specific example, there are many
Has the compiler writer the freedom to decide how to implement
such constraints or is there a guide line that helps me to find
the best solution ?
Thanks for your attention,
[I'd do it semantically, either in the code that combines attributes or
ad-hoc. That lets you produce much better error messages, e.g., "invalid
addition of void and float" rather than "syntax error". -John]
Return to the
Search the comp.compilers archives again.