Last change
on this file since 4 was
2,
checked in by Sam Hocevar, 17 years ago
|
- imported original 0.7.0 tarball
|
File size:
1.5 KB
|
Line | |
---|
1 | char *mac_replace[]={"(if $cond (progn $list) nil)" |
---|
2 | "(if-1progn $cond $list)", |
---|
3 | |
---|
4 | "(if $cond (progn $list1) (progn $list2))" |
---|
5 | "(if-12progn $list1 $list2)", |
---|
6 | |
---|
7 | "(if $cond nil (progn $list))" |
---|
8 | "(if-2progn $cond $list)", |
---|
9 | |
---|
10 | "(if (not $cond) $x $y)" |
---|
11 | "(if $cond $y $x)", |
---|
12 | |
---|
13 | "(with_object $x (progn $y))" |
---|
14 | "(with_object $x $y)", |
---|
15 | |
---|
16 | "(with_object (get_object 0) $x)" |
---|
17 | "(with_obj0 $x)", |
---|
18 | |
---|
19 | "(eq 0 $x)" |
---|
20 | "(eq0 $x)", |
---|
21 | |
---|
22 | "(eq $x 0)" |
---|
23 | "(eq0 $x)", |
---|
24 | |
---|
25 | "(not (eq0 $x))" |
---|
26 | "(noteq0 $x)", |
---|
27 | |
---|
28 | NULL |
---|
29 | }; |
---|
30 | |
---|
31 | |
---|
32 | void **find_rules, |
---|
33 | **replace_rules; |
---|
34 | |
---|
35 | int trules; // total rules |
---|
36 | |
---|
37 | void mac_replace_init() |
---|
38 | { |
---|
39 | char **s=mac_replace; |
---|
40 | int trules=0; |
---|
41 | while (*s) { trules++; s++; } // count how many rules we have |
---|
42 | find_rules=(void **)jmalloc(sizeof(void *)*trules,"mac find rules"); |
---|
43 | replace_rules=(void **)jmalloc(sizeof(void *)*trules,"mac replace rules"); |
---|
44 | |
---|
45 | s=mac_replace; |
---|
46 | int i; |
---|
47 | for (int i=0;i<trules;i++,s++) |
---|
48 | { |
---|
49 | char *cs=*s; |
---|
50 | find_rules[i]=compile(cs); |
---|
51 | l_ptr_stack.push(&find_rules[i]); |
---|
52 | |
---|
53 | replace_rules[i]=compile(cs); |
---|
54 | l_ptr_stack.push(&replace_rules[i]); |
---|
55 | } |
---|
56 | } |
---|
57 | |
---|
58 | |
---|
59 | class mac_binding |
---|
60 | { |
---|
61 | public : |
---|
62 | void *var; |
---|
63 | void *value; |
---|
64 | mac_binding *next; |
---|
65 | mac_binding(void *Var, void *Value, mac_binding *Next) |
---|
66 | { |
---|
67 | var=Var; |
---|
68 | value=Value; |
---|
69 | next=Next; |
---|
70 | } |
---|
71 | } ; |
---|
72 | |
---|
73 | |
---|
74 | mac_binding *match_rule(void *x, void *rule) |
---|
75 | { |
---|
76 | if (item_type(x)==L_CONS_CELL |
---|
77 | } |
---|
78 | |
---|
79 | void apply_rules(void *x) |
---|
80 | { |
---|
81 | |
---|
82 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.