diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-08-02 06:34:23 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-08-02 06:34:23 +0000 |
commit | 36ecdca37201ad8190327a4d22bb07f822b6f4f4 (patch) | |
tree | 336bc34f259ee041957db750a77bc3be6eac10a3 /dfilter-grammar.y | |
parent | 56f95e5520bceaa2814fe7e8f0310d38d11fb09d (diff) | |
download | wireshark-36ecdca37201ad8190327a4d22bb07f822b6f4f4.tar.gz |
I was able to get rid of all the reduce/reduce conflicts by removing
the rules allowing values to precede variables in a relation, like this:
192.168.1.1 eq ip.src
More profound changes should still be made to the grammar, though.
svn path=/trunk/; revision=422
Diffstat (limited to 'dfilter-grammar.y')
-rw-r--r-- | dfilter-grammar.y | 47 |
1 files changed, 9 insertions, 38 deletions
diff --git a/dfilter-grammar.y b/dfilter-grammar.y index 0e1dd5f461..52f83e0c3f 100644 --- a/dfilter-grammar.y +++ b/dfilter-grammar.y @@ -3,7 +3,7 @@ /* dfilter-grammar.y * Parser for display filters * - * $Id: dfilter-grammar.y,v 1.3 1999/08/01 04:28:06 gram Exp $ + * $Id: dfilter-grammar.y,v 1.4 1999/08/02 06:34:23 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -117,9 +117,8 @@ GSList *dfilter_list_byte_arrays = NULL; %type <node> boolean_value boolean_variable %type <operand> numeric_relation -%type <operand> ether_relation +%type <operand> equality_relation %type <operand> bytes_relation -%type <operand> boolean_relation %type <variable> any_variable_type %type <operand> exists_operand @@ -171,37 +170,25 @@ relation: numeric_variable numeric_relation numeric_value { $$ = dfilter_mknode_join($1, relation, $2, $3); } - | numeric_value numeric_relation numeric_variable - { - $$ = dfilter_mknode_join($1, relation, $2, $3); - } | numeric_variable numeric_relation numeric_variable { $$ = dfilter_mknode_join($1, relation, $2, $3); } - | ether_variable ether_relation ether_value - { - $$ = dfilter_mknode_join($1, relation, $2, $3); - } - | ether_value ether_relation ether_variable + | ether_variable equality_relation ether_value { $$ = dfilter_mknode_join($1, relation, $2, $3); } - | ether_variable ether_relation ether_variable + | ether_variable equality_relation ether_variable { $$ = dfilter_mknode_join($1, relation, $2, $3); } - | ipxnet_variable ether_relation ipxnet_value + | ipxnet_variable equality_relation ipxnet_value { $$ = dfilter_mknode_join($1, relation, $2, $3); } - | ipxnet_value ether_relation ipxnet_variable - { - $$ = dfilter_mknode_join($1, relation, $2, $3); - } - | ipxnet_variable ether_relation ipxnet_variable + | ipxnet_variable equality_relation ipxnet_variable { $$ = dfilter_mknode_join($1, relation, $2, $3); } @@ -211,10 +198,6 @@ relation: numeric_variable numeric_relation numeric_value { $$ = dfilter_mknode_join($1, relation, $2, $3); } - | ipv4_value numeric_relation ipv4_variable - { - $$ = dfilter_mknode_join($1, relation, $2, $3); - } | ipv4_variable numeric_relation ipv4_variable { $$ = dfilter_mknode_join($1, relation, $2, $3); @@ -224,24 +207,16 @@ relation: numeric_variable numeric_relation numeric_value { $$ = dfilter_mknode_join($1, relation, $2, $3); } - | bytes_value bytes_relation bytes_variable - { - $$ = dfilter_mknode_join($1, relation, $2, $3); - } | bytes_variable bytes_relation bytes_variable { $$ = dfilter_mknode_join($1, relation, $2, $3); } - | boolean_variable boolean_relation boolean_value - { - $$ = dfilter_mknode_join($1, relation, $2, $3); - } - | boolean_value boolean_relation boolean_variable + | boolean_variable equality_relation boolean_value { $$ = dfilter_mknode_join($1, relation, $2, $3); } - | boolean_variable boolean_relation boolean_variable + | boolean_variable equality_relation boolean_variable { $$ = dfilter_mknode_join($1, relation, $2, $3); } @@ -356,7 +331,7 @@ numeric_relation: TOK_EQ { $$ = $1; } | TOK_LE { $$ = $1; } ; -ether_relation: TOK_EQ { $$ = $1; } +equality_relation: TOK_EQ { $$ = $1; } | TOK_NE { $$ = $1; } ; @@ -366,10 +341,6 @@ bytes_relation: TOK_EQ { $$ = $1; } | TOK_LT { $$ = $1; } ; -boolean_relation: TOK_EQ { $$ = $1; } - | TOK_NE { $$ = $1; } - ; - exists_operand: TOK_EXIST { $$ = $1; } | '?' { $$ = TOK_EXIST; } ; |