Reduce warnings in zsys.c.
Chris Pressey
1 year, 10 months ago
19 | 19 | //#define DEBUG 1 |
20 | 20 | |
21 | 21 | #include <stdint.h> |
22 | #include <string.h> | |
23 | ||
22 | 24 | #include "zlex.h" |
23 | 25 | #include "rule.h" |
24 | 26 | #include "err.h" |
25 | 27 | #include "trace.h" |
26 | 28 | |
29 | /*PROTOTYPES*/ | |
30 | void setaction_return(struct s_content *value, char *tag_name); | |
31 | void setaction_rreturn(void); | |
32 | void setaction_pass(void); | |
33 | void setaction_exelist(struct s_content *list); | |
34 | void setaction_assign(void); | |
35 | void append_nt_bead(char *ntname, char *beadname); | |
36 | void append_t_bead(struct s_content *cnt); | |
37 | void insert_rule(char *, struct s_rule *); | |
38 | ||
27 | 39 | static struct {struct s_content bead;char *name;} beads[MAX_RULE_LENGTH]; |
28 | 40 | static int bead_n=0; |
29 | 41 | static struct {struct s_content cnt;char *tag_name,is_return;} |
33 | 45 | |
34 | 46 | /* aggiungi una bead alla regola corrente */ |
35 | 47 | |
36 | z_bead(argc,argv,ret) | |
37 | int argc; | |
38 | struct s_content argv[],*ret; | |
48 | int z_bead(int argc, struct s_content argv[], struct s_content *ret) | |
39 | 49 | { |
40 | 50 | if(bead_n>=MAX_RULE_LENGTH) |
41 | 51 | { |
42 | 52 | zz_error(ERROR,"rule too long"); |
43 | return; | |
53 | return 0; | |
44 | 54 | } |
45 | 55 | beads[bead_n].bead=argv[1]; |
46 | 56 | beads[bead_n].name=(argc==3)?(char*)s_content_value(argv[2]):0; |
52 | 62 | |
53 | 63 | /* l'azione della regola corrente (zz-action o special) */ |
54 | 64 | |
55 | z_set_action(argc,argv,ret) | |
56 | int argc; | |
57 | struct s_content argv[],*ret; | |
65 | int z_set_action(int argc, struct s_content argv[], struct s_content *ret) | |
58 | 66 | { |
59 | 67 | cur_action.cnt=argv[0]; |
60 | 68 | cur_action.is_return=0; |
65 | 73 | |
66 | 74 | /* l'azione della regola corrente (return [as]) */ |
67 | 75 | |
68 | z_set_return_action(argc,argv,ret) | |
69 | int argc; | |
70 | struct s_content argv[],*ret; | |
76 | int z_set_return_action(int argc, struct s_content argv[], struct s_content *ret) | |
71 | 77 | { |
72 | 78 | cur_action.cnt=argv[0]; |
73 | 79 | cur_action.is_return=1; |
82 | 88 | |
83 | 89 | /* inserisce una regola nello scope di default */ |
84 | 90 | |
85 | z_link_rule_default(argc,argv,ret) | |
86 | int argc; | |
87 | struct s_content argv[],*ret; | |
91 | int z_link_rule_default(int argc, struct s_content argv[], struct s_content *ret) | |
88 | 92 | { |
89 | 93 | do_z_link_rule(s_content_value(argv[0]),0); |
90 | 94 | return 1; |
94 | 98 | |
95 | 99 | /* inserisce una regola in uno scope */ |
96 | 100 | |
97 | z_link_rule(argc,argv,ret) | |
98 | int argc; | |
99 | struct s_content argv[],*ret; | |
101 | int z_link_rule(int argc, struct s_content argv[], struct s_content *ret) | |
100 | 102 | { |
101 | 103 | do_z_link_rule(s_content_value(argv[1]),s_content_value(argv[0])); |
102 | 104 | return 1; |
196 | 198 | } |
197 | 199 | |
198 | 200 | |
199 | z_append_term(argc,argv,ret) | |
200 | int argc; | |
201 | struct s_content argv[],*ret; | |
201 | int z_append_term(int argc, struct s_content argv[], struct s_content *ret) | |
202 | 202 | { |
203 | 203 | append_t_bead(&argv[0]); |
204 | 204 | return 1; |
205 | 205 | } |
206 | 206 | |
207 | z_append_nt(argc,argv,ret) | |
208 | int argc; | |
209 | struct s_content argv[],*ret; | |
207 | int z_append_nt(int argc, struct s_content argv[], struct s_content *ret) | |
210 | 208 | { |
211 | 209 | append_nt_bead(s_content_value(argv[0]),s_content_value(argv[1])); |
212 | 210 | return 1; |
216 | 214 | |
217 | 215 | /*---------------------------------------------------------------------------*/ |
218 | 216 | |
219 | z_set_when_change_action(argc,argv,ret) | |
220 | int argc; | |
221 | struct s_content argv[],*ret; | |
217 | int z_set_when_change_action(int argc, struct s_content argv[], struct s_content *ret) | |
222 | 218 | { |
223 | 219 | struct s_rule *rule,*get_last_rule(); |
224 | 220 | rule = get_last_rule(); |
232 | 228 | |
233 | 229 | /*---------------------------------------------------------------------------*/ |
234 | 230 | |
235 | z_set_when_exit_scope(argc,argv,ret) | |
236 | int argc; | |
237 | struct s_content argv[],*ret; | |
231 | int z_set_when_exit_scope(int argc, struct s_content argv[], struct s_content *ret) | |
238 | 232 | { |
239 | 233 | struct s_rule *rule,*get_last_rule(); |
240 | 234 | rule = get_last_rule(); |