Have Lex read from a string and not from stdin. Essentially, the interpreter needs to call yylex() until EOF, and call TAO_Lex_String_Input::reset() with the new string, prior to calling yyparse. More...
#include <ETCL_Interpreter.h>
Static Public Member Functions | |
| static void | reset (char *input_string) |
| Reset the lex input. | |
| static int | copy_into (char *buf, int max_size) |
| Method lex will call to read from the input string. | |
Static Private Attributes | |
| static char * | string_ = 0 |
| Pointers to keep track of the input string. | |
| static char * | current_ = 0 |
| static char * | end_ = 0 |
Have Lex read from a string and not from stdin. Essentially, the interpreter needs to call yylex() until EOF, and call TAO_Lex_String_Input::reset() with the new string, prior to calling yyparse.
Definition at line 87 of file ETCL_Interpreter.h.
| int Lex_String_Input::copy_into | ( | char * | buf, | |
| int | max_size | |||
| ) | [static] |
Method lex will call to read from the input string.
Definition at line 84 of file ETCL_Interpreter.cpp.
{
int const chars_left =
ACE_Utils::truncate_cast<int> (
Lex_String_Input::end_ - Lex_String_Input::current_);
int const n = max_size > chars_left ? chars_left : max_size;
if (n > 0)
{
ACE_OS::memcpy (buf,
Lex_String_Input::current_,
n);
Lex_String_Input::current_ += n;
}
return n;
}
| void Lex_String_Input::reset | ( | char * | input_string | ) | [static] |
Reset the lex input.
Definition at line 105 of file ETCL_Interpreter.cpp.
{
Lex_String_Input::string_ = input_string;
Lex_String_Input::current_ = input_string;
Lex_String_Input::end_ =
input_string + ACE_OS::strlen (Lex_String_Input::string_);
}
char * Lex_String_Input::current_ = 0 [static, private] |
Definition at line 100 of file ETCL_Interpreter.h.
char * Lex_String_Input::end_ = 0 [static, private] |
Definition at line 101 of file ETCL_Interpreter.h.
char * Lex_String_Input::string_ = 0 [static, private] |
Pointers to keep track of the input string.
Definition at line 99 of file ETCL_Interpreter.h.
1.7.0