MADARA  3.2.3
Visitor.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 #ifndef _MADARA_VISITOR_H_
3 #define _MADARA_VISITOR_H_
4 
5 namespace madara
6 {
7  namespace expression
8  {
9  class LeafNode;
10  class VariableNode;
11  class VariableDecrementNode;
12  class VariableDivideNode;
13  class VariableIncrementNode;
14  class VariableMultiplyNode;
15  class VariableCompareNode;
16  class ListNode;
17  class CompositeArrayReference;
18  class CompositeConstArray;
19  class CompositeNegateNode;
20  class CompositePostdecrementNode;
21  class CompositePostincrementNode;
22  class CompositePredecrementNode;
23  class CompositePreincrementNode;
24  class CompositeNotNode;
25  class CompositeAddNode;
26  class CompositeBothNode;
27  class CompositeSequentialNode;
28  class CompositeSquareRootNode;
29  class CompositeFunctionNode;
30  class CompositeForLoop;
31  class CompositeImpliesNode;
32  class CompositeAssignmentNode;
33  class CompositeAndNode;
34  class CompositeOrNode;
35  class CompositeEqualityNode;
36  class CompositeInequalityNode;
37  class CompositeLessThanEqualNode;
38  class CompositeLessThanNode;
39  class CompositeGreaterThanEqualNode;
40  class CompositeGreaterThanNode;
41  class CompositeSubtractNode;
42  class CompositeDivideNode;
43  class CompositeMultiplyNode;
44  class CompositeModulusNode;
45  class CompositeReturnRightNode;
46  class SystemCallClearVariable;
47  class SystemCallCos;
48  class SystemCallDeleteVariable;
49  class SystemCallEval;
50  class SystemCallExpandEnv;
51  class SystemCallExpandStatement;
52  class SystemCallFragment;
53  class SystemCallGetClock;
54  class SystemCallGetTime;
55  class SystemCallGetTimeSeconds;
56  class SystemCallIsinf;
57  class SystemCallLogLevel;
58  class SystemCallPow;
59  class SystemCallPrint;
60  class SystemCallPrintSystemCalls;
61  class SystemCallRandDouble;
62  class SystemCallRandInt;
63  class SystemCallReadFile;
64  class SystemCallSetClock;
65  class SystemCallSetFixed;
66  class SystemCallSetPrecision;
67  class SystemCallSetScientific;
68  class SystemCallSin;
69  class SystemCallSize;
70  class SystemCallSleep;
71  class SystemCallSqrt;
72  class SystemCallTan;
73  class SystemCallToBuffer;
74  class SystemCallToDouble;
75  class SystemCallToDoubles;
76  class SystemCallToHostDirs;
77  class SystemCallToInteger;
78  class SystemCallToIntegers;
79  class SystemCallToString;
80  class SystemCallType;
81  class SystemCallWriteFile;
82 
91  class Visitor
92  {
93  public:
95  virtual void visit (const LeafNode &node) = 0;
96 
98  virtual void visit (const CompositeConstArray &node) = 0;
99 
101  virtual void visit (const CompositeArrayReference &node) = 0;
102 
104  virtual void visit (const VariableNode &node) = 0;
105 
107  virtual void visit (const VariableDecrementNode &node) = 0;
108 
110  virtual void visit (const VariableDivideNode &node) = 0;
111 
113  virtual void visit (const VariableIncrementNode &node) = 0;
114 
116  virtual void visit (const VariableMultiplyNode &node) = 0;
117 
119  virtual void visit (const VariableCompareNode &node) = 0;
120 
122  virtual void visit (const ListNode &node) = 0;
123 
125  virtual void visit (const CompositeNegateNode &node) = 0;
126 
128  virtual void visit (const CompositePostdecrementNode &node) = 0;
129 
131  virtual void visit (const CompositePostincrementNode &node) = 0;
132 
134  virtual void visit (const CompositePredecrementNode &node) = 0;
135 
137  virtual void visit (const CompositePreincrementNode &node) = 0;
138 
140  virtual void visit (const CompositeSquareRootNode &node) = 0;
141 
143  virtual void visit (const CompositeNotNode &node) = 0;
144 
146  virtual void visit (const CompositeAddNode &node) = 0;
147 
149  virtual void visit (const CompositeAssignmentNode &node) = 0;
150 
152  virtual void visit (const CompositeAndNode &node) = 0;
153 
155  virtual void visit (const CompositeOrNode &node) = 0;
156 
158  virtual void visit (const CompositeEqualityNode &node) = 0;
159 
161  virtual void visit (const CompositeInequalityNode &node) = 0;
162 
164  virtual void visit (const CompositeGreaterThanEqualNode &node) = 0;
165 
167  virtual void visit (const CompositeGreaterThanNode &node) = 0;
168 
170  virtual void visit (const CompositeLessThanEqualNode &node) = 0;
171 
173  virtual void visit (const CompositeLessThanNode &node) = 0;
174 
176  virtual void visit (const CompositeSubtractNode &node) = 0;
177 
179  virtual void visit (const CompositeDivideNode &node) = 0;
180 
182  virtual void visit (const CompositeMultiplyNode &node) = 0;
183 
185  virtual void visit (const CompositeModulusNode &node) = 0;
186 
188  virtual void visit (const CompositeBothNode &node) = 0;
189 
191  virtual void visit (const CompositeReturnRightNode &node) = 0;
192 
194  virtual void visit (const CompositeSequentialNode &node) = 0;
195 
197  virtual void visit (const CompositeFunctionNode &node) = 0;
198 
200  virtual void visit (const CompositeForLoop &node) = 0;
201 
203  virtual void visit (const CompositeImpliesNode &node) = 0;
204 
206  virtual void visit (const SystemCallClearVariable &node) = 0;
207 
209  virtual void visit (const SystemCallCos &node) = 0;
210 
212  virtual void visit (const SystemCallDeleteVariable &node) = 0;
213 
215  virtual void visit (const SystemCallEval &node) = 0;
216 
218  virtual void visit (const SystemCallExpandEnv &node) = 0;
219 
221  virtual void visit (const SystemCallExpandStatement &node) = 0;
222 
224  virtual void visit (const SystemCallFragment &node) = 0;
225 
227  virtual void visit (const SystemCallGetClock &node) = 0;
228 
230  virtual void visit (const SystemCallGetTime &node) = 0;
231 
233  virtual void visit (const SystemCallGetTimeSeconds &node) = 0;
234 
236  virtual void visit (const SystemCallIsinf &node) = 0;
237 
239  virtual void visit (const SystemCallLogLevel &node) = 0;
240 
242  virtual void visit (const SystemCallPow &node) = 0;
243 
245  virtual void visit (const SystemCallPrint &node) = 0;
246 
248  virtual void visit (const SystemCallPrintSystemCalls &node) = 0;
249 
251  virtual void visit (const SystemCallRandDouble &node) = 0;
252 
254  virtual void visit (const SystemCallRandInt &node) = 0;
255 
257  virtual void visit (const SystemCallReadFile &node) = 0;
258 
260  virtual void visit (const SystemCallSetClock &node) = 0;
261 
263  virtual void visit (const SystemCallSin &node) = 0;
264 
266  virtual void visit (const SystemCallSize &node) = 0;
267 
269  virtual void visit (const SystemCallSleep &node) = 0;
270 
272  virtual void visit (const SystemCallSqrt &node) = 0;
273 
275  virtual void visit (const SystemCallTan &node) = 0;
276 
278  virtual void visit (const SystemCallToBuffer &node) = 0;
279 
281  virtual void visit (const SystemCallToDouble &node) = 0;
282 
284  virtual void visit (const SystemCallToDoubles &node) = 0;
285 
287  virtual void visit (const SystemCallToHostDirs &node) = 0;
288 
290  virtual void visit (const SystemCallToInteger &node) = 0;
291 
293  virtual void visit (const SystemCallToIntegers &node) = 0;
294 
296  virtual void visit (const SystemCallToString &node) = 0;
297 
299  virtual void visit (const SystemCallType &node) = 0;
300 
302  virtual void visit (const SystemCallWriteFile &node) = 0;
303 
305  virtual void visit (const SystemCallSetFixed &node) = 0;
306 
308  virtual void visit (const SystemCallSetPrecision &node) = 0;
309 
311  virtual void visit (const SystemCallSetScientific &node) = 0;
312 
314  virtual ~Visitor (void) = 0;
315  };
316  }
317 }
318 
319 #endif /* _MADARA_VISITOR_H_ */
Calculates a base term taken to a power.
Definition: SystemCallPow.h:24
Sets the system clock or a variable clock.
Returns the time in nanoseconds since epoch.
Returns the type of a specified knowledge record.
Composite node that divides a variable by some right hand side.
Sleeps for a certain amount of time.
Defines a terminal node of that references the current value stored in a variable.
Definition: VariableNode.h:28
A composite node that increments a right expression.
Returns the cosine of a term in radians.
Definition: SystemCallCos.h:24
Sets the output format to use std::scientific.
Converts an argument to an array of doubles.
Defines a terminal node of that references the current value stored in a variable.
A composite node that encompasses addition of two expressions.
A composite node that compares left and right children for inequality.
Composite node that subtracts a variable by some right hand side.
A composite node that encompasses subtraction of a right expression from a left expression.
A composite node that iterates until a condition is met.
A composite node that divides a left expression by a right expression and returns the remainder of th...
A composite node that compares left and right expressions for greater than or equal to...
A composite node that evaluates both left and right expressions regardless of their evaluations...
A composite node that compares left and right children for less than or equal to. ...
Converts an argument to a string.
Returns the expansion of a statement.
A composite node that multiplies a left expression by a right expression.
A composite node that evaluates both left and right expressions regardless of their evaluations...
A composite node that takes the square root of a term.
A composite node that decrements a left expression.
Returns the sin of a term in radians.
Definition: SystemCallSin.h:24
A composite node that performs an implication (inference rule)
A composite node that decrements a right expression.
Returns a fragment of the knowledge record.
A composite node that evaluates both left and right expressions regardless of their evaluations...
A composite node that calls a function.
Defines a node that contains a madara::knowledge::KnowledgeRecord::Integer value. ...
Definition: LeafNode.h:23
Writes a knowledge record to an user-specified file name.
Converts an argument into an unsigned char buffer.
Returns the type of a specified knowledge record.
virtual ~Visitor(void)=0
No-op destructor to hold things together.
Definition: Visitor.cpp:7
Sets or returns the current MADARA logging level.
Returns the size of a specified knowledge record.
A composite node that performs a logical and.
Returns the expansion of a statement with environment vars.
Converts an argument to an array of integers.
Returns the square root of a term.
Composite node that multiplies a variable by some right hand side.
A composite node that compares left and right expressions for equality.
Returns the current time in seconds since epoch.
A composite node that increments a right expression.
Converts an argument to a double.
Evaluates a knowledge::KnowledgeRecord and returns the evaluation result.
Sets the double precision for converting doubles to a string and for printing.
A composite node that logically nots a right expression.
A composite node that allows for variable assignment.
A composite node that compares left and right children for greater than.
Returns the system clock or a variable clock.
Abstract base class for all visitors to all classes that derive from ComponentNode.
Definition: Visitor.h:91
Returns the tangent of a term in radians.
Definition: SystemCallTan.h:24
A composite node that integrally negates a right expression.
A composite node that contains an array of values.
Sets the output format to use std::fixed.
A composite node that performs a logical or.
Ensures the directory delimiters are appropriate for the host operating system (e.g., on Windows, '\' and Linux, '/')
Reads a file from an user-provided file name.
A composite node that divides a left expression by a right one.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
Copyright (c) 2015 Carnegie Mellon University.
Defines a terminal node of that references the current value stored in a variable.
Prints a Knowledge Record.
Converts an argument to an integer.
Defines a terminal node that contains a list.
Definition: ListNode.h:27
Defines a terminal node of that references the current value stored in a variable.
A composite node that compares left and right children for less than.