BALL  1.5.0
expressionParser.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_KERNEL_EXPRESSIONPARSER_H
6 #define BALL_KERNEL_EXPRESSIONPARSER_H
7 
8 #ifndef BALL_KERNEL_EXPRESSION_TREE_H
10 #endif
11 
12 namespace BALL
13 {
14 
23  {
24  public:
25 
32  {
33  public:
34 
38 
40  typedef list<SyntaxTree*>::iterator Iterator;
41 
43  typedef list<SyntaxTree*>::const_iterator ConstIterator;
44 
46 
50 
54 
57  SyntaxTree(const char* predicate_name, const char* args);
58 
62 
65  virtual ~SyntaxTree();
66 
68 
71 
76  virtual void clear();
77 
79 
83 
87 
91 
95 
98  ConstIterator end() const;
99 
101 
105  void dump(std::ostream& is = std::cout, Size depth = 0) const;
107 
114 
118 
122 
125  bool evaluated;
126 
129  bool negate;
130 
134 
137  list<SyntaxTree*> children;
139  };
140 
141 
145 
148 
151 
155 
159 
163  void parse(const String& s);
164 
168  const SyntaxTree& getSyntaxTree() const;
169 
171 
172  struct State
173  {
176  const char* buffer;
178  };
179 
180  static State state;
181 
182  protected:
185  };
186 } // namespace BALL
187 
188 #endif // BALL_KERNEL_EXPRESSIONPARSER_H
Definition: constants.h:13
ExpressionParser(const ExpressionParser &parser)
const SyntaxTree & getSyntaxTree() const
static ExpressionParser * current_parser_
void parse(const String &s)
SyntaxTree(SyntaxTree *left, SyntaxTree *right, ExpressionTree::Type type)
void dump(std::ostream &is=std::cout, Size depth=0) const
list< SyntaxTree * >::iterator Iterator
An iterator for the children of a given node.
list< SyntaxTree * >::const_iterator ConstIterator
A const iterator for the children of a given node.
SyntaxTree(const char *predicate_name, const char *args)
ExpressionParser * current_parser
#define BALL_EXPORT
Definition: COMMON/global.h:50