Re: Why put type information into syntax?

Robert A Duff bobduff@world.std.com>
28 Mar 2000 01:05:47 -0500

          From comp.compilers

Related articles
Why put type information into syntax? across@vega.co.uk (Allister Cross) (2000-03-25)
Re: Why put type information into syntax? michael.prqa@indigo.ie (Michael Spencer) (2000-03-28)
Re: Why put type information into syntax? lex@cc.gatech.edu (2000-03-28)
Re: Why put type information into syntax? RobertADuffbobduff@world.std.com> (2000-03-28)
Re: Why put type information into syntax? tlh20@cam.ac.uk (Tim Harris) (2000-04-01)
Re: Why put type information into syntax? kst@cts.com (Keith Thompson) (2000-04-01)
Re: Why put type information into syntax? michael.prqa@indigo.ie (Michael Spencer) (2000-04-05)
Re: Why put type information into syntax? rod.bates@wichita.boeing.com (Rodney M. Bates) (2000-04-05)
Re: Why put type information into syntax? kst@cts.com (Keith Thompson) (2000-04-11)
Re: Why put type information into syntax? idbaxter@semdesigns.com (Ira D. Baxter) (2000-04-14)
[3 later articles]
| List of all articles for this month |

From: Robert A Duff bobduff@world.std.com>
Newsgroups: comp.compilers
Date: 28 Mar 2000 01:05:47 -0500
Organization: The World Public Access UNIX, Brookline, MA
References: 00-03-133
Keywords: parse

"Allister Cross" <across@vega.co.uk> writes:


> Does anyone know of any reasons why built-in type names should be
> incorporated in the syntax of a language.


They shouldn't.


>... I have been looking at the
> Java yacc grammar produced by Dmitri Bronnikov. This grammar contains
> a 'PrimitiveType' production containing the built-in types of
> 'BOOLEAN', 'CHAR' and so on.


Perhaps this has something to do with the fact that type names affect
the parsing, a misfeature that Java inherited from C. But I'm not
sure that really explains it.


>... What is the advantage off treating
> built-in types differently from user-defined types?? Would it not be
> better to treat all types uniformly, by not putting primitive types in
> the grammar, and resolving such typing issues during semantic
> analysis.


Yes, I think that makes for a cleaner language design.


- Bob


Post a followup to this message

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