#include <Interpreter.h>
Inheritance diagram for TAO_Interpreter:
Protected Member Functions | |
TAO_Interpreter (void) | |
Constructor. | |
~TAO_Interpreter (void) | |
Destructor. | |
int | build_tree (const char *preferences) |
Static Protected Member Functions | |
int | is_empty_string (const char *str) |
Protected Attributes | |
TAO_Constraint * | root_ |
Static Private Attributes | |
TAO_SYNCH_MUTEX | parserMutex__ |
This mutex protects the method from reentrance. |
Definition at line 33 of file Interpreter.h.
|
Constructor.
Definition at line 10 of file Interpreter.cpp.
00011 : root_ (0) 00012 { 00013 } |
|
Destructor.
Definition at line 15 of file Interpreter.cpp.
00016 { 00017 delete root_; 00018 } |
|
Using the Yacc generated parser, construct an expression tree representing from the tokens returned by it. Definition at line 21 of file Interpreter.cpp. References ACE_GUARD_RETURN, YYSTYPE::constraint_, parserMutex__, TAO_Lex_String_Input::reset(), TAO_SYNCH_MUTEX, yylex(), and yyval.
00022 { 00023 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, 00024 guard, 00025 TAO_Interpreter::parserMutex__, 00026 -1); 00027 00028 TAO_Lex_String_Input::reset ((char*)constraints); 00029 int return_value = 0; 00030 00031 yyval.constraint_ = 0; 00032 return_value = ::yyparse (); 00033 00034 if (return_value == 0 && yyval.constraint_ != 0) 00035 this->root_ = yyval.constraint_; 00036 else 00037 { 00038 while (yylex () > 0) 00039 continue; 00040 this->root_ = 0; 00041 } 00042 00043 return return_value; 00044 } |
|
Definition at line 47 of file Interpreter.cpp. Referenced by TAO_Constraint_Interpreter::TAO_Constraint_Interpreter(), and TAO_Preference_Interpreter::TAO_Preference_Interpreter().
00048 { 00049 int return_value = 0; 00050 00051 if (str != 0) 00052 { 00053 int i = 0; 00054 while (str[i] != '\0') 00055 { 00056 if (str[i] != ' ') 00057 break; 00058 00059 i++; 00060 } 00061 00062 if (str[i] == '\0') 00063 return_value = 1; 00064 } 00065 00066 return return_value; 00067 } |
|
This mutex protects the method from reentrance.
Definition at line 8 of file Interpreter.cpp. Referenced by build_tree(). |
|
The root of the expression tree, not equal to null if build_tree successfully builds a tree from the constraints. Definition at line 51 of file Interpreter.h. |