2 #ifndef _MADARA_NO_KARL_ 46 bool arg_can_change =
false;
47 result =
nodes_[0]->prune (arg_can_change);
49 if (!arg_can_change && dynamic_cast <LeafNode *> (
nodes_[0]) == 0)
58 "madara::expression::SystemCallExpandEnv: " 60 "System call expand_env requires 1 argument," 61 "e.g., #expand_env ('path=$(MADARA_ROOT')\n");
63 throw KarlException (
"madara::expression::SystemCallExpandEnv: " 64 "KARL COMPILE ERROR: " 65 "System call expand_env requires 1 argument," 66 "e.g., #expand_env ('path=$(MADARA_ROOT')\n");
86 "madara::expression::SystemCallExpandEnv: " 87 "System call expand_var is returning the expansion " 88 "of %s.\n", statement.c_str ());
95 "madara::expression::SystemCallExpandEnv: " 97 "System call expand_env requires 1 argument," 98 "e.g., #expand_env ('path=$(MADARA_ROOT')\n");
100 throw KarlException (
"madara::expression::SystemCallExpandEnv: " 101 "KARL RUNTIME ERROR: " 102 "System call expand_env requires 1 argument," 103 "e.g., #expand_env ('path=$(MADARA_ROOT')\n");
114 visitor.
visit (*
this);
117 #endif // _MADARA_NO_KARL_ This class encapsulates an entry in a KnowledgeBase.
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the value of the node.
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
madara::knowledge::KnowledgeRecord KnowledgeRecord
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes
logger::Logger * logger_
handle the context
This class stores variables and their values for use by any entity needing state information in a thr...
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
Defines a node that contains a madara::knowledge::KnowledgeRecord::Integer value. ...
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
#define madara_logger_ptr_log(logger, level,...)
Fast version of the madara::logger::log method for Logger pointers.
SystemCallExpandEnv(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
Abstract base class for all visitors to all classes that derive from ComponentNode.
An exception for unrecoverable KaRL compilation issues.
Interface for a MADARA system call.
std::string expand_envs(const std::string &source)
Expand any environment variables in a string.
Settings for applying knowledge updates.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
virtual ~SystemCallExpandEnv(void)
Destructor.