diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-10-19 03:27:53 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-10-19 03:27:53 +0000 |
commit | f4df93c6b6593a20a47c6d2b657d891b634e3613 (patch) | |
tree | 007d71c2b9431d87b510154cd74f3c1881fca449 | |
parent | 4eee0de7eaf837beaada1933be7f092bdb0793f7 (diff) | |
download | ATCD-f4df93c6b6593a20a47c6d2b657d891b634e3613.tar.gz |
ChangeLogTag: Fri Oct 18 22:23:53 2002 Jeff Parsons <parsons@isis-server.isis.vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 11 | ||||
-rw-r--r-- | TAO/TAO_IDL/fe/idl.ll | 36 | ||||
-rw-r--r-- | TAO/TAO_IDL/fe/lex.yy.cpp | 37 |
3 files changed, 58 insertions, 26 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 38dec71e4b0..ba9f992ac1f 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,14 @@ +Fri Oct 18 22:23:53 2002 Jeff Parsons <parsons@isis-server.isis.vanderbilt.edu> + + * TAO_IDL/fe/idl.ll: + * TAO_IDL/fe/lex.yy.cpp: + + Fixed a problem with the SunCC preprocessor. When processing a + non-quoted scoped name, as may occur in #pragma version, typeid, + or typeprefix, this preprocessor regards the double colons as + separate tokens and bookends them with spaces. Had to add code to + check for this and strip out the spaces. + Fri Oct 18 16:49:04 2002 Jaiganesh Balasubramanian <jai@doc.ece.uci.edu> * diff --git a/TAO/TAO_IDL/fe/idl.ll b/TAO/TAO_IDL/fe/idl.ll index 63aab15ed76..f20f40f3b90 100644 --- a/TAO/TAO_IDL/fe/idl.ll +++ b/TAO/TAO_IDL/fe/idl.ll @@ -493,27 +493,37 @@ idl_store_pragma (char *buf) int crunched = 0; // Remove all the blanks between the '#' and the 'pragma'. - if (*sp != 'p') + while (*sp != 'p') { - while (*sp != 'p') + ++sp; + ++crunched; + } + + char *tp = buf + 1; + + // This copies the crunched string back to the original, and + // also compensates for the behavior of the Sun preprocessor, + // which put spaces around the double colons of a non-quoted + // scoped name, a case which is possible in #pragma version. + while (*sp != '\n') + { + if (*sp == ' ' && *(sp + 1) == ':') { - ++sp; ++crunched; } - - char *tp = buf + 1; - - while (*sp != '\n') + else if (*sp == ':' && *(sp + 1) == ' ') { *tp = *sp; - ++tp; + ++crunched; ++sp; + ++tp; + } + else + { + *tp = *sp; + ++tp; } - } - // Remove the final '\n'. - while (*sp != '\n') - { ++sp; } @@ -556,7 +566,7 @@ idl_store_pragma (char *buf) { UTL_Scope *top_scope = idl_global->scopes ().top (); top_scope->has_prefix (1); - top_scope->prefix_scope (top_scope); + ScopeAsDecl (top_scope)->prefix_scope (top_scope); } idl_global->pragma_prefixes ().push (new_prefix); diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp index 8e3096ac5d9..ffddd4238b8 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp +++ b/TAO/TAO_IDL/fe/lex.yy.cpp @@ -2684,27 +2684,37 @@ idl_store_pragma (char *buf) int crunched = 0; // Remove all the blanks between the '#' and the 'pragma'. - if (*sp != 'p') + while (*sp != 'p') { - while (*sp != 'p') + ++sp; + ++crunched; + } + + char *tp = buf + 1; + + // This copies the crunched string back to the original, and + // also compensates for the behavior of the Sun preprocessor, + // which put spaces around the double colons of a non-quoted + // scoped name, a case which is possible in #pragma version. + while (*sp != '\n') + { + if (*sp == ' ' && *(sp + 1) == ':') { - ++sp; ++crunched; } - - char *tp = buf + 1; - - while (*sp != '\n') + else if (*sp == ':' && *(sp + 1) == ' ') { *tp = *sp; - ++tp; + ++crunched; ++sp; + ++tp; + } + else + { + *tp = *sp; + ++tp; } - } - // Remove the final '\n'. - while (*sp != '\n') - { ++sp; } @@ -2773,9 +2783,10 @@ idl_store_pragma (char *buf) // For some reason, the SunCC preprocessor adds a trailing space, which // messes with idl_valid_version() below, so we check and remove. - if (number[len - 1] == ' ') + while (number[len - 1] == ' ') { number[len - 1] = '\0'; + len = ACE_OS::strlen (number); } AST_Decl *d = idl_find_node (tmp); |