1 /***************************************************************************
3 * Copyright 2012 BMW Car IT GmbH
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 ****************************************************************************/
19 #ifndef __EXPRESSION_H__
20 #define __EXPRESSION_H__
28 typedef void(*callback)(Expression*);
29 typedef list<Expression*> ExpressionList;
34 Expression(string name, Expression* parent);
37 Expression* getPreviousExpression();
38 void addNextExpression(Expression* word);
39 Expression* getNextExpression(string text);
40 ExpressionList getNextExpressions();
41 ExpressionList getClosure(bool bypass);
42 ExpressionList getNextExpressionClosure(string text);
43 ExpressionList getClosureExecutables(bool canBypass);
45 void setFunc(callback funcPtr);
50 void setVarValue(string value);
52 string getString(string name);
53 unsigned int getUint(string name);
54 void getUintArray(string name, unsigned int** array, unsigned int* scount);
55 int getInt(string name);
56 double getDouble(string name);
57 bool getBool(string name);
58 bool contains(string name);
60 void printTree(int level = 0);
61 void printList(string list = "");
65 ExpressionList mNextWords;
66 Expression* mPreviousWord;
73 #endif // __EXPRESSION_H__