MADARA  3.1.8
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 SystemCallLogLevel;
57  class SystemCallPow;
58  class SystemCallPrint;
59  class SystemCallPrintSystemCalls;
60  class SystemCallRandDouble;
61  class SystemCallRandInt;
62  class SystemCallReadFile;
63  class SystemCallSetClock;
64  class SystemCallSetFixed;
65  class SystemCallSetPrecision;
66  class SystemCallSetScientific;
67  class SystemCallSin;
68  class SystemCallSize;
69  class SystemCallSleep;
70  class SystemCallSqrt;
71  class SystemCallTan;
72  class SystemCallToBuffer;
73  class SystemCallToDouble;
74  class SystemCallToDoubles;
75  class SystemCallToHostDirs;
76  class SystemCallToInteger;
77  class SystemCallToIntegers;
78  class SystemCallToString;
79  class SystemCallType;
80  class SystemCallWriteFile;
81 
90  class Visitor
91  {
92  public:
94  virtual void visit (const LeafNode &node) = 0;
95 
97  virtual void visit (const CompositeConstArray &node) = 0;
98 
100  virtual void visit (const CompositeArrayReference &node) = 0;
101 
103  virtual void visit (const VariableNode &node) = 0;
104 
106  virtual void visit (const VariableDecrementNode &node) = 0;
107 
109  virtual void visit (const VariableDivideNode &node) = 0;
110 
112  virtual void visit (const VariableIncrementNode &node) = 0;
113 
115  virtual void visit (const VariableMultiplyNode &node) = 0;
116 
118  virtual void visit (const VariableCompareNode &node) = 0;
119 
121  virtual void visit (const ListNode &node) = 0;
122 
124  virtual void visit (const CompositeNegateNode &node) = 0;
125 
127  virtual void visit (const CompositePostdecrementNode &node) = 0;
128 
130  virtual void visit (const CompositePostincrementNode &node) = 0;
131 
133  virtual void visit (const CompositePredecrementNode &node) = 0;
134 
136  virtual void visit (const CompositePreincrementNode &node) = 0;
137 
139  virtual void visit (const CompositeSquareRootNode &node) = 0;
140 
142  virtual void visit (const CompositeNotNode &node) = 0;
143 
145  virtual void visit (const CompositeAddNode &node) = 0;
146 
148  virtual void visit (const CompositeAssignmentNode &node) = 0;
149 
151  virtual void visit (const CompositeAndNode &node) = 0;
152 
154  virtual void visit (const CompositeOrNode &node) = 0;
155 
157  virtual void visit (const CompositeEqualityNode &node) = 0;
158 
160  virtual void visit (const CompositeInequalityNode &node) = 0;
161 
163  virtual void visit (const CompositeGreaterThanEqualNode &node) = 0;
164 
166  virtual void visit (const CompositeGreaterThanNode &node) = 0;
167 
169  virtual void visit (const CompositeLessThanEqualNode &node) = 0;
170 
172  virtual void visit (const CompositeLessThanNode &node) = 0;
173 
175  virtual void visit (const CompositeSubtractNode &node) = 0;
176 
178  virtual void visit (const CompositeDivideNode &node) = 0;
179 
181  virtual void visit (const CompositeMultiplyNode &node) = 0;
182 
184  virtual void visit (const CompositeModulusNode &node) = 0;
185 
187  virtual void visit (const CompositeBothNode &node) = 0;
188 
190  virtual void visit (const CompositeReturnRightNode &node) = 0;
191 
193  virtual void visit (const CompositeSequentialNode &node) = 0;
194 
196  virtual void visit (const CompositeFunctionNode &node) = 0;
197 
199  virtual void visit (const CompositeForLoop &node) = 0;
200 
202  virtual void visit (const CompositeImpliesNode &node) = 0;
203 
205  virtual void visit (const SystemCallClearVariable &node) = 0;
206 
208  virtual void visit (const SystemCallCos &node) = 0;
209 
211  virtual void visit (const SystemCallDeleteVariable &node) = 0;
212 
214  virtual void visit (const SystemCallEval &node) = 0;
215 
217  virtual void visit (const SystemCallExpandEnv &node) = 0;
218 
220  virtual void visit (const SystemCallExpandStatement &node) = 0;
221 
223  virtual void visit (const SystemCallFragment &node) = 0;
224 
226  virtual void visit (const SystemCallGetClock &node) = 0;
227 
229  virtual void visit (const SystemCallGetTime &node) = 0;
230 
232  virtual void visit (const SystemCallGetTimeSeconds &node) = 0;
233 
235  virtual void visit (const SystemCallLogLevel &node) = 0;
236 
238  virtual void visit (const SystemCallPow &node) = 0;
239 
241  virtual void visit (const SystemCallPrint &node) = 0;
242 
244  virtual void visit (const SystemCallPrintSystemCalls &node) = 0;
245 
247  virtual void visit (const SystemCallRandDouble &node) = 0;
248 
250  virtual void visit (const SystemCallRandInt &node) = 0;
251 
253  virtual void visit (const SystemCallReadFile &node) = 0;
254 
256  virtual void visit (const SystemCallSetClock &node) = 0;
257 
259  virtual void visit (const SystemCallSin &node) = 0;
260 
262  virtual void visit (const SystemCallSize &node) = 0;
263 
265  virtual void visit (const SystemCallSleep &node) = 0;
266 
268  virtual void visit (const SystemCallSqrt &node) = 0;
269 
271  virtual void visit (const SystemCallTan &node) = 0;
272 
274  virtual void visit (const SystemCallToBuffer &node) = 0;
275 
277  virtual void visit (const SystemCallToDouble &node) = 0;
278 
280  virtual void visit (const SystemCallToDoubles &node) = 0;
281 
283  virtual void visit (const SystemCallToHostDirs &node) = 0;
284 
286  virtual void visit (const SystemCallToInteger &node) = 0;
287 
289  virtual void visit (const SystemCallToIntegers &node) = 0;
290 
292  virtual void visit (const SystemCallToString &node) = 0;
293 
295  virtual void visit (const SystemCallType &node) = 0;
296 
298  virtual void visit (const SystemCallWriteFile &node) = 0;
299 
301  virtual void visit (const SystemCallSetFixed &node) = 0;
302 
304  virtual void visit (const SystemCallSetPrecision &node) = 0;
305 
307  virtual void visit (const SystemCallSetScientific &node) = 0;
308 
310  virtual ~Visitor (void) = 0;
311  };
312  }
313 }
314 
315 #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.
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:90
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.