N.Wirth's book on compiler introduces the concept of symbol table and states that every declaration statement results in a new entry in symbol table.
Then after showing how an entry in symbol table looks like he talks about types which can be specified anonymously like the following :
$\ VAR a: ARRAY 10 OF INTEGER $
Then it is written that named types are represented in the symbol table entry by an entry of type object -----(1)
which in turn refers to an object of type "Type" and provides the following snippet :
$\ Type = POINTER TO TypDesc; TypDesc = RECORD form, len: INTEGER; fields: Object; base: Type END $
The book is written in pascal or oberon and I don't understand its syntax but I want to know how to interpret this type desc .
Does whatever follows typedesc , describes the fields of the record ? Form ,length,fields and base being the columns of the record ?
Wirth ,for the following declaration :
TYPE R = RECORD f, g: INTEGER END ; VAR x: INTEGER; a: ARRAY 10 O OF INTEGER; r, s: R;
shows the following symbol table entry :
The picture , I am getting from this is every object will point to its "type" ,.
In case of records , the type will point to the first field . I guess each field is being implemented something like a C structure ,having the pointer to the next field and pointer to its base type as its member . And here in the diagram ,the attribute "next" is pointing to "g" and its attribute "type" is pointing to "integer" .
The above was just an attempt to interpret what the author exactly means by it . Is my understanding correct ?