~ubuntu-branches/ubuntu/wily/aspectc++/wily

« back to all changes in this revision

Viewing changes to Puma/gen-release/step1/inc/Puma/WinCTree.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-06-15 10:17:02 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090615101702-qsr30iptwbxylmo2
Tags: 1.0pre4~svn.20090615-1
* New upstream release.
* don't ignore errors in the postrm script
* avoid spurious creation of empty dir ./usr/sbin/
* improve short descriptions of libpuma-doc and libpuma-dev
* bump Standards-Version to 3.8.1
* bump debhelper compat level to level 7 (latest in stable)

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 *  Tree node representing an inline assembly block.
43
43
 *  Example: \code asm { movl ecx eax } \endcode */
44
44
class CT_AsmBlock : public CT_Statement {
45
 
  CTree *_key;
46
 
  CTree *_begin;
47
 
  CTree *_end;
 
45
  CTree *sons[3]; // key, begin, end
48
46
 
49
47
public:
50
48
  /** Constructor.
51
49
   *  \param k The keyword 'asm'.
52
50
   *  \param b Left brace.
53
51
   *  \param e Right brace. */
54
 
  CT_AsmBlock (CTree *k, CTree *b, CTree *e) :
55
 
    _key (k), _begin (b), _end (e) {}
 
52
  CT_AsmBlock (CTree *k, CTree *b, CTree *e) {
 
53
    AddSon (sons[0], k); AddSon (sons[1], b); AddSon (sons[2], e);
 
54
  }
56
55
  /** Get the identifier for this node type. Can be compared with NodeName(). */
57
56
  static const char *NodeId ();
58
57
  /** Get the name of the node. Can be compared with NodeId(). */
59
58
  const char *NodeName () const { return NodeId (); }  
60
59
  /** Get the number of sons. */
61
 
  virtual int Sons () const { return 3; }
 
60
  int Sons () const { return 3; }
62
61
  /** Get the n-th son.
63
62
   *  \param n The index of the son.
64
63
   *  \return The n-th son or NULL. */
65
 
  virtual CTree *Son (int n) const {
66
 
    switch (n) {
67
 
      case 0: return _key;
68
 
      case 1: return _begin;
69
 
      case 2: return _end;
70
 
      default: return (CTree*)0;
71
 
    }
72
 
  }
 
64
  CTree *Son (int n) const { return CTree::Son (sons, 3, n); }
73
65
  /** Replace a son.
74
66
   *  \param old_son The son to replace.
75
67
   *  \param new_son The new son. */
76
68
  virtual void ReplaceSon (CTree *old_son, CTree *new_son) {
77
 
    if (old_son == _key) _key = new_son;
78
 
    else if (old_son == _begin) _begin = new_son;
79
 
    else if (old_son == _end) _end = new_son;
 
69
    CTree::ReplaceSon (sons, 3, old_son, new_son);
80
70
  }
81
71
};
82
72