Structure of a PASCAL programme
PROGRAM
My_program;
Dynamic allocation ( New ) END;
Dynamic allocation ( New )
END; |
All the parameters are passed by addresses ( VAR Option).
when calling procedure or functions, temporary variables are generated for expressions (_Px1,_Px2, etc. )
Temporary variables, structures or arrays can be generated by the translator.
There are prefixed by symbol
'_'.
Implementation of abstract types
All the machines are implemented using addresses.
Address to the structure
Address to the array
Address to the file block
In PASCAL, the library
Sysutils is used with the functions :
Filecreate, Fileopen, Fileclose, Fileseek, Filewrire et
Fileread.
The first file block is the header block.
Special management of open files
_Push_open: push an open file (Name
and Handle)
_Pop_open: pop the last open file (Name)
of a given handle.
_Open : test if a given file name
exists or not.
When defining a file, two structures are considered.
- Definition of file structure block with addresses. If there is an array
inside the block, its address is considered.
- Definition du file block (without address)
The names of machine operations are postfixed by the types.
The Z language allows sharing files, i.e, a file can be opened several times. According to the PASCAL compiler used, charing a file cannot be allowed. In this case, a special mangement of open files is integrated in the translator.
Some optimisations remain to do such as recovery of temporary variables generated by the translateur.