[Tinyos-commits] CVS: tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime FNseq.nc, 1.1, 1.2 FNtranscendentalsM.nc, 1.1, 1.2

David Gay idgay at users.sourceforge.net
Tue Oct 25 08:45:10 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-serv16462

Modified Files:
	FNseq.nc FNtranscendentalsM.nc 
Log Message:
de-dos


Index: FNseq.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime/FNseq.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FNseq.nc	23 Oct 2005 22:37:09 -0000	1.1
--- FNseq.nc	25 Oct 2005 15:45:08 -0000	1.2
***************
*** 1,29 ****
! configuration FNseq {
!   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;
!   }
! }
! implementation {
!   components FNseqM, MProxy;
! 
!   ForEach = FNseqM.ForEach;
!   Vector2List = FNseqM.Vector2List;
!   List2Vector = FNseqM.List2Vector;
!   String2List = FNseqM.String2List;
!   List2String = FNseqM.List2String;
!   Length = FNseqM.Length;
!   MapFrame = FNseqM.MapFrame;
! 
!   FNseqM.GC -> MProxy;
!   FNseqM.S -> MProxy;
!   FNseqM.T -> MProxy;
!   FNseqM.E -> MProxy;
!   FNseqM.V -> MProxy;
! }
--- 1,29 ----
! configuration FNseq {
!   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;
!   }
! }
! implementation {
!   components FNseqM, MProxy;
! 
!   ForEach = FNseqM.ForEach;
!   Vector2List = FNseqM.Vector2List;
!   List2Vector = FNseqM.List2Vector;
!   String2List = FNseqM.String2List;
!   List2String = FNseqM.List2String;
!   Length = FNseqM.Length;
!   MapFrame = FNseqM.MapFrame;
! 
!   FNseqM.GC -> MProxy;
!   FNseqM.S -> MProxy;
!   FNseqM.T -> MProxy;
!   FNseqM.E -> MProxy;
!   FNseqM.V -> MProxy;
! }

Index: FNtranscendentalsM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime/FNtranscendentalsM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FNtranscendentalsM.nc	23 Oct 2005 22:37:09 -0000	1.1
--- FNtranscendentalsM.nc	25 Oct 2005 15:45:08 -0000	1.2
***************
*** 1,124 ****
! module FNtranscendentalsM {
!   provides {
!     interface MateBytecode as Sqrt;
!     interface MateBytecode as Sin;
!     interface MateBytecode as Cos;
!     interface MateBytecode as Tan;
!     interface MateBytecode as Asin;
!     interface MateBytecode as Acos;
!     interface MateBytecode as Atan;
!     interface MateBytecode as Exp;
!     interface MateBytecode as Log;
!     interface MateBytecode as Expt;
!   }
!   uses {
!     interface MotlleStack as S;
!     interface MotlleTypes as T;
!     interface MateError as E;
!   }
! }
! implementation {
! #define TRANS(name, op) \
!   { \
!     mvalue x = call S.pop(context, 1); \
!     if (call T.numberp(x)) \
!       {
! 	vreal r = op(call T.number(x)); \
! 	call S.qpush(context, call T.make_real(r)); \
!       } \
!     else \
!       call E.error(context, MOTLLE_ERROR_BAD_TYPE); \
!     return SUCCESS; \
!   }
!  \
!   command uint8_t name.byteLength() { \
!     return 1; \
!   }
! 
!   //FN sqrt: r1 -> r2. Return sqrt(r1)
!   command result_t Sqrt.execute(uint8_t instr, MateContext *context) 
!     TRANS(Sqrt, sqrt)
! 
!   //FN sin: r1 -> r2. Return sin(r1)
!   command result_t Sin.execute(uint8_t instr, MateContext *context) 
!     TRANS(Sin, sin)
! 
!   //FN cos: r1 -> r2. Return cos(r1)
!   command result_t Cos.execute(uint8_t instr, MateContext *context) 
!     TRANS(Cos, cos)
! 
!   //FN tan: r1 -> r2. Return tan(r1)
!   command result_t Tan.execute(uint8_t instr, MateContext *context) 
!     TRANS(Tan, tan)
! 
!   //FN asin: r1 -> r2. Return asin(r1)
!   command result_t Asin.execute(uint8_t instr, MateContext *context) 
!     TRANS(Asin, asin)
! 
!   //FN acos: r1 -> r2. Return acos(r1)
!   command result_t Acos.execute(uint8_t instr, MateContext *context) 
!     TRANS(Acos, acos)
! 
!   //FN exp: r1 -> r2. Return exp(r1)
!   command result_t Exp.execute(uint8_t instr, MateContext *context) 
!     TRANS(Exp, exp)
! 
!   //FN log: r1 -> r2. Return log(r1)
!   command result_t Log.execute(uint8_t instr, MateContext *context) 
!     TRANS(Log, log)
! 
! 
!   //FN expt: r1 r2 -> r3. r3 = r1 raised to the r2'th power
!   command result_t Expt.execute(uint8_t instr, MateContext *context) {
!     mvalue y = call S.pop(context, 1);
!     mvalue x = call S.pop(context, 1);
! 
!     if (call T.numberp(x) && call T.numberp(y))
!       {
! 	vreal r = pow(call T.number(x), call T.number(y));
! 	call S.qpush(context, call T.make_real(r));
!       }
!     else
!       call E.error(context, MOTLLE_ERROR_BAD_TYPE);
!     return SUCCESS;
!   }
! 
!   command uint8_t Expt.byteLength() {
!     return 1;
!   }
! 
!   //FN atan: r1 ... -> r3. r3 = atan(r1) or r3 = atan(r2/r1)
!   command result_t Atan.execute(uint8_t nargs, MateContext *context) {
!     vreal result = 0;
! 
!     if (nargs == 1)
!       {
! 	mvalue x = call S.pop(context, 1);
! 
! 	if (call T.numberp(x))
! 	  result = atan(call V.number(x));
! 	else
! 	  call E.error(context, MOTLLE_ERROR_BAD_TYPE);
!       }
!     else if (nargs == 2)
!       {
! 	mvalue x = call S.pop(context, 1);
! 	mvalue y = call S.pop(context, 1);
! 
! 	if (call T.numberp(x) && call T.numberp(y))
! 	  result = atan2(call V.number(y), call V.number(x));
! 	else
! 	  call E.error(context, MOTLLE_ERROR_BAD_TYPE);
!       }
!     else
!       call E.error(context, MOTLLE_ERROR_WRONG_PARAMETERS);
! 
!     call S.qpush(context, call T.make_real(r));
! 
!     return SUCCESS;
!   }
! 
!   command uint8_t Atan.byteLength() {
!     return 1;
!   }
! }
--- 1,124 ----
! module FNtranscendentalsM {
!   provides {
!     interface MateBytecode as Sqrt;
!     interface MateBytecode as Sin;
!     interface MateBytecode as Cos;
!     interface MateBytecode as Tan;
!     interface MateBytecode as Asin;
!     interface MateBytecode as Acos;
!     interface MateBytecode as Atan;
!     interface MateBytecode as Exp;
!     interface MateBytecode as Log;
!     interface MateBytecode as Expt;
!   }
!   uses {
!     interface MotlleStack as S;
!     interface MotlleTypes as T;
!     interface MateError as E;
!   }
! }
! implementation {
! #define TRANS(name, op) \
!   { \
!     mvalue x = call S.pop(context, 1); \
!     if (call T.numberp(x)) \
!       {
! 	vreal r = op(call T.number(x)); \
! 	call S.qpush(context, call T.make_real(r)); \
!       } \
!     else \
!       call E.error(context, MOTLLE_ERROR_BAD_TYPE); \
!     return SUCCESS; \
!   }
!  \
!   command uint8_t name.byteLength() { \
!     return 1; \
!   }
! 
!   //FN sqrt: r1 -> r2. Return sqrt(r1)
!   command result_t Sqrt.execute(uint8_t instr, MateContext *context) 
!     TRANS(Sqrt, sqrt)
! 
!   //FN sin: r1 -> r2. Return sin(r1)
!   command result_t Sin.execute(uint8_t instr, MateContext *context) 
!     TRANS(Sin, sin)
! 
!   //FN cos: r1 -> r2. Return cos(r1)
!   command result_t Cos.execute(uint8_t instr, MateContext *context) 
!     TRANS(Cos, cos)
! 
!   //FN tan: r1 -> r2. Return tan(r1)
!   command result_t Tan.execute(uint8_t instr, MateContext *context) 
!     TRANS(Tan, tan)
! 
!   //FN asin: r1 -> r2. Return asin(r1)
!   command result_t Asin.execute(uint8_t instr, MateContext *context) 
!     TRANS(Asin, asin)
! 
!   //FN acos: r1 -> r2. Return acos(r1)
!   command result_t Acos.execute(uint8_t instr, MateContext *context) 
!     TRANS(Acos, acos)
! 
!   //FN exp: r1 -> r2. Return exp(r1)
!   command result_t Exp.execute(uint8_t instr, MateContext *context) 
!     TRANS(Exp, exp)
! 
!   //FN log: r1 -> r2. Return log(r1)
!   command result_t Log.execute(uint8_t instr, MateContext *context) 
!     TRANS(Log, log)
! 
! 
!   //FN expt: r1 r2 -> r3. r3 = r1 raised to the r2'th power
!   command result_t Expt.execute(uint8_t instr, MateContext *context) {
!     mvalue y = call S.pop(context, 1);
!     mvalue x = call S.pop(context, 1);
! 
!     if (call T.numberp(x) && call T.numberp(y))
!       {
! 	vreal r = pow(call T.number(x), call T.number(y));
! 	call S.qpush(context, call T.make_real(r));
!       }
!     else
!       call E.error(context, MOTLLE_ERROR_BAD_TYPE);
!     return SUCCESS;
!   }
! 
!   command uint8_t Expt.byteLength() {
!     return 1;
!   }
! 
!   //FN atan: r1 ... -> r3. r3 = atan(r1) or r3 = atan(r2/r1)
!   command result_t Atan.execute(uint8_t nargs, MateContext *context) {
!     vreal result = 0;
! 
!     if (nargs == 1)
!       {
! 	mvalue x = call S.pop(context, 1);
! 
! 	if (call T.numberp(x))
! 	  result = atan(call V.number(x));
! 	else
! 	  call E.error(context, MOTLLE_ERROR_BAD_TYPE);
!       }
!     else if (nargs == 2)
!       {
! 	mvalue x = call S.pop(context, 1);
! 	mvalue y = call S.pop(context, 1);
! 
! 	if (call T.numberp(x) && call T.numberp(y))
! 	  result = atan2(call V.number(y), call V.number(x));
! 	else
! 	  call E.error(context, MOTLLE_ERROR_BAD_TYPE);
!       }
!     else
!       call E.error(context, MOTLLE_ERROR_WRONG_PARAMETERS);
! 
!     call S.qpush(context, call T.make_real(r));
! 
!     return SUCCESS;
!   }
! 
!   command uint8_t Atan.byteLength() {
!     return 1;
!   }
! }



More information about the Tinyos-commits mailing list