Revision 11cb6202 filter/config.Y

View differences:

filter/config.Y
39 39
%type <v> set_atom fprefix fprefix_s fipa
40 40
%type <s> decls declsn one_decl function_params 
41 41
%type <h> bgp_path
42
%type <i> bgp_one
43 42

  
44 43
CF_GRAMMAR
45 44

  
......
273 272

  
274 273
/* CONST '(' expr ')' { $$ = f_new_inst(); $$->code = 'c'; $$->aux = T_INT; $$->a2.i = $3; } */
275 274

  
276
bgp_one:
277
   NUM { $$ = $1; }
278
 | '?' { $$ = PM_ANY; }
279
 ;
280 275

  
281 276
bgp_path: 
282
   bgp_one          { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = NULL; $$->val  = $1; }
283
 | bgp_one bgp_path { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2;   $$->val  = $1; }
277
   NUM          { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = NULL; $$->val  = $1; $$->any = 0; }
278
 | '?'          { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = NULL; $$->val  = 0;  $$->any = 1; }
279
 | NUM bgp_path { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2;   $$->val  = $1; $$->any = 0; }
280
 | '?' bgp_path { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2;   $$->val  = 0;  $$->any = 1; }
284 281
 ;
285 282

  
286 283
constant:

Also available in: Unified diff