diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2018-10-01 16:57:35 -0500 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2018-10-01 16:57:35 -0500 |
commit | 99b33004d366439aa592692cd2ae8ccc0683451e (patch) | |
tree | 4d9896df6a02f264c5656179fcad417bdb5f5586 /TAO/TAO_IDL/fe/idl.ypp | |
parent | 33ab4db3030031a0368cd9d049c380c0a2df4025 (diff) | |
download | ATCD-99b33004d366439aa592692cd2ae8ccc0683451e.tar.gz |
tao_idl: Simple Annotations in AST
For now only simple annotations on member fields are put into the AST
and dumped when "-d" is used.
Diffstat (limited to 'TAO/TAO_IDL/fe/idl.ypp')
-rw-r--r-- | TAO/TAO_IDL/fe/idl.ypp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/TAO/TAO_IDL/fe/idl.ypp b/TAO/TAO_IDL/fe/idl.ypp index 5f3461df675..4dd5160e8e6 100644 --- a/TAO/TAO_IDL/fe/idl.ypp +++ b/TAO/TAO_IDL/fe/idl.ypp @@ -120,6 +120,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_visitor_tmpl_module_inst.h" #include "ast_visitor_tmpl_module_ref.h" #include "ast_visitor_context.h" +#include "ast_annotation.h" #include "fe_declarator.h" #include "fe_interface_header.h" @@ -185,6 +186,7 @@ AST_Expression::ExprType t_param_const_type = AST_Expression::EV_none; FE_Utils::T_Param_Info *pival; /* Template interface param */ FE_Utils::T_PARAMLIST_INFO *plval; /* List of template params */ FE_Utils::T_ARGLIST *alval; /* List of template args */ + Annotations *annotations; } /* @@ -355,6 +357,8 @@ AST_Expression::ExprType t_param_const_type = AST_Expression::EV_none; %type <sval> formal_parameter_name %type <alval> actual_parameters at_least_one_actual_parameter + +%type <annotations> annotations %% /* @@ -363,7 +367,7 @@ AST_Expression::ExprType t_param_const_type = AST_Expression::EV_none; start : definitions ; definitions - : definitions annotations definition + : definitions definition | /* EMPTY */ ; @@ -380,7 +384,7 @@ definition ; at_least_one_definition - : definitions annotations definition + : definitions definition ; fixed_definition @@ -2361,7 +2365,7 @@ annotation_dcl ACE_DEBUG ((LM_WARNING, ACE_TEXT ("WARNING: in %C on line %d:\n") ACE_TEXT ("Declaring annotations is not supported at the ") - ACE_TEXT ("momment, it is being ignored!\n"), + ACE_TEXT ("momment, this annotation is being ignored!\n"), idl_global->filename ()->get_string (), idl_global->lineno () )); @@ -2422,14 +2426,26 @@ annotations idl_global->lineno (), idl_global->idl_version_.to_string () )); - idl_global->err()->syntax_error (idl_global->parse_state()); + idl_global->err ()->syntax_error (idl_global->parse_state ()); } + + Annotations *annotations = $1; + AST_Annotation *annotation = + idl_global->gen ()->create_annotation ($<idlist>2); + annotations->insert_head (annotation); + $$ = annotations; } | /* EMPTY */ + { + $$ = new Annotations (); + } ; annotation_appl : IDL_ANNOTATION_SYMBOL scoped_name annotation_appl_params_maybe + { + $<idlist>$ = $2; + } ; annotation_appl_params_maybe @@ -3057,6 +3073,7 @@ member_i : d->name (), $<vival>0 ); + f->annotations ($1); (void) s->fe_add_field (f); } } |