diff --git a/fco2/GenerateC.hs b/fco2/GenerateC.hs index 71aa269..1335de2 100644 --- a/fco2/GenerateC.hs +++ b/fco2/GenerateC.hs @@ -37,10 +37,10 @@ genTLPChannel TLPError = tell ["err"] genTopLevel :: A.Process -> CGen () genTopLevel p - = do tell ["#include \n"] + = do tell ["#include \n"] genProcess p (name, chans) <- tlpInterface - tell ["void fco_main (Process *me, Channel *in, Channel *out, Channel *err) {\n"] + tell ["void tock_main (Process *me, Channel *in, Channel *out, Channel *err) {\n"] genName name tell [" (me"] sequence_ [tell [", "] >> genTLPChannel c | c <- chans] diff --git a/fco2/Main.hs b/fco2/Main.hs index 0fc9565..1477b11 100644 --- a/fco2/Main.hs +++ b/fco2/Main.hs @@ -49,7 +49,7 @@ getOpts argv = case getOpt RequireOrder options argv of (o,n,[] ) -> return (o,n) (_,_,errs) -> error (concat errs ++ usageInfo header options) - where header = "Usage: fco [OPTION...] SOURCEFILE" + where header = "Usage: tock [OPTION...] SOURCEFILE" main :: IO () main = do diff --git a/fco2/Makefile b/fco2/Makefile index d081708..6a61526 100644 --- a/fco2/Makefile +++ b/fco2/Makefile @@ -1,4 +1,4 @@ -targets = fco +targets = tock all: $(targets) @@ -24,15 +24,15 @@ sources = \ Utils.hs $(targets): $(sources) - ghc -fglasgow-exts -fallow-undecidable-instances -o fco --make Main + ghc -fglasgow-exts -fallow-undecidable-instances -o tock --make Main CFLAGS = -g -std=gnu99 -Wall `kroc --cflags` `kroc --ccincpath` -%.fco.c: %.occ fco - ./fco -v -o $@ $< +%.tock.c: %.occ tock + ./tock -v -o $@ $< indent -kr -pcs $@ -%: %.fco.o fco_support.h kroc-wrapper-c.o kroc-wrapper.occ +%: %.tock.o tock_support.h kroc-wrapper-c.o kroc-wrapper.occ kroc -o $@ kroc-wrapper.occ $< kroc-wrapper-c.o -lcif cgtests = $(wildcard cgtests/cgtest??.occ) diff --git a/fco2/PrettyShow.hs b/fco2/PrettyShow.hs index de3228c..4cfd61a 100644 --- a/fco2/PrettyShow.hs +++ b/fco2/PrettyShow.hs @@ -1,6 +1,6 @@ -- | A generic show implementation that pretty-prints expressions. -- This ought to use a class (like show does), so that it can be extended --- properly without me needing to have FCO-specific cases in here -- see the +-- properly without me needing to have Tock-specific cases in here -- see the -- appropriate SYB paper. module PrettyShow (pshow) where diff --git a/fco2/TODO b/fco2/TODO index a7b43c0..d13abd4 100644 --- a/fco2/TODO +++ b/fco2/TODO @@ -1,10 +1,8 @@ -To-do list for FCO ------------------- +To-do list for Tock +------------------- ## General -Tock would be a good name for this (Translator from occam to C from Kent). - ## Data structures Think about simplifying the subscript types -- just have a single data type diff --git a/fco2/Utils.hs b/fco2/Utils.hs index 62e3d18..48a1b74 100644 --- a/fco2/Utils.hs +++ b/fco2/Utils.hs @@ -1,4 +1,4 @@ --- | Utility functions that aren't inherently related to FCO -- i.e. things +-- | Utility functions that aren't inherently related to Tock -- i.e. things -- that could be put into the standard library. module Utils where diff --git a/fco2/kroc-wrapper-c.c b/fco2/kroc-wrapper-c.c index a2e76f5..7d0925c 100644 --- a/fco2/kroc-wrapper-c.c +++ b/fco2/kroc-wrapper-c.c @@ -1,15 +1,15 @@ -/* KRoC wrapper to run FCO-generated CIF program */ +/* KRoC wrapper to run Tock-generated CIF program */ #include -extern void fco_main (Process *me, Channel *in, Channel *out, Channel *err); +extern void tock_main (Process *me, Channel *in, Channel *out, Channel *err); -void _fco_main_init (int *ws) { - Process *p = ProcAlloc (fco_main, 65536, 3, +void _tock_main_init (int *ws) { + Process *p = ProcAlloc (tock_main, 65536, 3, (Channel *) ws[1], (Channel *) ws[2], (Channel *) ws[3]); *((int *) ws[0]) = (int) p; } -void _fco_main_free (int *ws) { +void _tock_main_free (int *ws) { ProcAllocClean ((Process *) ws[0]); } diff --git a/fco2/kroc-wrapper.occ b/fco2/kroc-wrapper.occ index df68147..d3f1731 100644 --- a/fco2/kroc-wrapper.occ +++ b/fco2/kroc-wrapper.occ @@ -1,14 +1,14 @@ --- KRoC wrapper to run FCO-generated CIF program +-- KRoC wrapper to run Tock-generated CIF program #INCLUDE "cifccsp.inc" -#PRAGMA EXTERNAL "PROC C.fco.main.init (INT raddr, CHAN BYTE in?, out!, err!) = 0" -#PRAGMA EXTERNAL "PROC C.fco.main.free (VAL INT raddr) = 0" +#PRAGMA EXTERNAL "PROC C.tock.main.init (INT raddr, CHAN BYTE in?, out!, err!) = 0" +#PRAGMA EXTERNAL "PROC C.tock.main.free (VAL INT raddr) = 0" PROC kroc.main (CHAN BYTE in?, out!, err!) INT addr: SEQ - C.fco.main.init (addr, in?, out!, err!) + C.tock.main.init (addr, in?, out!, err!) cifccsp.startprocess (addr) - C.fco.main.free (addr) + C.tock.main.free (addr) : diff --git a/fco2/fco_support.h b/fco2/tock_support.h similarity index 98% rename from fco2/fco_support.h rename to fco2/tock_support.h index 70b10f4..2390896 100644 --- a/fco2/fco_support.h +++ b/fco2/tock_support.h @@ -1,8 +1,8 @@ -// C99 support definitions for FCO. +// C99 support definitions for Tock. // vim:set foldmethod=marker: -#ifndef FCO_SUPPORT_H -#define FCO_SUPPORT_H +#ifndef TOCK_SUPPORT_H +#define TOCK_SUPPORT_H #include #include