summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/include/ast_annotation_member.h
blob: 883512bb053957cf93bc184b3505a3c6397f7ed4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
 * Abstract Syntax Tree Node for a Member Value of an Annotation
 */

#ifndef AST_ANNOTATION_MEMBER_HEADER
#define AST_ANNOTATION_MEMBER_HEADER

#include "ast_field.h"
#include "ast_expression.h"

class AST_Expression;

/**
 * Abstract Syntax Tree Node for a Member Value of an Annotation
 */
class TAO_IDL_FE_Export AST_Annotation_Member : public virtual AST_Field
{
public:
  AST_Annotation_Member (
    AST_Expression::ExprType expr_type,
    AST_Type *type, UTL_ScopedName *name);

  AST_Annotation_Member (
    AST_Decl::NodeType nt,
    AST_Expression::ExprType expr_type,
    AST_Type *type, UTL_ScopedName *name);

  /// Pseudo-Copy Constructor for Creating Annotation Applications
  AST_Annotation_Member (
    UTL_ScopedName *name,
    AST_Annotation_Member *other);

  virtual ~AST_Annotation_Member ();

  static AST_Decl::NodeType const NT;

  /// Cleanup
  virtual void destroy ();

  /// AST Dumping
  virtual void dump (ACE_OSTREAM_TYPE &o);

  /// Get and Set the Value
  ///{
  AST_Expression *value ();
  void value (AST_Expression *value);
  ///}

  /// Get the ExprType
  AST_Expression::ExprType expr_type ();

  /// Returns true if the expression value is null or invalid
  bool invalid_value ();

private:
  /// Keep ExprType at hand for convience
  AST_Expression::ExprType expr_type_;

  /// Value of the Member, can be null
  AST_Expression *value_;
};

#endif