2 #include "ace/Guard_T.h"
3 #include "ace/Truncate.h"
4 #include "ace/OS_NS_string.h"
6 #include "ace/ETCL/ETCL_Interpreter.h"
7 #include "ace/ETCL/ETCL_Constraint.h"
9 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
11 ETCL_Parser_Export ACE_SYNCH_MUTEX
ETCL_Interpreter::parserMutex__
;
13 ETCL_Interpreter::ETCL_Interpreter ()
18 ETCL_Interpreter::~ETCL_Interpreter ()
24 ETCL_Interpreter::build_tree (const char* constraints
)
26 ACE_GUARD_RETURN (ACE_SYNCH_MUTEX
,
28 ETCL_Interpreter::parserMutex__
,
31 Lex_String_Input::reset ((char*)constraints
);
34 int return_value
= ::yyparse ();
36 if (return_value
== 0 && yyval
.constraint
!= 0)
38 this->root_
= yyval
.constraint
;
49 ETCL_Interpreter::is_empty_string (const char* str
)
57 while (str
[i
] != '\0')
76 char* Lex_String_Input::string_
= 0;
77 char* Lex_String_Input::current_
= 0;
78 char* Lex_String_Input::end_
= 0;
80 // Routine to have Lex read its input from the constraint string.
83 Lex_String_Input::copy_into (char* buf
,
86 int const chars_left
=
87 ACE_Utils::truncate_cast
<int> (
88 Lex_String_Input::end_
- Lex_String_Input::current_
);
90 int const n
= max_size
> chars_left
? chars_left
: max_size
;
95 Lex_String_Input::current_
,
97 Lex_String_Input::current_
+= n
;
104 Lex_String_Input::reset (char* input_string
)
106 Lex_String_Input::string_
= input_string
;
107 Lex_String_Input::current_
= input_string
;
108 Lex_String_Input::end_
=
109 input_string
+ ACE_OS::strlen (Lex_String_Input::string_
);
112 ACE_END_VERSIONED_NAMESPACE_DECL