[GCC-XML]converting gccxml output into internal database for
better access
Dupont, Michael
michael.dupont@mciworldcom.de
Mon, 6 May 2002 12:56:12 +0100
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C1F4F5.0490AE00
Content-Type: text/plain;
charset="windows-1255"
Valery,
>>I will need to reparse the file many times to have entire data structure.
That is a bad design. You only need to pass over the file once.
If you use a SAX XML parser you should create an object in memory for each
node in your programming language.
Copy all the attributes into some object, an hash table, and yes, build a
hash tables of ids.
Afterwards you can contruct your objects as needed.
I dont remember if the GCCXML is using the "ID" attribute. If so, any good
DOM XML parser will do this all for you.
What programming language are you using?,
I have some examples in perl.
mike
------_=_NextPart_001_01C1F4F5.0490AE00
Content-Type: text/html;
charset="windows-1255"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1255">
<TITLE>converting gccxml output into internal database for better access</TITLE>
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT color=#0000ff size=2><SPAN
class=440375311-06052002>Valery,</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=440375311-06052002></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=440375311-06052002>>>I will
need to <SPAN class=641470612-06052002><FONT face=Arial color=#0000ff
size=2>reparse the file many times to have entire data
structure.</FONT></SPAN></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=440375311-06052002><SPAN
class=641470612-06052002>That is a bad design. You only need to pass over the
file once.</SPAN></DIV>
<DIV><SPAN class=641470612-06052002></SPAN> </DIV></SPAN></FONT>
<DIV><FONT color=#0000ff size=2><SPAN class=440375311-06052002>If you use a SAX
XML parser you should create an object in memory for each node in your
programming language.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=440375311-06052002>Copy all the
attributes into some object, an hash table, and yes, build a hash tables of
ids.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=440375311-06052002></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=440375311-06052002>Afterwards you
can contruct your objects as needed.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=440375311-06052002>I dont remember
if the GCCXML is using the "ID" attribute. If so, any good DOM XML parser
will do this all for you.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=440375311-06052002></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=440375311-06052002>What programming
language are you using?,</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=440375311-06052002>I have some
examples in perl.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=440375311-06052002></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=440375311-06052002>mike</SPAN></FONT></DIV>
<DIV><CODE><FONT size=3> </DIV></FONT></CODE></BODY></HTML>
------_=_NextPart_001_01C1F4F5.0490AE00--