git @ Cat's Eye Technologies OpenZz / a8e2836
Reduce warnings in zsys.c. Chris Pressey 1 year, 10 months ago
1 changed file(s) with 22 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
1919 //#define DEBUG 1
2020
2121 #include <stdint.h>
22 #include <string.h>
23
2224 #include "zlex.h"
2325 #include "rule.h"
2426 #include "err.h"
2527 #include "trace.h"
2628
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
2739 static struct {struct s_content bead;char *name;} beads[MAX_RULE_LENGTH];
2840 static int bead_n=0;
2941 static struct {struct s_content cnt;char *tag_name,is_return;}
3345
3446 /* aggiungi una bead alla regola corrente */
3547
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)
3949 {
4050 if(bead_n>=MAX_RULE_LENGTH)
4151 {
4252 zz_error(ERROR,"rule too long");
43 return;
53 return 0;
4454 }
4555 beads[bead_n].bead=argv[1];
4656 beads[bead_n].name=(argc==3)?(char*)s_content_value(argv[2]):0;
5262
5363 /* l'azione della regola corrente (zz-action o special) */
5464
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)
5866 {
5967 cur_action.cnt=argv[0];
6068 cur_action.is_return=0;
6573
6674 /* l'azione della regola corrente (return [as]) */
6775
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)
7177 {
7278 cur_action.cnt=argv[0];
7379 cur_action.is_return=1;
8288
8389 /* inserisce una regola nello scope di default */
8490
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)
8892 {
8993 do_z_link_rule(s_content_value(argv[0]),0);
9094 return 1;
9498
9599 /* inserisce una regola in uno scope */
96100
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)
100102 {
101103 do_z_link_rule(s_content_value(argv[1]),s_content_value(argv[0]));
102104 return 1;
196198 }
197199
198200
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)
202202 {
203203 append_t_bead(&argv[0]);
204204 return 1;
205205 }
206206
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)
210208 {
211209 append_nt_bead(s_content_value(argv[0]),s_content_value(argv[1]));
212210 return 1;
216214
217215 /*---------------------------------------------------------------------------*/
218216
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)
222218 {
223219 struct s_rule *rule,*get_last_rule();
224220 rule = get_last_rule();
232228
233229 /*---------------------------------------------------------------------------*/
234230
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)
238232 {
239233 struct s_rule *rule,*get_last_rule();
240234 rule = get_last_rule();