#include
<stdio.h> Dynamic
allocation ( malloc )
Dynamic
allocation ( malloc ) ... |
All the parameters are passed by addresses : use of symbol
* in formal parameters and symbol &
in effective parameters.
when calling 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
Files
The first file block is the header block.
Special management of opened 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)
Operation nomination
he 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 C 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 translator.