Ethereal-dev: Re: [Ethereal-dev] Display filter engine questions

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

From: Gilbert Ramirez <gram@xxxxxxxxxxxxxxx>
Date: Mon, 3 May 2004 11:04:44 -0500
On Sunday 02 May 2004 05:05, Olivier Biot wrote:
> Hi list,
>
> I'd appreciate if someone could give me some insights on the display
> filter engine I currently don't have. The reason for this is that I
> plan to work on some extra display filter operations, but I don't know
> for now where to do what :)
>
> There is a grammar.lemon file and a scanner.l file. Could someone tell
> me what is in what, and which gets used when in parsing a display
> filter?
>

scanner.l looks at the display filter string and finds reserved words, 
punctuation, etc. This information gets passed to the parser produced by 
grammar.lemon. The grammar's job is to create a syntax-tree out of the 
information provided by the scanner. The syntax tree organizes the 
information from the scanner into something that is grammatical in the 
dfilter language.

The routines in semcheck.c then check the semantics of the syntax tree, and do 
any modifications necessary to the syntax tree to make the dfilter work.... 
things like converting val_strings to integers, etc.

Then gencode.c converts the syntax tree into a list of "dfvm" (display filter 
virtual machine) instructions. These dfvm instructions are what runs the 
display filter engine.

(I'll think about the rest of your questions a bit later, when I have some 
more time)

--gilbert