summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/include/ast_annotation_decl.h
blob: f4a087997422020feb0701ef449552554cdbf816 (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
/**
 * Abstract Syntax Tree Node for a declaration of an annotation.
 */

#ifndef AST_ANNOTATION_DECL_HEADER
#define AST_ANNOTATION_DECL_HEADER

#include "ast_structure.h"

/**
 * Abstract Syntax Tree Node for a declaration of an annotation.
 */
class TAO_IDL_FE_Export AST_Annotation_Decl : public virtual AST_Structure
{
public:

  AST_Annotation_Decl (UTL_ScopedName *name);

  virtual ~AST_Annotation_Decl ();

  /// Narrowing
  ///{
  DEF_NARROW_FROM_DECL (AST_Annotation_Decl);
  DEF_NARROW_FROM_SCOPE (AST_Annotation_Decl);
  ///}

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

  /// Cleanup
  virtual void destroy ();

  static AST_Decl::NodeType const NT;

  /**
   * Work around for AST node lookup, so that annotations do not conflict with
   * other IDL types and variables that have the same name. This is done by
   * prepending '@' to all annotation names.
   */
  ///{
  static void escape_name (Identifier *name);
  static void escape_name (UTL_ScopedName *name);
  ///}

  virtual bool annotatable () const;

  virtual AST_Annotation_Member *fe_add_annotation_member (
    AST_Annotation_Member *annotation_member);

  virtual AST_Constant *fe_add_constant (AST_Constant *t);
};

#endif