Ethereal-dev: Re: [Ethereal-dev] Deactivate "Apply" button if the display filte r is not valid

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 11 Feb 2004 02:18:55 -0800
On Wed, Feb 11, 2004 at 10:28:09AM +0100, Biot Olivier wrote:
> It certainly is, but that'd require some work on the dfilter parser.

It might be that the number of token types should be reduced, with
STRING, FIELD, and UNPARSED merged into a single type, and with the code
for rules that involve the new token type explicitly checking whether
the right type is there, so that, for example, "ip" and "whoop" would be
the same token type, and, for example, the code for

	logical_test(T) ::= FIELD(F).
	{
		T = stnode_new(STTYPE_TEST, NULL);
		sttype_test_set1(T, TEST_OP_EXISTS, F);
	}

would become

	logical_test(T) ::= STRING(S).
	{
		if (S isn't the unquoted name of a field)
			dfilter_fail(appropriate message);
		T = stnode_new(STTYPE_TEST, NULL);
		sttype_test_set1(T, TEST_OP_EXISTS, S);
	}

The value for a STRING token would include a flag specifying whether
it's quoted or unquoted, as well as the actual string value.