From: HartmutKaiser_at_[hidden]
Date: 2002-01-17 15:58:53


Rogeef wrote:

> > Ok here's a quick shot at it:
> > Borland 5.5.1
> >
> > ////////////////////////////////////////////////////////////////////
> ///////////
> > Hand coded {based on Gennadiy's code}:
> > 181K {includes main driver code}
>
> 25k using MSVCSP5; release mode.

Yes, with dynamic CRT and dynamic STL (so add >500k for these DLL's)

> > bool
> > parse_complex(char const* in, double& r, double& i)
> > {
> > // parses complex numbers of the form r or (r) or (r,i)
> >
> > tokenizer<> tok(in, in+strlen(in));
> > tokenizer<>::iterator iter=tok.begin();
> >
> > r = lexical_cast<double>(*iter++);
> > i = lexical_cast<double>(*iter);
> > }
> >
> > Note: This code allows improper syntax such as "(((1,,,()(2)((("
> > Needless to say, adding more code to conform to the grammar will
> > increase the code size.
>
> Not signiifcantly (using returnable delimeters). More over sometimes
> I would not want tight semantic defined in your implementation.

And what's the size of the this application?

Regards Hartmut