BALL
1.4.2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
BALL
KERNEL
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
9
# include <
BALL/KERNEL/expressionTree.h
>
10
#endif
11
12
namespace
BALL
13
{
14
22
class
BALL_EXPORT
ExpressionParser
23
{
24
public
:
25
31
class
BALL_EXPORT
SyntaxTree
32
{
33
public
:
34
38
40
typedef
list<SyntaxTree*>::iterator
Iterator
;
41
43
typedef
list<SyntaxTree*>::const_iterator
ConstIterator
;
44
46
50
53
SyntaxTree
();
54
57
SyntaxTree
(
const
char
* predicate_name,
const
char
* args);
58
61
SyntaxTree
(
SyntaxTree
* left,
SyntaxTree
* right,
ExpressionTree::Type
type);
62
65
virtual
~
SyntaxTree
();
66
68
71
76
virtual
void
clear();
77
79
83
86
Iterator
begin();
87
90
Iterator
end();
91
94
ConstIterator
begin()
const
;
95
98
ConstIterator
end()
const
;
99
101
105
void
dump(std::ostream& is = std::cout,
Size
depth = 0)
const
;
107
113
String
expression
;
114
117
String
predicate
;
118
121
String
argument
;
122
125
bool
evaluated
;
126
129
bool
negate
;
130
133
ExpressionTree::Type
type
;
134
137
list<SyntaxTree*>
children
;
139
};
140
141
145
147
ExpressionParser
();
148
150
ExpressionParser
(
const
ExpressionParser
& parser);
151
153
~
ExpressionParser
();
155
159
163
void
parse(
const
String
& s);
164
168
const
SyntaxTree
& getSyntaxTree()
const
;
169
171
172
struct
State
173
{
174
Size
char_count
;
175
ExpressionParser
*
current_parser
;
176
const
char
*
buffer
;
177
SyntaxTree
*
tree
;
178
};
179
180
static
State
state
;
181
182
protected
:
183
SyntaxTree
*
syntax_tree_
;
184
static
ExpressionParser
*
current_parser_
;
185
};
186
}
// namespace BALL
187
188
#endif // BALL_KERNEL_EXPRESSIONPARSER_H
Generated by
1.8.3.1