~ubuntu-branches/ubuntu/jaunty/aspectc++/jaunty

« back to all changes in this revision

Viewing changes to Puma/src/parser/WinCTree.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-07-07 14:41:02 UTC
  • mfrom: (1.1.3 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707144102-lzml7t07f3sl00r5
Tags: 1.0pre4~svn.20080711-1
* new upstream snapshot.
* include all upstream documentation. Clarifying emails regarding
  licensing has been included into debian/copyright.
* reformat description following recomendations of
  http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description
  (Closes: #480316)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef __win_c_tree_h__
20
20
#define __win_c_tree_h__
21
21
 
 
22
/** \file
 
23
 *  VisualC++ specific syntax tree classes. */
 
24
 
22
25
namespace Puma {
23
26
 
24
27
 
35
38
namespace Puma {
36
39
 
37
40
 
 
41
/** \class CT_AsmBlock WinCTree.h Puma/WinCTree.h
 
42
 *  Tree node representing an inline assembly block.
 
43
 *  Example: \code asm { movl ecx eax } \endcode */
38
44
class CT_AsmBlock : public CT_Statement {
39
45
  CTree *_key;
40
46
  CTree *_begin;
41
47
  CTree *_end;
42
48
 
43
49
public:
 
50
  /** Constructor.
 
51
   *  \param k The keyword 'asm'.
 
52
   *  \param b Left brace.
 
53
   *  \param e Right brace. */
44
54
  CT_AsmBlock (CTree *k, CTree *b, CTree *e) :
45
55
    _key (k), _begin (b), _end (e) {}
 
56
  /** Get the identifier for this node type. Can be compared with NodeName(). */
46
57
  static const char *NodeId ();
 
58
  /** Get the name of the node. Can be compared with NodeId(). */
47
59
  const char *NodeName () const { return NodeId (); }  
 
60
  /** Get the number of sons. */
48
61
  virtual int Sons () const { return 3; }
 
62
  /** Get the n-th son.
 
63
   *  \param n The index of the son.
 
64
   *  \return The n-th son or NULL. */
49
65
  virtual CTree *Son (int n) const {
50
66
    switch (n) {
51
67
      case 0: return _key;
54
70
      default: return (CTree*)0;
55
71
    }
56
72
  }
 
73
  /** Replace a son.
 
74
   *  \param old_son The son to replace.
 
75
   *  \param new_son The new son. */
57
76
  virtual void ReplaceSon (CTree *old_son, CTree *new_son) {
58
77
    if (old_son == _key) _key = new_son;
59
78
    else if (old_son == _begin) _begin = new_son;