little progress...
authorxchaos <xchaos@4bb87942-c103-4e5a-b51c-0ebff58f8515>
Mon, 21 Jan 2008 00:25:56 +0000 (00:25 +0000)
committerxchaos <xchaos@4bb87942-c103-4e5a-b51c-0ebff58f8515>
Mon, 21 Jan 2008 00:25:56 +0000 (00:25 +0000)
git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@18 4bb87942-c103-4e5a-b51c-0ebff58f8515

cll1.h
demos/boolean.c [new file with mode: 0644]

diff --git a/cll1.h b/cll1.h
index 8d680b3ff3c5919bc1615ff6fbae725a9392aad8..d9e00713e2a84ff7f93beb8ed06097de79694de0 100644 (file)
--- a/cll1.h
+++ b/cll1.h
 #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 (file)
index 0000000..838e31c
--- /dev/null
@@ -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) );
+}
This page took 0.156545 seconds and 4 git commands to generate.