summaryrefslogtreecommitdiff
path: root/filter/config.Y
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2011-03-26 14:18:56 +0100
committerOndrej Filip <feela@network.cz>2011-03-26 14:18:56 +0100
commit4fc36f394ec0988a18decb2d1916e3cebef18d22 (patch)
tree5ce96a6f8b13574af35d1def832afd09ded45848 /filter/config.Y
parentd0e9b36d30176a9e18cad6151b20746e1588cdc8 (diff)
This adds (*,x) functionality.
Diffstat (limited to 'filter/config.Y')
-rw-r--r--filter/config.Y30
1 files changed, 28 insertions, 2 deletions
diff --git a/filter/config.Y b/filter/config.Y
index b9aa67f8..d1dd081e 100644
--- a/filter/config.Y
+++ b/filter/config.Y
@@ -25,6 +25,19 @@ static int make_pair(int i1, int i2)
return (u1 << 16) | u2;
}
+struct f_tree *f_generate_rev_wcard(int from, int to, int expr)
+{
+ struct f_tree * ret = NULL;
+ if(from <= to) {
+ ret = f_new_tree();
+ ret->from.type = ret->to.type = T_PAIR;
+ ret->from.val.i = ret->to.val.i = make_pair(from, expr);
+ ret->left = f_generate_rev_wcard(from+1, to, expr);
+ }
+ return ret;
+
+}
+
CF_DECLS
CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UNSET, RETURN,
@@ -229,10 +242,10 @@ fipa:
;
set_atom:
- expr { $$.type = T_INT; $$.val.i = $1; }
+ expr { $$.type = T_INT; $$.val.i = $1; } /* 'SYM' included in 'expr' creates 3 reduce/shift conflicts */
| RTRID { $$.type = T_QUAD; $$.val.i = $1; }
| fipa { $$ = $1; }
- | ENUM { $$.type = $1 >> 16; $$.val.i = $1 & 0xffff; }
+ | ENUM { $$.type = $1 >> 16; $$.val.i = $1 & 0xffff; }
;
set_item:
@@ -254,12 +267,25 @@ set_item:
$$->from.val.i = make_pair($2, $4);
$$->to.val.i = make_pair($9, $11);
}
+ | '(' '*' ',' '*' ')' { /* This is probably useless :-) */
+ $$ = f_new_tree();
+ $$->from.type = $$->to.type = T_PAIR;
+ $$->from.val.i = 0;
+ $$->to.val.i = 0xffffffff;
+ }
| '(' expr ',' '*' ')' {
$$ = f_new_tree();
$$->from.type = $$->to.type = T_PAIR;
$$->from.val.i = make_pair($2, 0);
$$->to.val.i = make_pair($2, 0xffff);
}
+ | '(' '*' ',' expr ')' {
+ $$ = f_generate_rev_wcard(0, 0xffff, $4);
+ }
+ /* This causes 3 reduce/reduce conflicts
+ | '(' expr '.' '.' expr ',' expr ')' {
+ cf_error("Not implemented yet");
+ }*/
| set_atom {
$$ = f_new_tree();
$$->from = $1;