From: xchaos Date: Mon, 21 Jan 2008 00:25:56 +0000 (+0000) Subject: little progress... X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=099b0ca0180a985138b03ed81290e7268e051756;p=svn%2FCll1h%2F.git little progress... git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@18 4bb87942-c103-4e5a-b51c-0ebff58f8515 --- diff --git a/cll1.h b/cll1.h index 8d680b3..d9e0071 100644 --- a/cll1.h +++ b/cll1.h @@ -45,12 +45,23 @@ #define or || #define TRUE 1 #define FALSE 0 +#define bool_str(I) (I?"TRUE":"FALSE") +#define boolean int +#define mem struct +#define construct struct /* ------------------------------------------------------------------- */ /* 2. C<<1 basic data types - updated 2008-01-07 by xCh. */ /* ------------------------------------------------------------------- */ +#define Create_str(ID,INIT) char *ID=INIT +#define Define_str(ID) char *ID=NULL +#define Create_mem(ID,TYPE) struct TYPE *ID=get_mem(TYPE) +#define Create_mem_in_context(ID,TYPE,CONTEXT) struct TYPE *ID=get_mem_in_context(TYPE,CONTEXT) +#define Define_mem(ID,TYPE) struct TYPE *ID=NULL +#define Define_mems(ID1,I2,TYPE) Define_mem(ID1,TYPE);Define_mem(ID2,TYPE) -#define Create_str(ID,STRATOM) char *ID=get_str(STRATOM); -#define Create_mem() +/* .... well.. ehm.. not very useful... :-) */ +#define Create_var(ID,TYPE,INIT) TYPE ID=INIT +#define Define_var(ID,TYPE) TYPE ID /* ------------------------------------------------------------------- */ #define list(T) struct T *_next #define tree(T) struct T *_next;struct T *_seek diff --git a/demos/boolean.c b/demos/boolean.c new file mode 100644 index 0000000..838e31c --- /dev/null +++ b/demos/boolean.c @@ -0,0 +1,11 @@ +#include "cll1.h" + +program +{ + boolean t=TRUE,f=FALSE; + + printf("TRUE and FALSE = %s", bool_str(t and f) ); + printf(",TRUE or FALSE = %s", bool_str(t or f) ); + printf(",not FALSE = %s", bool_str(not f) ); + printf(",not TRUE = %s\n", bool_str(not t) ); +}