--- ETCL_l.cpp.orig Mon Feb 7 18:49:18 2000 +++ ETCL_l.cpp Mon Feb 7 18:51:27 2000 @@ -469,7 +469,7 @@ // // = LIBRARY // orbsvcs/ECTL -// +// // = FILENAME // ETCL.ll // @@ -641,6 +641,23 @@ #define YY_RULE_SETUP \ YY_USER_ACTION +class TAO_ETCL_Lex_State_Guard +{ +public: + TAO_ETCL_Lex_State_Guard (void *state) + { + this->previous_state = yy_current_buffer; + yy_switch_to_buffer ((YY_BUFFER_STATE)state); + } + ~TAO_ETCL_Lex_State_Guard (void) + { + yy_switch_to_buffer (this->previous_state); + } + +private: + YY_BUFFER_STATE previous_state; +}; + YY_DECL { register yy_state_type yy_current_state; @@ -649,7 +666,10 @@ #line 50 "ETCL/ETCL.ll" + static ACE_SYNCH_MUTEX mutex; + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, mutex, -1); + TAO_ETCL_Lex_State_Guard lex_helper (state); if ( yy_init ) { @@ -895,8 +915,8 @@ case 33: YY_RULE_SETUP #line 84 "ETCL/ETCL.ll" -{ - lvalp->constraint = +{ + lvalp->constraint = new TAO_ETCL_Boolean_Literal (1); TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN; } @@ -904,8 +924,8 @@ case 34: YY_RULE_SETUP #line 89 "ETCL/ETCL.ll" -{ - lvalp->constraint = +{ + lvalp->constraint = new TAO_ETCL_Boolean_Literal (0); TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN; } @@ -913,10 +933,10 @@ case 35: YY_RULE_SETUP #line 94 "ETCL/ETCL.ll" -{ - lvalp->constraint = +{ + lvalp->constraint = new TAO_ETCL_Integer_Literal (ACE_OS::atoi (yytext)); - TAO_YY_LEX_DEBUG; return TAO_ETCL_INTEGER; + TAO_YY_LEX_DEBUG; return TAO_ETCL_INTEGER; } YY_BREAK case 36: @@ -924,41 +944,41 @@ #line 99 "ETCL/ETCL.ll" { double v; - sscanf (yytext, "%lf", &v); - lvalp->constraint = + sscanf (yytext, "%lf", &v); + lvalp->constraint = new TAO_ETCL_Float_Literal (v); - TAO_YY_LEX_DEBUG; return TAO_ETCL_FLOAT; + TAO_YY_LEX_DEBUG; return TAO_ETCL_FLOAT; } YY_BREAK case 37: YY_RULE_SETUP #line 106 "ETCL/ETCL.ll" -{ +{ lvalp->constraint = new TAO_ETCL_String_Literal (extract_string(yytext)); - TAO_YY_LEX_DEBUG; return TAO_ETCL_STRING; + TAO_YY_LEX_DEBUG; return TAO_ETCL_STRING; } YY_BREAK case 38: YY_RULE_SETUP #line 111 "ETCL/ETCL.ll" -{ - lvalp->constraint = +{ + lvalp->constraint = new TAO_ETCL_Identifier (yytext); - TAO_YY_LEX_DEBUG; return TAO_ETCL_IDENT; + TAO_YY_LEX_DEBUG; return TAO_ETCL_IDENT; } YY_BREAK case 39: YY_RULE_SETUP #line 116 "ETCL/ETCL.ll" -{ +{ TAO_YY_LEX_DEBUG; break; // Ignore } YY_BREAK case 40: YY_RULE_SETUP #line 119 "ETCL/ETCL.ll" -{ +{ TAO_YY_LEX_DEBUG; break; // @@ TODO } YY_BREAK @@ -1877,7 +1897,7 @@ continue; } *t = *i; - + } return str;