/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. /* Macros to traverse the DOM tree */
  16. #define nodeType(x) Getattr(x,"nodeType")
  17. #define parentNode(x) Getattr(x,"parentNode")
  18. #define previousSibling(x) Getattr(x,"previousSibling")
  19. #define nextSibling(x) Getattr(x,"nextSibling")
  20. #define firstChild(x) Getattr(x,"firstChild")
  21. #define lastChild(x) Getattr(x,"lastChild")
  22. /* Macros to set up the DOM tree (mostly used by the parser) */
  23. #define set_nodeType(x,v) Setattr(x,"nodeType",v)
  24. #define set_parentNode(x,v) Setattr(x,"parentNode",v)
  25. #define set_previousSibling(x,v) Setattr(x,"previousSibling",v)
  26. #define set_nextSibling(x,v) Setattr(x,"nextSibling",v)
  27. #define set_firstChild(x,v) Setattr(x,"firstChild",v)
  28. #define set_lastChild(x,v) Setattr(x,"lastChild",v)
  29. /* Utility functions */
  30. extern int checkAttribute(Node *obj, const_String_or_char_ptr name, const_String_or_char_ptr value);
  31. extern void appendChild(Node *node, Node *child);
  32. extern void prependChild(Node *node, Node *child);
  33. extern void removeNode(Node *node);
  34. extern Node *copyNode(Node *node);
  35. /* Node restoration/restore functions */
  36. extern void Swig_require(const char *ns, Node *node, ...);
  37. extern void Swig_save(const char *ns, Node *node, ...);
  38. extern void Swig_restore(Node *node);
  39. /* Debugging of parse trees */
  40. extern void Swig_print_tags(File *obj, Node *root);
  41. extern void Swig_print_tree(Node *obj);
  42. extern void Swig_print_node(Node *obj);