From: stephan b. <st...@wa...> - 2003-09-03 02:28:41
|
It works on basic inputs now, plus extends the format to include optional= =3D=20 signs between keys and values: map class=3DYetAnotherNoopClass { gameboxName=3DG.E.V. gameboxVers 0.1 foo class=3Delib::NoClass { x novalue z true } asiz =09=3D=09 529 strval "this is a string" # (doesn't handle multi-line string yet) } Will do the following: main.cpp:52 : 1 Opening new node [YetAnotherNoopClass,nodename=3Dmap] main.cpp:40 : 1 map: add_property(gameboxName,G.E.V.) main.cpp:40 : 1 map: add_property(gameboxVers,0.1) main.cpp:52 : 2 Opening new node [elib::NoClass,nodename=3Dfoo] main.cpp:40 : 2 foo: add_property(x,novalue) main.cpp:40 : 2 foo: add_property(z,true) main.cpp:65 : 2 Closing node [elib::NoClass,foo] main.cpp:40 : 1 map: add_property(asiz,529) main.cpp:40 : 1 map: add_property(strval,"this is a string") main.cpp:65 : 1 Closing node [YetAnotherNoopClass,map] The amount of lex code is remarkably small, and of course i made a toc sn= ippet=20 to process them for me :). So... with this, if we will move the load/save functions out of SerialTre= e's=20 immediate interface, i can have a format-compatible text-based de/seriali= zer=20 ready which doesn't need any libs other than libfl. :) i'm using flex's C= ++=20 interface because it allows easy redirection from/to streams, so it's=20 possible to use stringstreams (instead of just C-style FILE *). --=20 ----- st...@wa... http://qub.sourceforge.net http://libfunutil.sourceforge.net =20 http://toc.sourceforge.net http://countermoves.sourceforge.net http://stephan.rootonfire.org |