But, if so, how does the anti-virus work? They must find the virus and detect what kind of virus they are. Is it possible to modify the structure of NFA/DFA to make it have that function?
--------------------------------------------------
From: "Gerwin Klein" <ger...@ni...>
Sent: Monday, August 18, 2008 9:27 AM
To: "Johnson Wang" <ins...@gm...>
Cc: <jfl...@li...>
Subject: Re: [jflex-users] merge more than one DFA into one
> Johnson Wang wrote:
>> If I use JFlex to merge more than one DFA into one( use '|' connect each
>> other), then about the final DFA, how to know which regular
>> expression does the final states comes from?
>> For instance:
>> Regular Expression1(r1): a|b
>> Regular Expression2(r2): a|c
>> We use '|' to connect these two regular expressions: a|b|a|c
>> Then, about the final states, how do we know the states comes from r1 or r2?
>
> There is no general way to know. If you want to distinguish two expressions, you
> should match them separately in JFLex, otherwise the minimisation algorithm will
> collapse the final states into one.
>
> There is no speed penalty for matching them separately in JFlex (unless the two
> DFAs have thousands of state).
>
> Cheers,
> Gerwin
>
>
> |