[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[DotGNU]MySQL update! Re: Example SQL and XML of DOTGNU/CSCC/csnodes.c
From: |
James Michael DuPont |
Subject: |
[DotGNU]MySQL update! Re: Example SQL and XML of DOTGNU/CSCC/csnodes.c |
Date: |
Fri, 19 Apr 2002 13:43:45 -0700 (PDT) |
Dear DOT Gnuers,
I have setup a mysql database on my machine and on the
sourceforge server for the introspector database, and
loaded the SQL for the DOTGNU project that I created
for you.
If anyone is interested in writing queries or using
the server you have to setup a sourceforge account and
then you can access the server.
Also if you are interested, here is a self-contained
mysql database script. It contains the entire database
creation and the ccsc compiler code tree structure
inside the simplified introspector database mode.
http://introspector.sourceforge.net/dotgnu/introspector_mysql.tgz
I will be porting my perl scripts to use the mysql,
maybe anyone has an Idea on how to setup a xmlrpc
server to proxy the database server?
The best would be a simple command line interface to
run queries and a Jabber link to route the queries to
and from the server.
With this interface anyone can run an introspector
client that has a net connection and get access to the
meta-data of the pnet system without having to load
all the meta-data into the system.
The entire pnet system would be GBs of data, and could
be mirrored across many servers!
Even a command line perl script using jabber::net
could be used, but what about the server side? How
hard is it to set-up a jabber server.
Mike
--- James Michael DuPont <address@hidden> wrote:
> Dear Fellow DotGNUers,
>
> I have done the first step in actually *Doing*
> something for DotGNU and towards a bridge between
> the
> gcc and pnet and not just thinking and talking
> about
> what I want to do all the time.
>
> Taking the csnodes.c and running it through the
> introspector for one. Tweaking and *SIMPLIFING* the
> database model so that you can probably run in on
> *ANY* sql database server. Putting it all on a
> server
> that you can download and play with.
> Sorry that the last release from me did not have any
> documentation or tips on how to use it. One has to
> be
> carefull, the asts are very BIG and hard to use. But
> we will get there :=)
>
> I have reduced the database mode down to 3 tables
>
> *node_base
> contains the ID and the type of the node
>
> *node_attr
> contains the ID of the node, type and value of
> the
> attribute.
>
> *node_usage
> contains the fromid, toid , types of nodes and
> type
> of relationship
>
> With these three tables you have a full graph of the
> parse tree of the c# compilers node structure.
>
> The SQL for the tables is located on
>
http://introspector.sourceforge.net/dotgnu/simple.sql
>
> The data for inserting into the database you will
> find
> in a gz sql file here :
>
http://introspector.sourceforge.net/dotgnu/____global.xml.sql.gz
>
> The XML that was dumped you will find here :
>
http://introspector.sourceforge.net/dotgnu/____global.xml.gz
> (If you are interested in parsing the XML yourself )
> The XML has the following structure:
>
> <xmlroot> # the root of the document
>
> # tells you what file that was compiled to get these
> nodes
> <xml_cfile name= NAME OF SOURCE FILE/>
>
> # each tree node in the parse tree produces such
> a
> xml entry
> <node idx=NUMBER OF NODE
> node_name=TYPE OF NODE >
>
> # RELATIONSHIPS - each relation to a different
> node is contained inside of the NODE element
> < # EACH RELATION is an entity of one of
> the following types
> name | type | unql | size | min | max | args
> |
> prms | scpe | flds | body | chan | valu |
> op_0 | op_2 | val | purp | next
>
>
> idx="THE ID OF THE OTHER NODE"
> ref_node_name="THE TYPE OF OTHER NODE TYPE"
> />
>
> # ATTRIBUTES SOME of the following attributes
> might be set :
> <strg>THE VALUE OF A STRING</strg>
> <srcl>SOURCE LINE</srcl>
> <srcp>SOURCE FILE</srcp>
> <prec>PRECISION</prec>
> <algn>ALIGNMENT</algn>
> <built_in>ALIGNMENT</built_in>
> <low>LOW BYTE of a Constant</low>
> <high>LOW BYTE of a Constant</high>
> <lngth>Length of a string</lngth>
> <qualconst>is const</qualconst>
> <qualrest>?forgot for now :(</qualrest>
> <qualvol>is volitile</qualcol>
> <str>SOME TYPE OF PARAMETER FOR THE NODE (extern
> for functions, struct for records)</str>
>
> </node>
> # MANY OTHER NODEs may follow
> </xmlroot>
>
> I am also testing a simple query language for
> accessing the nodes. more about that next time.
>
> The files are located here :
> http://introspector.sourceforge.net/dotgnu/
>
> I hope that you can use these files and find them
> helpfull. Next step is to create a cross reference
> table between the GCC and the CSCC cores.
>
> Following are two example queries that show you the
> power of the database.
>
> Mike
>
> First is a list of all the identifiers of
> record_types
> who name begin with IL
> introspector_simple=#
>
> select distinct
> value
> from
> node_usage u,
> node_attr a ,
> node_base b
> where
> a.attr_type = 'strg' and
> a.value like '"IL%'
> and a.id=b.id
> and u.to_id = b.id
> and u.usage = 'name'
> and u.from_type = 'record_type';
>
> value
> ----------------------------------------
> "ILNode_AddressOf__"
> "ILNode_AddressOf_vtable__"
> "ILNode_ArrayAccess__"
> "ILNode_ArrayAccess_vtable__"
> "ILNode_ArrayInit__"
> "ILNode_ArrayInit_vtable__"
> "ILNode_AsIs__"
> "ILNode_AsIs_vtable__"
> "ILNode_Assign__"
> "ILNode_Assign_vtable__"
> "ILNode_AttrArgs__"
> "ILNode_BaseAccess__"
> "ILNode_BaseAccess_vtable__"
> "ILNode_BaseElement__"
> "ILNode_BaseElement_vtable__"
> "ILNode_BinaryArith__"
> "ILNode_BinaryArith_vtable__"
> "ILNode_BinaryBitwise__"
> "ILNode_BinaryBitwise_vtable__"
> "ILNode_BinaryExpression_vtable__"
> "ILNode_BinaryShift__"
> "ILNode_BinaryShift_vtable__"
> "ILNode_CastSimple__"
> "ILNode_CastSimple_vtable__"
> "ILNode_CastType__"
> "ILNode_CastType_vtable__"
> "ILNode_Concat__"
> "ILNode_Concat_vtable__"
> "ILNode_Constant__"
> "ILNode_Constant_vtable__"
> "ILNode_DecimalType__"
> "ILNode_DerefField__"
> "ILNode_DerefField_vtable__"
> "ILNode_Deref__"
> "ILNode_Deref_vtable__"
> "ILNode_DocComment__"
> "ILNode_DocComment_vtable__"
> "ILNode_DummyBinaryExpr__"
> "ILNode_DummyBinaryExpr_vtable__"
> "ILNode_DummySem_vtable__"
> "ILNode_DummyUnaryExpr__"
> "ILNode_DummyUnaryExpr_vtable__"
> "ILNode_Dummy_vtable__"
> "ILNode_Expression_vtable__"
> "ILNode_FixAddress__"
> "ILNode_FixAddress_vtable__"
> "ILNode_FixExpr__"
> "ILNode_FixExpr_vtable__"
> "ILNode_FixedDeclList_vtable__"
> "ILNode_Identifier__"
> "ILNode_Identifier_vtable__"
> "ILNode_IndexerAccess__"
> "ILNode_IndexerAccess_vtable__"
> "ILNode_IsNonNull__"
> "ILNode_IsNonNull_vtable__"
> "ILNode_IsNull__"
> "ILNode_IsNull_vtable__"
> "ILNode_LValueBinaryExpr_vtable__"
> "ILNode_LValueNoRefUnaryExpr__"
> "ILNode_LValueNoRefUnaryExpr_vtable__"
> "ILNode_LValueNoRef_vtable__"
> "ILNode_LValueUnaryExpr_vtable__"
> "ILNode_LValue__"
> "ILNode_LValue_vtable__"
> "ILNode_List_vtable__"
> "ILNode_LocalVariableType__"
>
=== message truncated ===
=====
James Michael DuPont
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [DotGNU]MySQL update! Re: Example SQL and XML of DOTGNU/CSCC/csnodes.c,
James Michael DuPont <=