diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2018-11-19 18:58:12 -0600 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2018-11-19 18:58:12 -0600 |
commit | 0d28bd6b2fd84f863e9c9c650325125865ebe33f (patch) | |
tree | f889166aab390c1415d5a012bb5833eddd52f12f /TAO/TAO_IDL/util/utl_global.cpp | |
parent | cc6c48e0eadb21ca721b5f44147392e549c8f562 (diff) | |
download | ATCD-0d28bd6b2fd84f863e9c9c650325125865ebe33f.tar.gz |
tao_idl: annotation declarations
This makes implements annotation declarations and makes it so
Annotations are subclasses of AST_Struct and Annotation Members are
subclasses of AST_Field. Parameters are applied and cause an error if
they don't line up with the declaration or a annotation member does not
have a value after everything is said and done.
Diffstat (limited to 'TAO/TAO_IDL/util/utl_global.cpp')
-rw-r--r-- | TAO/TAO_IDL/util/utl_global.cpp | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index a2afe891cbc..022c9d9f1c1 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -118,6 +118,7 @@ IDL_GlobalData::IDL_GlobalData (void) in_eval_ (false), dump_builtins_ (false), just_dump_builtins_ (false), + ignore_files_ (false), pd_root (0), pd_gen (0), pd_primary_key_base (0), @@ -1919,24 +1920,33 @@ IDL_GlobalData::print_warnings () } /* - * These functions are generated in idl.yy.cpp but for some reason they are not - * put in the header file, so to use them we must declare them here. + * These are generated in idl.yy.cpp but they are not put in the header file, + * so to use them we must declare them here. */ struct yy_buffer_state; extern yy_buffer_state *tao_yy_scan_string (const char *); -extern int tao_yylex_destroy (); +extern void tao_yypush_buffer_state (yy_buffer_state *); +extern void tao_yypop_buffer_state (); +extern void tao_yylex_destroy (); void IDL_GlobalData::eval (const char *string) { in_eval_ = true; + // Get IDL_Global Context + UTL_String *old_filename = filename (); + pd_filename = 0; + long old_lineno = lineno (); + idl_global->set_lineno (-1); + UTL_String *old_idl_src_file = idl_src_file (); + // Name this pseudo-file "builtin" - UTL_String *utl_string = 0; - ACE_NEW (utl_string, UTL_String ("builtin", true)); - idl_global->idl_src_file (utl_string); + UTL_String utl_string ("builtin", true); + idl_global->idl_src_file (new UTL_String (&utl_string, true)); + idl_global->set_filename (new UTL_String (&utl_string, true)); - // Set up flex to read from string + // Set up Flex to read from string tao_yy_scan_string (string); // emulate DRV_drive() @@ -1944,16 +1954,15 @@ IDL_GlobalData::eval (const char *string) idl_global->check_primary_keys (); AST_check_fwd_decls (); - // Have flex Cleanup + // Have Flex Cleanup tao_yylex_destroy (); - // emulate DRV_refresh() - idl_global->set_err_count (0); - idl_global->set_filename (0); - idl_global->set_main_filename (0); - idl_global->set_real_filename (0); - idl_global->set_stripped_filename (0); - idl_global->set_lineno (-1); + // Restore IDL_Global Context + idl_global->set_filename (old_filename); + idl_src_file()->destroy (); + delete idl_src_file (); + idl_src_file (old_idl_src_file); + idl_global->set_lineno (old_lineno); idl_global->reset_flag_seen (); in_eval_ = false; |