annotate lwasm/lwasm.c @ 340:1a6fc6ebb31c

Checkpoint
author lost
date Fri, 19 Mar 2010 02:54:43 +0000
parents 04c80c51b16a
children 0215a0fbf61b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
337
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
1 /*
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
2 lwasm.c
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
3
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
4 Copyright © 2010 William Astle
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
5
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
6 This file is part of LWTOOLS.
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
7
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
8 LWTOOLS is free software: you can redistribute it and/or modify it under the
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
9 terms of the GNU General Public License as published by the Free Software
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
10 Foundation, either version 3 of the License, or (at your option) any later
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
11 version.
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
12
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
13 This program is distributed in the hope that it will be useful, but WITHOUT
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
16 more details.
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
17
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
18 You should have received a copy of the GNU General Public License along with
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
19 this program. If not, see <http://www.gnu.org/licenses/>.
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
20 */
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
21
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
22 #include <config.h>
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
23
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
24 #include <lw_expr.h>
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
25
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
26 #include "lwasm.h"
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
27
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
28 #define NULL 0;
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
29
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
30 lw_expr_t lwasm_evaluate_var(char *var)
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
31 {
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
32 return NULL;
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
33 }
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
34
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
35 lw_expr_t lwasm_evaluate_special(int t, void *ptr)
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
36 {
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
37 switch (t)
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
38 {
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
39 case lwasm_expr_linelen:
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
40 {
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
41 line_t *cl = ptr;
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
42 if (cl -> len == -1)
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
43 return NULL;
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
44 return lw_expr_build(lw_expr_type_int, cl -> len);
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
45 }
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
46 break;
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
47 }
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
48 return NULL;
04c80c51b16a Checkpoint development
lost
parents:
diff changeset
49 }