Related articles |
---|
Symbol Table problems in Pascal languages family pjmlp@students.si.fct.unl.pt (1996-10-08) |
Re: Symbol Table problems in Pascal languages family buehlman@iwf.bepr.ethz.ch (1996-10-10) |
Re: Symbol Table problems in Pascal languages family luginb_c@simultan.ch (1996-10-15) |
Re: Symbol Table problems in Pascal languages family dlmoore@ix.netcom.com (David L Moore) (1996-10-15) |
Re: Symbol Table problems in Pascal languages family josuka@inf.deusto.es (1996-10-16) |
From: | David L Moore <dlmoore@ix.netcom.com> |
Newsgroups: | comp.compilers |
Date: | 15 Oct 1996 09:39:50 -0400 |
Organization: | Netcom |
References: | 96-10-022 |
Keywords: | parse, Pascal |
Paulo Jose Matos Lopes Pinto wrote:
>
> I'm trying to do a compiler for a language that derives from Pascal
> (Oberon).
> The problem is with the symbol table for types, because the types have to
> be type-name compatible and not structured compatible, that makes a bit hard
> to manipulate the builtin names,like CHAR, REAL, among others.
Possibly you are confusing the concept of a "name" with the concept of
an identifier. An identifier is just a character string which denotes a
name. For example:
type UCHAR = CHAR;
These types (CHAR and UCHAR) have different identifiers but the same name.
In practical terms, a name is just a pointer (to the compile-time
structure containing information about the type). So, to do name
equivalence, you can just compare pointers (though rep specs and other
pragmas can complicate this, depending upon the language, since just
copying the pointer does not allow a pragma to apply to one type and
not the other)
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.