Hmm... A very interesting question. It's been years since I've played with protocol analyzers, but my initial inclination is to say a recursive descent parser would not be a good idea.
Writing error handling is a difficult part of a parser. If I'm reading this correctly, you want to know when something's out of sequence, so you probably want more detail than the parser will give you by default when something's out of order. Or you'll end up writing the same "I wanted this, I got that" error check for every action.
I'd actually suggest using something like Expect.pm (alt. link). There are two distributions; the more recent one allows you use an opened filehandle instead of spawning a separate process. Using that, you could write the protocol blocks as expect patterns, and easily detect when something's out of sequence. You'd still need to do some hacking to support multiple parallel transactions on the bus, if you have such things.
HTH
In reply to Re: parsing protocol data : Is Parse::RecDescent the right tool?
by VSarkiss
in thread parsing protocol data : Is Parse::RecDescent the right tool?
by rgloden
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |