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: | josuka@inf.deusto.es (JosuKa Diaz Labrador) |
Newsgroups: | comp.compilers |
Date: | 16 Oct 1996 17:34:20 -0400 |
Organization: | Universidad de Deusto |
References: | 96-10-022 |
Keywords: | Oberon, Pascal, parse, types |
pjmlp@students.si.fct.unl.pt (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.
First, this is the only problem of name compatibility; normally, to
implement name compatibility is easier that to implement structural
compatibility.
> I decided to create symbols that relate with them, but this solution is a
>problem if the user decides to create an identifier with the same name that
>a builtin symbol.
> Some help would be welcome.
You have to put "standard names" (as 'char', 'real', 'write', 'true',
and so on) "in a block that surrounds the whole program" (I think I
quote quasi literally Wirth, User Manual&Report). So, when the program
(globally, indeed) redefines 'integer', this redefiniton is in the
program (or some subprogram) block, not in the standard block. You
have to care: when a thing is of type 'integer', as the constant 123,
you have to assign it the correct type, that of the standard block.
------------------------------------------------------------
| JosuKa Diaz Labrador | josuka@inf.deusto.es |
| Dpto. Lenguajes y Sistemas | Apartado 1 |
| Informaticos | 48080 - BILBAO - SPAIN |
| Facultad de Informatica | Tel. 34.4.445.31.00 x2609 |
| Universidad de Deusto | Fax. 34.4.445.14.08 |
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.