Re: Source to source compiling

md@pact.srf.ac.uk (Mark Debbage)
Thu, 22 Sep 1994 15:13:58 GMT

          From comp.compilers

Related articles
[5 earlier articles]
Re: source to source compiling ghiya@vani.cs.mcgill.ca (1994-09-18)
Re: Source to source compiling bernecky@eecg.toronto.edu (Robert Bernecky) (1994-09-18)
Re: Source to source compiling toconnor@vcd.hp.com (1994-09-18)
Re: Source to source compiling pjj@cs.man.ac.uk (1994-09-16)
Re: Source to source compiling rgg@tidos.tid.es (1994-09-19)
Re: Source to source compiling lexa@adam.botik.yaroslavl.su (1994-09-22)
Re: Source to source compiling md@pact.srf.ac.uk (1994-09-22)
| List of all articles for this month |

Newsgroups: comp.compilers
From: md@pact.srf.ac.uk (Mark Debbage)
Keywords: translator, Occam, C
Organization: University of Bristol, England
References: 94-09-031 94-09-101
Date: Thu, 22 Sep 1994 15:13:58 GMT

Raul Garcia Garcia (rgg@tidos.tid.es) wrote:


: Certainly. I used this method in my engineer's degree required project,
: a C to occam2 translator.


Interestingly, I used similar sorts of control structures in a translator
in the reverse direction! The SPOC system translates occam 2 into C
without the use of any sort of process library. It uses switch statements
embedded in while loops to handle the non-local control flow arising from
occam's communication primitives. Simply put, each input or output
requires a flow of control out of that procedure into a scheduler and back
again once that communication is satisfied. Each section of code ending in
an input or output thus requires a separate case branch in a switch
statement. All sequential occam control flow containing communications (or
containing calls to processes with communications) is then constructed out
of the while-switch arrangement. Occam control flow that does not contain
communications can be built using C's normal control constructs as we
choose not to support pre-emption between processes.


Mark Debbage.


Work address: INMOS Limited, 10 Priory Road, Clifton, Bristol BS8 1TU
Work phone : 0272 707179
Fax number : 0272 707171
Email : md@pact.srf.ac.uk
--


Post a followup to this message

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