struct ea_class *attribute; /* For SYM_ATTRIBUTE */
struct f_val *val; /* For SYM_CONSTANT */
uint offset; /* For SYM_VARIABLE */
- struct channel_config *ch_config; /* For SYM_COUNTER */
- struct stats_term_config *term; /* For SYM_COUNTER_TERM */
+ struct volatile_config *volat; /* For SYM_VOLATILE */
};
char name[0];
#define SYM_FILTER 4
#define SYM_TABLE 5
#define SYM_ATTRIBUTE 6
-#define SYM_COUNTER 7
-#define SYM_COUNTER_TERM 8
#define SYM_VARIABLE 0x100 /* 0x100-0x1ff are variable types */
#define SYM_VARIABLE_RANGE SYM_VARIABLE ... (SYM_VARIABLE | 0xff)
/* Constant expressions */
-conf: definition ;
-
-definition:
- DEFINE symbol '=' term ';' {
- struct f_val val;
- if (f_eval(f_linearize($4, 1), &val) > F_RETURN) cf_error("Runtime error");
- cf_define_symbol($2, SYM_CONSTANT | val.type, val, lp_val_copy(cfg_mem, &val));
- }
- ;
-
expr:
NUM
| '(' term ')' { $$ = f_eval_int(f_linearize($2, 1)); }
}
;
+
+conf: definition ;
+definition:
+ DEFINE symbol '=' term ';' {
+ struct f_line *line = f_linearize($4, 1);
+ struct filter_iterator fit;
+ FILTER_ITERATE_INIT(&fit,
+ if
+
+ struct f_val val;
+ if (f_eval(, &val) > F_RETURN) cf_error("Runtime error");
+ cf_define_symbol($2, SYM_CONSTANT | val.type, val, lp_val_copy(cfg_mem, &val));
+ }
+ | DEFINE symbol '=' COUNT ROUTE r_args ';' {
+ cf_define_symbol($2, SYM_VOLATILE, volat, f_volatile_counter($6));
+ }
+ ;
+
+
conf: filter_def ;
filter_def:
FILTER symbol { $2 = cf_define_symbol($2, SYM_FILTER, filter, NULL); cf_push_scope( $2 ); }