Ethereal-dev: Re: [Ethereal-dev] Pls advise for supporting new Ascend/Lucent format

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

From: Hamish Moffatt <hamish@xxxxxxxxxxxx>
Date: Sun, 2 Dec 2001 20:15:13 +1100
On Sun, Dec 02, 2001 at 06:04:57PM +0900, Motonori Shindo wrote:
> From: Hamish Moffatt <hamish@xxxxxxxxxxxx>
> > Could you just truncate each line at the end of the hex dump
> > before parsing? ie at the position I indicated. This might not
> > be the most flexible way to do it (eg if the address at the
> > left grows too big it may push everything to the right), but workable.
> 
> I also came up with such an idea, but I just couldn't find an easy way
> to do that, because parser generated by yacc/bison automatically reads
> the line and parse it.
> 
> I learned yacc/lex more than 5 years ago so I forgot most of the
> tidbits around it. I think it's time to study it again to recall the
> details. 

Last time I wrote a converter like this, I wrote it in Perl.
The parsing is quite easy using Perl's regular expressions,
and adding the truncation is not a big deal. The speed should
be sufficient too.


Hamish
-- 
Hamish Moffatt VK3SB <hamish@xxxxxxxxxx> <hamish@xxxxxxxxxxxx>