annotate runtime/bool.c @ 36:495dddadd058

User defined types work in the compiler now
author Mike Pavone <pavone@retrodev.com>
date Sat, 03 Oct 2009 03:18:15 -0400
parents 31f8182f3433
children a24eb366195c d2f9b0a9403d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #include "bool.h"
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
2 #include "func.h"
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3 #include "builtin.h"
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
4 #include "context.h"
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
5 #include <stddef.h>
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
6
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
7 t_Boolean * val_yes;
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8 t_Boolean * val_no;
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
9 #define lval ((t_Boolean *)(cdata->params[0]))->val
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
10
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
11 MethodNoLocals(If,Boolean,
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
12 NumParams 1,
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13 CallSpace 1)
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
15 Param(0, TYPE_BOOLEAN)
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
16
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
17 if(lval)
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
18 {
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
19 Ret(1, NULL)
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
20 } else {
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
21 Ret(1, cdata->params[0]);
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
22 Ret(0, NULL)
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
23 }
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
24 EndFunc