summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/include/ast_annotation_appl.h
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/include/ast_annotation_appl.h')
-rw-r--r--TAO/TAO_IDL/include/ast_annotation_appl.h42
1 files changed, 40 insertions, 2 deletions
diff --git a/TAO/TAO_IDL/include/ast_annotation_appl.h b/TAO/TAO_IDL/include/ast_annotation_appl.h
index f41f62d8f97..5e9324f0aa8 100644
--- a/TAO/TAO_IDL/include/ast_annotation_appl.h
+++ b/TAO/TAO_IDL/include/ast_annotation_appl.h
@@ -14,6 +14,10 @@
/**
* Abstract Syntax Tree Node for an application of an annotation.
+ *
+ * Params are implemented as a stack of name, value pairs which are independent
+ * from the finished annotation members. The members which are AST_Fields subclasses
+ * stored the same way as fields in AST_Struct.
*/
class TAO_IDL_FE_Export AST_Annotation_Appl : public virtual AST_Annotation_Decl
{
@@ -23,8 +27,11 @@ public:
*/
///{
struct Param {
+ Param ();
Identifier *id;
AST_Expression *expr;
+ bool used;
+ typedef ACE_Unbounded_Stack_Iterator<Param*> Iterator;
};
typedef ACE_Unbounded_Stack<Param*> Params;
///}
@@ -54,16 +61,47 @@ public:
static AST_Decl::NodeType const NT;
/**
- * Get name of the annoation as written by the user
+ * Get name of the annotation as written by the user
*/
const char* original_name () const;
+ /**
+ * Apply a Annotation Declaration to this Application. This will either fully
+ * instantiate this object or result in an error, in which case it returns false.
+ */
+ bool apply_from (AST_Annotation_Decl *decl);
+
+ /**
+ * Return pointer to the stack of parameters passed. BACKENDS SHOULDN'T USE
+ * THIS UNLESS YOU NEED EXACTLY WHAT THE USER PASSED. Backends should use the
+ * lookup and scope iterator APIs that this class inherits from AST_Scope
+ * and AST_Struct. Can be null.
+ */
+ Params *params ();
+
+ /**
+ * AST_Annotation_Decl kept in case desired by someone
+ *
+ * Will be null if accessed before apply_from() is called or if being used
+ * without a declaration.
+ */
+ AST_Annotation_Decl *annotation_decl ();
+
+ /**
+ * Return the parameter with the specified name if it's in the stack else
+ * returns 0.
+ */
+ Param *find_param (const char *name);
+
private:
/// Name of the Annotation as written
const char *original_name_;
- /// Parameters List
+ /// Parameters List (Can be null)
Params *params_;
+
+ /// The AST_Annotation_Decl (Possibly could be null)
+ AST_Annotation_Decl *annotation_decl_;
};
typedef ACE_Vector<AST_Annotation_Appl*> AST_Annotation_Appls;