PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Source/Swig/swigtree.h

#
C++ Header | 52 lines | 23 code | 10 blank | 19 comment | 0 complexity | ca8479f59e9b7656da1d1e45ac988f5e MD5 | raw file
 1/* ----------------------------------------------------------------------------- 
 2 * This file is part of SWIG, which is licensed as a whole under version 3 
 3 * (or any later version) of the GNU General Public License. Some additional
 4 * terms also apply to certain portions of SWIG. The full details of the SWIG
 5 * license and copyrights can be found in the LICENSE and COPYRIGHT files
 6 * included with the SWIG source code as distributed by the SWIG developers
 7 * and at http://www.swig.org/legal.html.
 8 *
 9 * swigtree.h
10 *
11 * These functions are used to access and manipulate the SWIG parse tree.
12 * The structure of this tree is modeled directly after XML-DOM.  The attribute 
13 * and function names are meant to be similar.
14 * ----------------------------------------------------------------------------- */
15
16/* Macros to traverse the DOM tree */
17
18#define  nodeType(x)               Getattr(x,"nodeType")
19#define  parentNode(x)             Getattr(x,"parentNode")
20#define  previousSibling(x)        Getattr(x,"previousSibling")
21#define  nextSibling(x)            Getattr(x,"nextSibling")
22#define  firstChild(x)             Getattr(x,"firstChild")
23#define  lastChild(x)              Getattr(x,"lastChild")
24
25/* Macros to set up the DOM tree (mostly used by the parser) */
26
27#define  set_nodeType(x,v)         Setattr(x,"nodeType",v)
28#define  set_parentNode(x,v)       Setattr(x,"parentNode",v)
29#define  set_previousSibling(x,v)  Setattr(x,"previousSibling",v)
30#define  set_nextSibling(x,v)      Setattr(x,"nextSibling",v)
31#define  set_firstChild(x,v)       Setattr(x,"firstChild",v)
32#define  set_lastChild(x,v)        Setattr(x,"lastChild",v)
33
34/* Utility functions */
35
36extern int    checkAttribute(Node *obj, const_String_or_char_ptr name, const_String_or_char_ptr value);
37extern void   appendChild(Node *node, Node *child);
38extern void   prependChild(Node *node, Node *child);
39extern void   removeNode(Node *node);
40extern Node  *copyNode(Node *node);
41
42/* Node restoration/restore functions */
43
44extern void  Swig_require(const char *ns, Node *node, ...);
45extern void  Swig_save(const char *ns, Node *node, ...);
46extern void  Swig_restore(Node *node);
47
48/* Debugging of parse trees */
49
50extern void Swig_print_tags(File *obj, Node *root);
51extern void Swig_print_tree(Node *obj);
52extern void Swig_print_node(Node *obj);