Translates a role definition. More...
#include <TranslatorRole.h>
Public Member Functions | |
TranslatorRole (const string &fname, size_t lineno, const string &text) | |
Constructor. More... | |
const string | translate (TranslationContext &context) override |
Translates a role definition. More... | |
Private Attributes | |
string | m_fname |
Source file name containing input text. More... | |
size_t | m_lineno |
Starting offset within m_fname of input text. More... | |
string | m_text |
Input text containing role definition statememt. More... | |
Translates a role definition.
Definition at line 43 of file TranslatorRole.h.
|
inline |
Constructor.
fname | Filename of source file |
lineno | Starting offset within source file of input text |
text | Input text |
Definition at line 49 of file TranslatorRole.h.
|
overridevirtual |
Translates a role definition.
This function translates role definitions of the form:
role: slave test[00-99]
To a bash variable definition of the form:
ROLE_slave="test[00-99]"
As a side effect, it inserts the role name into context.roles
and inserts the variable name representing the role (e.g. ROLE_name
) into the context.symbols
map, mapping it to the role value (e.g. test[00-99]
in the above example).
context | Context object containing symbol tables |
Implements Hypertable::ClusterDefinitionFile::Translator.
Definition at line 43 of file TranslatorRole.cc.
|
private |
Source file name containing input text.
Definition at line 72 of file TranslatorRole.h.
|
private |
Starting offset within m_fname of input text.
Definition at line 74 of file TranslatorRole.h.
|
private |
Input text containing role definition statememt.
Definition at line 76 of file TranslatorRole.h.