Arrays in P.L to 68K compilation
Sat, 3 Jun 1995 10:51:39 GMT

          From comp.compilers

Related articles
Arrays in P.L to 68K compilation (1995-06-03)
| List of all articles for this month |

Newsgroups: comp.compilers
Keywords: code, design, question
Organization: UTexas Mail-to-News Gateway
Date: Sat, 3 Jun 1995 10:51:39 GMT
Status: RO


I'm writing a pseudo-language to 68K-code compiler and I need to
implement arrays in the following way:

Please send any help to my email @ :

1. On the grammar side:

I have a type identifier :

type array[1..10] of integer = aint;
array[0..80] of character = achar;
array[0..6] of aint = a_of_aint;

so this gives me arrays of arrays because as soon as a type is
defined, its name can be used in a subsequent definition.
These types can also be used in local and global variable

var aint : a1,a2;
a_of_aint : aa1,aa2;

2. On the instruction side:

these should be possible :

(a) a1 := a2;
Should this be a pointer redirection or a complete copy of the
array, element by element ?

(b) aa1[1] := a1;

(c) a1[i] := 5;

(d) aa1[i][j] := 0;

It should be possible to use an array element as an expression
operand ,provided the type is compatible with the operator.

An array element acn be used as a parameter for a procedure:

^ ^
fixed equivalent to Pascal "var"


where swap is : procedure swap modifiables(integer :x,y);

I need to know how to manage array-type variables and parameters at
execute time. Plus, when to calculate element adresses and verify the array

Any help about how to fill the symbol table and 68k code
would be most welcome.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.