[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Nov 15 16:22:03 1996 
Subject:POP-11 function prototypes :) 
From:James Cox 
Volume-ID:961119.01 

I am currently writing a POP-11 to C translator for my final year project, and
would like peoples opinions on a particular aspect of this project.

In order to translate some types of procedures more efficiently, I want to
pass parameters to some procedures excatly the C does it, meaning that these
arguments must be typed. For example:

        define simple(a,b) -> result;
            /* no need to lvars a,b,result anymore -- done automagically
             * by POP
             */

            a * b + 1 -> result;

        enddefine;

would translate to:

        int simple(int a, int b)
        {
            return a * b + 1;
        }

but in order to do this, the translator has to know what types the arguments
will be. Instead of mucking about, I'm simply going to add functions
prototypes to my dialect of POP-11. What I want is feedback concerning what
they should look like, since I want my dialect of POP to be fully compatable
with the traditional one.

My first ideas are along these lines:

        define prototype simple(int a, int b) -> int result;

and

        ;;; prototype simple(int a, int b) -> int result;

any suggestions?

Cheers,

James Cox
<jamesco@cogs.susx.ac.uk>
--