|Symbol Table problems in Pascal languages family email@example.com (1996-10-08)|
|Re: Symbol Table problems in Pascal languages family firstname.lastname@example.org (1996-10-10)|
|Re: Symbol Table problems in Pascal languages family email@example.com (1996-10-15)|
|Re: Symbol Table problems in Pascal languages family firstname.lastname@example.org (David L Moore) (1996-10-15)|
|Re: Symbol Table problems in Pascal languages family email@example.com (1996-10-16)|
|From:||firstname.lastname@example.org (JosuKa Diaz Labrador)|
|Date:||16 Oct 1996 17:34:20 -0400|
|Organization:||Universidad de Deusto|
|Keywords:||Oberon, Pascal, parse, types|
email@example.com (Paulo Jose Matos Lopes Pinto) wrote:
> I'm trying to do a compiler for a language that derives from Pascal
> 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
> 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 | firstname.lastname@example.org |
| 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
Search the comp.compilers archives again.