[Introspector-developers] Tree structure UML and html files
Status: Beta
Brought to you by:
mdupont
|
From: James M. D. <mdu...@ya...> - 2002-10-30 23:15:14
|
http://introspector.sourceforge.net/introspector-node-types/node_base.html This is a hyperlinked class model of the introspector. Here is a rough diagram of the tree structure posted to the blogger : http://gccintrospector.blogspot.com/2002_10_27_gccintrospector_archive.html This should give you a guideline to the introspectors gcc tree model. he project is made up of a few components. 1. The GCC patches The gcc patches give the ability to write the ASTs into XML. They also pipe the results into a perl script that reads them. 2. The perl XML reader The processing of the XML is done in perl, first a class is selected to contain the XMl and it is instanciated. The data is filled into those objects. These objects are what you see in the diagrams. 3. The database access layer, from those objects in memory we can then put the objects into the database or get them out. 4. The Meta-Layer. there are lots of other code models for generating perl, java, sql and all that from the descriptions of the nodes. This is meta-level code that is not needed for interfacing into the gcc. The cvs is available from the main project page. http://sourceforge.net/cvs/?group_id=19878 http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/introspector/introspector/ Here are some overview of the files, the README http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/introspector/introspector/README?rev=HEAD&content-type=text/vnd.viewcvs-markup Here is an example of the type of objects created. we start with the generated perl classes for each expression type. Here is the function call expression that will be instanciated whenever a function is called. ------------------------------------- package introspector::node_call_expr; # INHERITS @ISA = qw[ introspector::node_expr ]; # USES use introspector::node_base; # everything is derived from this. use introspector::node_expr; # the expr is the base class of the use introspector::node_tree_list; # the args are a in a list sub Getfn { ... } # Get the function - this should be a function_decl sub Getargs { ....} # Get the arguments - this should be a tree list of arguments ------------------------------------- These are your interfaces, They will be instanciated and called when the trees are read in from the GCC. Users can Derive and extend these classes with new functions, or write functions that take these as parameters. Here is the cvs html branch. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/introspector/introspector/introspector/node_call_expr.pm?rev=HEAD&content-type=text/vnd.viewcvs-markup ===== James Michael DuPont http://introspector.sourceforge.net/ __________________________________________________ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ |