Revision c8cafc8e filter/config.Y

View differences:

filter/config.Y
158 158

  
159 159
static inline struct f_inst *
160 160
f_generate_empty(struct f_inst *dyn)
161
{ 
161
{
162 162
  struct f_inst *e = f_new_inst();
163 163
  e->code = 'E';
164 164

  
......
261 261

  
262 262
  if (c1 && c2) {
263 263
    u64 ec;
264
  
264

  
265 265
    if (kind == EC_GENERIC) {
266 266
      ec = ec_generic(key, val2);
267 267
    }
......
280 280
    NEW_F_VAL;
281 281
    rv = f_new_inst();
282 282
    rv->code = 'C';
283
    rv->a1.p = val;    
283
    rv->a1.p = val;
284 284
    val->type = T_EC;
285 285
    val->val.ec = ec;
286 286
  }
......
355 355
%type <e> pair_item ec_item lc_item set_item switch_item set_items switch_items switch_body
356 356
%type <trie> fprefix_set
357 357
%type <v> set_atom switch_atom fprefix fprefix_s fipa
358
%type <s> decls declsn one_decl function_params 
358
%type <s> decls declsn one_decl function_params
359 359
%type <h> bgp_path bgp_path_tail1 bgp_path_tail2
360 360

  
361 361
CF_GRAMMAR
......
391 391
 | CLIST { $$ = T_CLIST; }
392 392
 | ECLIST { $$ = T_ECLIST; }
393 393
 | LCLIST { $$ = T_LCLIST; }
394
 | type SET { 
394
 | type SET {
395 395
	switch ($1) {
396 396
	  case T_INT:
397 397
	  case T_PAIR:
......
506 506
   } function_params function_body {
507 507
     $2->def = $5;
508 508
     $2->aux2 = $4;
509
     DBG("Hmm, we've got one function here - %s\n", $2->name); 
509
     DBG("Hmm, we've got one function here - %s\n", $2->name);
510 510
     cf_pop_scope();
511 511
   }
512 512
 ;
......
652 652
   fprefix_s { $$ = $1; }
653 653
 | fprefix_s '+' { $$ = $1; $$.val.px.len |= LEN_PLUS; }
654 654
 | fprefix_s '-' { $$ = $1; $$.val.px.len |= LEN_MINUS; }
655
 | fprefix_s '{' NUM ',' NUM '}' { 
655
 | fprefix_s '{' NUM ',' NUM '}' {
656 656
     if (! ((0 <= $3) && ($3 <= $5) && ($5 <= MAX_PREFIX_LENGTH))) cf_error("Invalid prefix pattern range: {%d, %d}.", $3, $5);
657 657
     $$ = $1; $$.val.px.len |= LEN_RANGE | ($3 << 16) | ($5 << 8);
658 658
   }
......
671 671
       t->data = $4;
672 672
     $$ = f_merge_items($1, $2);
673 673
   }
674
 | switch_body ELSECOL cmds { 
674
 | switch_body ELSECOL cmds {
675 675
     struct f_tree *t = f_new_tree();
676 676
     t->from.type = t->to.type = T_VOID;
677 677
     t->right = t;
......
683 683
/* CONST '(' expr ')' { $$ = f_new_inst(); $$->code = 'c'; $$->aux = T_INT; $$->a2.i = $3; } */
684 684

  
685 685
bgp_path_expr:
686
   symbol       { $$ = $1; }   
686
   symbol       { $$ = $1; }
687 687
 | '(' term ')' { $$ = $2; }
688 688
 ;
689 689

  
......
836 836
 | '-' EMPTY '-' { $$ = f_new_inst(); $$->code = 'E'; $$->aux = T_CLIST; }
837 837
 | '-' '-' EMPTY '-' '-' { $$ = f_new_inst(); $$->code = 'E'; $$->aux = T_ECLIST; }
838 838
 | '-' '-' '-' EMPTY '-' '-' '-' { $$ = f_new_inst(); $$->code = 'E'; $$->aux = T_LCLIST; }
839
 | PREPEND '(' term ',' term ')' { $$ = f_new_inst(); $$->code = P('A','p'); $$->a1.p = $3; $$->a2.p = $5; } 
840
 | ADD '(' term ',' term ')' { $$ = f_new_inst(); $$->code = P('C','a'); $$->a1.p = $3; $$->a2.p = $5; $$->aux = 'a'; } 
839
 | PREPEND '(' term ',' term ')' { $$ = f_new_inst(); $$->code = P('A','p'); $$->a1.p = $3; $$->a2.p = $5; }
840
 | ADD '(' term ',' term ')' { $$ = f_new_inst(); $$->code = P('C','a'); $$->a1.p = $3; $$->a2.p = $5; $$->aux = 'a'; }
841 841
 | DELETE '(' term ',' term ')' { $$ = f_new_inst(); $$->code = P('C','a'); $$->a1.p = $3; $$->a2.p = $5; $$->aux = 'd'; }
842 842
 | FILTER '(' term ',' term ')' { $$ = f_new_inst(); $$->code = P('C','a'); $$->a1.p = $3; $$->a2.p = $5; $$->aux = 'f'; }
843 843

  
......
892 892
   }
893 893
 ;
894 894

  
895
var_listn: term { 
895
var_listn: term {
896 896
     $$ = f_new_inst();
897 897
     $$->code = 's';
898 898
     $$->a1.p = NULL;
......
960 960
     $$ = f_new_inst();
961 961
     $$->code = P('P','S');
962 962
     $$->a1.p = $3;
963
   } 
963
   }
964 964
 | UNSET '(' rtadot dynamic_attr ')' ';' {
965 965
     $$ = $4;
966 966
     $$->aux = EAF_TYPE_UNDEF | EAF_TEMP;

Also available in: Unified diff