[Tinyos-commits]
CVS: tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime
SFNreal.nc, NONE, 1.1 FNbasicM.nc, 1.4, 1.5 FNlistM.nc, 1.4,
1.5 FNseqM.nc, 1.3, 1.4 FNstringM.nc, 1.3, 1.4 FNvectorM.nc,
1.2, 1.3 Makefile, 1.2, 1.3 SFNrealM.nc, 1.1, 1.2
David Gay
idgay at users.sourceforge.net
Mon Oct 24 17:39:13 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29044/mate/runtime
Modified Files:
FNbasicM.nc FNlistM.nc FNseqM.nc FNstringM.nc FNvectorM.nc
Makefile SFNrealM.nc
Added Files:
SFNreal.nc
Log Message:
misc fixes
--- NEW FILE: SFNreal.nc ---
configuration SFNreal {
provides interface MateBytecode as Divide;
}
implementation {
components SFNrealM, MProxy;
Divide = SFNrealM.Divide;
SFNrealM.S -> MProxy;
SFNrealM.T -> MProxy;
SFNrealM.E -> MProxy;
}
Index: FNbasicM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime/FNbasicM.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FNbasicM.nc 23 Oct 2005 21:09:24 -0000 1.4
--- FNbasicM.nc 25 Oct 2005 00:39:10 -0000 1.5
***************
*** 91,95 ****
}
! //FN garbage_collect: -> . Does a forced garbage collection
//The constants below are here for lack of a good place.
//CST true=1
--- 91,95 ----
}
! //FN garbage-collect: -> . Does a forced garbage collection
//The constants below are here for lack of a good place.
//CST true=1
Index: FNlistM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime/FNlistM.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FNlistM.nc 23 Oct 2005 22:11:05 -0000 1.4
--- FNlistM.nc 25 Oct 2005 00:39:10 -0000 1.5
***************
*** 96,100 ****
}
! //FN set_car!: l x ->. Sets the first element of pair l to x
command result_t SetCarB.execute(uint8_t instr, MateContext* context) {
mvalue x = call S.pop(context, 1);
--- 96,100 ----
}
! //FN set-car!: l x ->. Sets the first element of pair l to x
command result_t SetCarB.execute(uint8_t instr, MateContext* context) {
mvalue x = call S.pop(context, 1);
***************
*** 119,123 ****
}
! //FN set_cdr!: l x ->. Sets the first element of pair l to x
command result_t SetCdrB.execute(uint8_t instr, MateContext* context) {
mvalue x = call S.pop(context, 1);
--- 119,123 ----
}
! //FN set-cdr!: l x ->. Sets the first element of pair l to x
command result_t SetCdrB.execute(uint8_t instr, MateContext* context) {
mvalue x = call S.pop(context, 1);
***************
*** 264,268 ****
}
! //FN list_tail: l1 n -> l2. Returns the nth cdr of l2
command result_t ListTail.execute(uint8_t nargs, MateContext* context) {
mvalue mn = call S.pop(context, n);
--- 264,268 ----
}
! //FN list-tail: l1 n -> l2. Returns the nth cdr of l2
command result_t ListTail.execute(uint8_t nargs, MateContext* context) {
mvalue mn = call S.pop(context, n);
***************
*** 294,298 ****
}
! //FN list_ref: l1 n -> l2. Returns the nth car of l2
command result_t ListRef.execute(uint8_t nargs, MateContext* context) {
mvalue mn = call S.pop(context, n);
--- 294,298 ----
}
! //FN list-ref: l1 n -> l2. Returns the nth car of l2
command result_t ListRef.execute(uint8_t nargs, MateContext* context) {
mvalue mn = call S.pop(context, n);
Index: FNseqM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime/FNseqM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FNseqM.nc 23 Oct 2005 22:37:09 -0000 1.3
--- FNseqM.nc 25 Oct 2005 00:39:10 -0000 1.4
***************
*** 1,361 ****
! module FNseqM {
! provides {
! //interface MateBytecode as Map;
! interface MateBytecode as ForEach;
! interface MateBytecode as Vector2List;
! interface MateBytecode as List2Vector;
! interface MateBytecode as String2List;
! interface MateBytecode as List2String;
! interface MateBytecode as Length;
! interface MotlleFrame as MapFrame;
! }
! uses {
! interface MotlleGC as GC;
! interface MotlleStack as S;
! interface MotlleTypes as T;
! interface MateError as E;
! interface MotlleValues as V;
! }
! }
! implementation {
!
! mvalue make_list(msize len) {
! msize i;
! mvalue result = call T.nil();
!
! for (i = 0; i < len; i++)
! result = call T.make_pair(call T.alloc_list(call T.nil(), result));
!
! return result;
! }
!
! bool valid_list(MateContext *context, mvalue l, msize *len) {
! bool ok = call T.valid_list(l, len);
!
! if (!ok)
! call E.error(context, MOTLLE_ERROR_BAD_VALUE);
!
! return ok;
! }
!
! //FN vector->list: v -> l. Convert vector to a list.
! command result_t Vector2List.execute(uint8_t instr, MateContext* context) {
! mvalue x = call S.pop(context, 1);
!
! if (call T.vectorp(x))
! {
! msize len = call T.vector_length(call T.vector(x)), i;
! mvalue result;
!
! /* Make n element list, then fill it in (we do this to avoid
! constantly protecting/unprotecting and accessing x) */
! GCPRO1(x);
! result = make_list(len);
! GCPOP1(x);
!
! if (result)
! {
! vvector v = call T.vector(x);
! mvalue scan = result;
!
! for (i = 0; i < len; i++)
! {
! vpair p = call T.pair(scan);
!
! call V.write(&p->car, call V.read(&v->data[i]));
! scan = call V.read(&p->cdr);
! }
! call S.qpush(context, result);
! }
! }
! else
! call E.error(context, MOTLLE_ERROR_BAD_TYPE);
!
! return SUCCESS;
! }
!
! command uint8_t Vector2List.byteLength() {
! return 1;
! }
!
! //FN string->list: v -> l. Convert string to a list.
! command result_t String2List.execute(uint8_t instr, MateContext* context) {
! mvalue x = call S.pop(context, 1);
!
! if (call T.stringp(x))
! {
! msize len = call T.string_length(call T.string(x)), i;
! mvalue result;
!
! /* Make n element list, then fill it in (we do this to avoid
! constantly protecting/unprotecting and accessing x) */
! GCPRO1(x);
! result = make_list(len);
! GCPOP1(x);
!
! if (result)
! {
! vstring s = call T.string(x);
! mvalue scan = result;
!
! for (i = 0; i < len; i++)
! {
! vpair p = call T.pair(scan);
!
! call V.write(&p->car, call T.make_int(s->data[i]));
! scan = call V.read(&p->cdr);
! }
! call S.qpush(context, result);
! }
! }
! else
! call E.error(context, MOTLLE_ERROR_BAD_TYPE);
!
! return SUCCESS;
! }
!
! command uint8_t String2List.byteLength() {
! return 1;
! }
!
! //FN list->vector: l -> v. Convert list to vector.
! command result_t List2Vector.execute(uint8_t instr, MateContext* context) {
! mvalue x = call S.pop(context, 1);
! msize len, i;
! vvector v;
!
! if (valid_list(context, x, &len))
! {
! GCPRO1(x);
! v = call T.alloc_vector(len);
! GCPOP1(x);
!
! if (v)
! {
! for (i = 0; i < len; i++)
! {
! vpair p = call T.pair(x);
!
! vzll V.write(&v->data[i], p->car);
! x = call V.read(&p->cdr);
! }
! call S.qpush(context, call T.make_vector(v));
! }
! }
!
! return SUCCESS;
! }
!
! command uint8_t List2Vector.byteLength() {
! return 1;
! }
!
! //FN list->string: l -> v. Convert list to string.
! command result_t List2String.execute(uint8_t instr, MateContext* context) {
! mvalue x = call S.pop(context, 1);
! msize len, i;
! vstring s;
!
! if (valid_list(context, x, &len))
! {
! GCPRO1(x);
! s = call T.alloc_string(len);
! GCPOP1(x);
!
! if (s)
! {
! for (i = 0; i < len; i++)
! {
! vpair p = call T.pair(x);
! mvalue car = call V.read(&p->car);
!
! if (call T.intp(car))
! s->data[i] = call T.intv(car);
! else
! call E.error(context, MOTLLE_ERROR_BAD_VALUE);
! x = call V.read(&p->cdr);
! }
! call S.qpush(context, call T.make_string(s));
! }
! }
!
! return SUCCESS;
! }
!
! command uint8_t List2String.byteLength() {
! return 1;
! }
!
! //FN length: x -> n. Return length of vector or string
! command result_t Length.execute(uint8_t instr, MateContext* context) {
! mvalue x = call S.pop(context, 1);
!
! if (call T.vectorp(x))
! call S.qpush(context, call T.make_int(call T.vector_length(call T.vector(x))));
! else if (call T.stringp(x))
! call S.qpush(context, call T.make_int(call T.string_length(call T.string(x))));
! else
! call E.error(context, MOTLLE_ERROR_BAD_TYPE);
! return SUCCESS;
! }
!
! command uint8_t Length.byteLength() {
! return 1;
! }
!
! struct map_frame {
! msize idx, len;
! uint8_t nargs;
! uint16_t retpc;
! void *sp;
! };
!
! bool map_length(MateContext *context, uint8_t i, msize *len) {
! mvalue x = call S.get(context, i);
!
! if (call T.vectorp(x))
! {
! *len = call T.vector_length(call T.vector(x));
! return TRUE;
! }
! else if (call T.stringp(x))
! {
! call T.string_length(call T.string(x));
! return TRUE;
! }
! else
! return valid_list(context, x, len);
! }
!
! mvalue map_arg(void *sp, msize idx, uint8_t i) {
! mvalue arg = call S.getOtherFrame(sp, i);
!
! if (call T.vectorp(x))
! return call V.read(&(call T.vector(x))->data[idx]);
! else if (call T.stringp(x))
! return call T.make_int((call T.string(x))->data[idx]);
! else
! {
! vpair p = call T.pair(x);
!
! call S.putOtherFrame(sp, i, call V.read(&p->cdr));
!
! return call V.read(&p->car);
! }
! }
!
! command void MapFrame.execute(MateContext *context, void *vframe) {
! struct map_frame *frame = vframe;
! uint8_t i, nargs = map_frame->nargs;
!
! if (map_frame->idx != 0)
! call S.pop(context, 1); // get rid of the old result
!
! if (map_frame->idx++ == len)
! {
! /* Done. Get rid of the frame and old arguments. */
! context->pc = frame->retpc;
! call S.pop_frame(context, sizeof(struct map_frame));
! call S.pop(context, nargs + 1);
! call S.qpush(context, call T.make_int(42));
! return;
! }
!
! if (call S.reserve(context, (nargs + 1) * sizeof(svalue)))
! {
! for (i = 0; i < nargs; i++)
! call S.qpush(context, map_arg(map_frame->sp, idx, i));
! call S.qpush(context, call S.getOtherFrame(map_frame->sp, nargs));
! call Exec.execute(OP_MEXEC4 + nargs, context);
! }
! }
!
! command msize MapFrame.gc_forward(MateContext *context, void *vframe, uint8_t *lfp, uint8_t *lsp) {
! return sizeof(struct map_frame);
! }
!
! void push_map_frame(MateContext *context, uint8_t nargs, msize len) {
! struct map_frame *map_frame;
! void *map_sp = call S.sp(context);
!
! frame = call S.alloc_frame(context, MOTLLE_MAP_FRAME,
! sizeof(struct map_frame));
! if (frame)
! {
! frame->idx = 0;
! frame->len = len;
! frame->nargs = nargs;
! frame->retpc = context->pc;
! frame->sp = map_sp;
! context->pc = 2;
! }
! }
!
! bool check_map_args(MateContext *context, uint8_t nargs, msize *len) {
! bool first = TRUE;
! uint8_t i;
!
! /* Check min/max args */
! if (nargs <= 1 || --nargs >= 16)
! {
! call E.error(context, MOTLLE_ERROR_BAD_VALUE);
! return FALSE;
! }
!
! mvalue fn = call S.get(context, nargs);
! if (!call T.functionp(fn))
! {
! call E.error(context, MOTLLE_ERROR_BAD_VALUE);
! return FALSE;
! }
!
! /* Check that all sequences are of the same lengths */
! for (i = 0; i < nargs; i++)
! {
! if (!map_length(context, i, &nlen))
! return FALSE;
!
! if (first)
! *len = nlen;
! else if (*len != nlen)
! {
! call E.error(context, MOTLLE_ERROR_BAD_VALUE);
! return FALSE;
! }
! }
!
! return TRUE;
! }
!
! //FN for-each: fn x1 ... -> x.: apply fn to the n-tuple formed by taking
! // one element from each xi list/vector/string, in order.
! // Each xi must have the same length. The result is undefined.
! command result_t ForEach.execute(uint8_t nargs, MateContext* context) {
! msize len = 0, idx;
!
! if (check_map_args(context, nargs, &len))
! push_map_frame(context, nargs, len);
!
! return SUCCESS;
! }
!
! command uint8_t ForEach.byteLength() {
! return 1;
! }
!
! #if 0
! //FN map: fn x1 ... -> x.: apply fn to the n-tuple formed by taking
! // one element from each xi list/vector/string.
! // Each xi must have the same length. The result is the result of
! // the calls to fn.
! command result_t Map.execute(uint8_t instr, MateContext* context) {
! return SUCCESS;
! }
!
! command uint8_t Map.byteLength() {
! return 1;
! }
! #endif
! }
!
!
--- 1,360 ----
! module FNseqM {
! provides {
! //interface MateBytecode as Map;
! interface MateBytecode as ForEach;
! interface MateBytecode as Vector2List;
! interface MateBytecode as List2Vector;
! interface MateBytecode as String2List;
! interface MateBytecode as List2String;
! interface MateBytecode as Length;
! interface MotlleFrame as MapFrame;
! }
! uses {
! interface MotlleGC as GC;
! interface MotlleStack as S;
! interface MotlleTypes as T;
! interface MateError as E;
! interface MotlleValues as V;
! }
! }
! implementation {
! mvalue make_list(msize len) {
! msize i;
! mvalue result = call T.nil();
!
! for (i = 0; i < len; i++)
! result = call T.make_pair(call T.alloc_list(call T.nil(), result));
!
! return result;
! }
!
! bool valid_list(MateContext *context, mvalue l, msize *len) {
! bool ok = call T.valid_list(l, len);
!
! if (!ok)
! call E.error(context, MOTLLE_ERROR_BAD_VALUE);
!
! return ok;
! }
!
! //FN vector->list: v -> l. Convert vector to a list.
! command result_t Vector2List.execute(uint8_t instr, MateContext* context) {
! mvalue x = call S.pop(context, 1);
!
! if (call T.vectorp(x))
! {
! msize len = call T.vector_length(call T.vector(x)), i;
! mvalue result;
!
! /* Make n element list, then fill it in (we do this to avoid
! constantly protecting/unprotecting and accessing x) */
! GCPRO1(x);
! result = make_list(len);
! GCPOP1(x);
!
! if (result)
! {
! vvector v = call T.vector(x);
! mvalue scan = result;
!
! for (i = 0; i < len; i++)
! {
! vpair p = call T.pair(scan);
!
! call V.write(&p->car, call V.read(&v->data[i]));
! scan = call V.read(&p->cdr);
! }
! call S.qpush(context, result);
! }
! }
! else
! call E.error(context, MOTLLE_ERROR_BAD_TYPE);
!
! return SUCCESS;
! }
!
! command uint8_t Vector2List.byteLength() {
! return 1;
! }
!
! //FN string->list: v -> l. Convert string to a list.
! command result_t String2List.execute(uint8_t instr, MateContext* context) {
! mvalue x = call S.pop(context, 1);
!
! if (call T.stringp(x))
! {
! msize len = call T.string_length(call T.string(x)), i;
! mvalue result;
!
! /* Make n element list, then fill it in (we do this to avoid
! constantly protecting/unprotecting and accessing x) */
! GCPRO1(x);
! result = make_list(len);
! GCPOP1(x);
!
! if (result)
! {
! vstring s = call T.string(x);
! mvalue scan = result;
!
! for (i = 0; i < len; i++)
! {
! vpair p = call T.pair(scan);
!
! call V.write(&p->car, call T.make_int(s->data[i]));
! scan = call V.read(&p->cdr);
! }
! call S.qpush(context, result);
! }
! }
! else
! call E.error(context, MOTLLE_ERROR_BAD_TYPE);
!
! return SUCCESS;
! }
!
! command uint8_t String2List.byteLength() {
! return 1;
! }
!
! //FN list->vector: l -> v. Convert list to vector.
! command result_t List2Vector.execute(uint8_t instr, MateContext* context) {
! mvalue x = call S.pop(context, 1);
! msize len, i;
! vvector v;
!
! if (valid_list(context, x, &len))
! {
! GCPRO1(x);
! v = call T.alloc_vector(len);
! GCPOP1(x);
!
! if (v)
! {
! for (i = 0; i < len; i++)
! {
! vpair p = call T.pair(x);
!
! vzll V.write(&v->data[i], p->car);
! x = call V.read(&p->cdr);
! }
! call S.qpush(context, call T.make_vector(v));
! }
! }
!
! return SUCCESS;
! }
!
! command uint8_t List2Vector.byteLength() {
! return 1;
! }
!
! //FN list->string: l -> v. Convert list to string.
! command result_t List2String.execute(uint8_t instr, MateContext* context) {
! mvalue x = call S.pop(context, 1);
! msize len, i;
! vstring s;
!
! if (valid_list(context, x, &len))
! {
! GCPRO1(x);
! s = call T.alloc_string(len);
! GCPOP1(x);
!
! if (s)
! {
! for (i = 0; i < len; i++)
! {
! vpair p = call T.pair(x);
! mvalue car = call V.read(&p->car);
!
! if (call T.intp(car))
! s->data[i] = call T.intv(car);
! else
! call E.error(context, MOTLLE_ERROR_BAD_VALUE);
! x = call V.read(&p->cdr);
! }
! call S.qpush(context, call T.make_string(s));
! }
! }
!
! return SUCCESS;
! }
!
! command uint8_t List2String.byteLength() {
! return 1;
! }
!
! //FN length: x -> n. Return length of vector or string
! command result_t Length.execute(uint8_t instr, MateContext* context) {
! mvalue x = call S.pop(context, 1);
!
! if (call T.vectorp(x))
! call S.qpush(context, call T.make_int(call T.vector_length(call T.vector(x))));
! else if (call T.stringp(x))
! call S.qpush(context, call T.make_int(call T.string_length(call T.string(x))));
! else
! call E.error(context, MOTLLE_ERROR_BAD_TYPE);
! return SUCCESS;
! }
!
! command uint8_t Length.byteLength() {
! return 1;
! }
!
! struct map_frame {
! msize idx, len;
! uint8_t nargs;
! uint16_t retpc;
! void *sp;
! };
!
! bool map_length(MateContext *context, uint8_t i, msize *len) {
! mvalue x = call S.get(context, i);
!
! if (call T.vectorp(x))
! {
! *len = call T.vector_length(call T.vector(x));
! return TRUE;
! }
! else if (call T.stringp(x))
! {
! call T.string_length(call T.string(x));
! return TRUE;
! }
! else
! return valid_list(context, x, len);
! }
!
! mvalue map_arg(void *sp, msize idx, uint8_t i) {
! mvalue arg = call S.getOtherFrame(sp, i);
!
! if (call T.vectorp(x))
! return call V.read(&(call T.vector(x))->data[idx]);
! else if (call T.stringp(x))
! return call T.make_int((call T.string(x))->data[idx]);
! else
! {
! vpair p = call T.pair(x);
!
! call S.putOtherFrame(sp, i, call V.read(&p->cdr));
!
! return call V.read(&p->car);
! }
! }
!
! command void MapFrame.execute(MateContext *context, void *vframe) {
! struct map_frame *frame = vframe;
! uint8_t i, nargs = map_frame->nargs;
!
! if (map_frame->idx != 0)
! call S.pop(context, 1); // get rid of the old result
!
! if (map_frame->idx++ == len)
! {
! /* Done. Get rid of the frame and old arguments. */
! context->pc = frame->retpc;
! call S.pop_frame(context, sizeof(struct map_frame));
! call S.pop(context, nargs + 1);
! call S.qpush(context, call T.make_int(42));
! return;
! }
!
! if (call S.reserve(context, (nargs + 1) * sizeof(svalue)))
! {
! for (i = 0; i < nargs; i++)
! call S.qpush(context, map_arg(map_frame->sp, idx, i));
! call S.qpush(context, call S.getOtherFrame(map_frame->sp, nargs));
! call Exec.execute(OP_MEXEC4 + nargs, context);
! }
! }
!
! command msize MapFrame.gc_forward(MateContext *context, void *vframe, uint8_t *lfp, uint8_t *lsp) {
! return sizeof(struct map_frame);
! }
!
! void push_map_frame(MateContext *context, uint8_t nargs, msize len) {
! struct map_frame *map_frame;
! void *map_sp = call S.sp(context);
!
! frame = call S.alloc_frame(context, MOTLLE_MAP_FRAME,
! sizeof(struct map_frame));
! if (frame)
! {
! frame->idx = 0;
! frame->len = len;
! frame->nargs = nargs;
! frame->retpc = context->pc;
! frame->sp = map_sp;
! context->pc = 2;
! }
! }
!
! bool check_map_args(MateContext *context, uint8_t nargs, msize *len) {
! bool first = TRUE;
! uint8_t i;
!
! /* Check min/max args */
! if (nargs <= 1 || --nargs >= 16)
! {
! call E.error(context, MOTLLE_ERROR_BAD_VALUE);
! return FALSE;
! }
!
! mvalue fn = call S.get(context, nargs);
! if (!call T.functionp(fn))
! {
! call E.error(context, MOTLLE_ERROR_BAD_VALUE);
! return FALSE;
! }
!
! /* Check that all sequences are of the same lengths */
! for (i = 0; i < nargs; i++)
! {
! if (!map_length(context, i, &nlen))
! return FALSE;
!
! if (first)
! *len = nlen;
! else if (*len != nlen)
! {
! call E.error(context, MOTLLE_ERROR_BAD_VALUE);
! return FALSE;
! }
! }
!
! return TRUE;
! }
!
! //FN for-each: fn x1 ... -> x.: apply fn to the n-tuple formed by taking
! // one element from each xi list/vector/string, in order.
! // Each xi must have the same length. The result is undefined.
! command result_t ForEach.execute(uint8_t nargs, MateContext* context) {
! msize len = 0, idx;
!
! if (check_map_args(context, nargs, &len))
! push_map_frame(context, nargs, len);
!
! return SUCCESS;
! }
!
! command uint8_t ForEach.byteLength() {
! return 1;
! }
!
! #if 0
! //FN map: fn x1 ... -> x.: apply fn to the n-tuple formed by taking
! // one element from each xi list/vector/string.
! // Each xi must have the same length. The result is the result of
! // the calls to fn.
! command result_t Map.execute(uint8_t instr, MateContext* context) {
! return SUCCESS;
! }
!
! command uint8_t Map.byteLength() {
! return 1;
! }
! #endif
! }
!
!
Index: FNstringM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime/FNstringM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FNstringM.nc 23 Oct 2005 21:09:24 -0000 1.3
--- FNstringM.nc 25 Oct 2005 00:39:10 -0000 1.4
***************
*** 24,28 ****
}
! //FN make_string: i -> s. Create an empty string of length i
command result_t MakeString.execute(uint8_t instr, MateContext* context) {
mvalue n = call S.pop(context, 1);
--- 24,28 ----
}
! //FN make-string: i -> s. Create an empty string of length i
command result_t MakeString.execute(uint8_t instr, MateContext* context) {
mvalue n = call S.pop(context, 1);
***************
*** 43,47 ****
}
! //FN string_length: s -> i. Return length of string
command result_t StringLength.execute(uint8_t instr, MateContext* context) {
mvalue v = call S.pop(context, 1);
--- 43,47 ----
}
! //FN string-length: s -> i. Return length of string
command result_t StringLength.execute(uint8_t instr, MateContext* context) {
mvalue v = call S.pop(context, 1);
***************
*** 58,62 ****
}
! //FN string_fill!: s i -> . Set all characters of s to i
command result_t StringFillB.execute(uint8_t instr, MateContext* context) {
mvalue x = call S.pop(context, 1);
--- 58,62 ----
}
! //FN string-fill!: s i -> . Set all characters of s to i
command result_t StringFillB.execute(uint8_t instr, MateContext* context) {
mvalue x = call S.pop(context, 1);
Index: FNvectorM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime/FNvectorM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FNvectorM.nc 30 Nov 2004 18:52:43 -0000 1.2
--- FNvectorM.nc 25 Oct 2005 00:39:10 -0000 1.3
***************
*** 26,30 ****
}
! //FN make_vector: i -> v. Create an empty vector of length i
command result_t MakeVector.execute(uint8_t instr, MateContext* context) {
mvalue n = call S.pop(context, 1);
--- 26,30 ----
}
! //FN make-vector: i -> v. Create an empty vector of length i
command result_t MakeVector.execute(uint8_t instr, MateContext* context) {
mvalue n = call S.pop(context, 1);
***************
*** 49,53 ****
}
! //FN vector_length: v -> i. Return length of vector
command result_t VectorLength.execute(uint8_t instr, MateContext* context) {
mvalue v = call S.pop(context, 1);
--- 49,53 ----
}
! //FN vector-length: v -> i. Return length of vector
command result_t VectorLength.execute(uint8_t instr, MateContext* context) {
mvalue v = call S.pop(context, 1);
***************
*** 64,68 ****
}
! //FN vector_fill!: v x -> . Set all elements of v to x
command result_t VectorFillB.execute(uint8_t instr, MateContext* context) {
mvalue x = call S.pop(context, 1);
--- 64,68 ----
}
! //FN vector-fill!: v x -> . Set all elements of v to x
command result_t VectorFillB.execute(uint8_t instr, MateContext* context) {
mvalue x = call S.pop(context, 1);
Index: Makefile
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Makefile 30 Nov 2004 18:52:43 -0000 1.2
--- Makefile 25 Oct 2005 00:39:10 -0000 1.3
***************
*** 1,6 ****
! INTFN = FNarithM.nc FNbasicM.nc FNlistM.nc FNstringM.nc FNvectorM.nc
FLOATFN = FNrealM.nc
! all: gen/intfns.vmsf gen/floatfns.vmsf
gen/intfns.vmsf: $(INTFN)
--- 1,11 ----
! INTFN = FNarithM.nc FNbasicM.nc FNlistM.nc FNstringM.nc FNvectorM.nc FNseqM.nc
! SCHEMEFN = $(INTFN) SFNarithM.nc
FLOATFN = FNrealM.nc
+ SCHEMEFLOATFN = SFNrealM.nc
+ TRANSFN = FNtranscendentalsM.nc
! all: gen/intfns.vmsf gen/floatfns.vmsf \
! gen/schemefns.vmsf gen/schemefloatfns.vmsf \
! gen/transcendentalfns.vmsf
gen/intfns.vmsf: $(INTFN)
***************
*** 12,13 ****
--- 17,29 ----
cat gen/intfns.vmsf >>$@
+ gen/transcendentalfns.vmsf: $(TRANSFN)
+ perl ../../tools/genfns.pl $@ $(TRANSFN)
+
+ gen/schemefns.vmsf: $(INTFN)
+ perl ../../tools/genfns.pl -scheme $@ $(SCHEMEFN)
+ echo '<CONTEXT NAME="Once">' >>$@
+
+ gen/schemefloatfns.vmsf: $(FLOATFN) gen/schemefns.vmsf
+ perl ../../tools/genfns.pl -scheme $@ $(SCHEMEFLOATFN)
+ cat gen/schemefns.vmsf >>$@
+
Index: SFNrealM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime/SFNrealM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SFNrealM.nc 25 Oct 2005 00:01:25 -0000 1.1
--- SFNrealM.nc 25 Oct 2005 00:39:10 -0000 1.2
***************
*** 1,4 ****
--- 1,9 ----
module SFNrealM {
provides interface Divide;
+ uses {
+ interface MotlleStack as S;
+ interface MotlleTypes as T;
+ interface MateError as E;
+ }
}
implementation {
More information about the Tinyos-commits
mailing list