2 * Copyright 2006-2009 Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Stephan Aßmus <superstippi@gmx.de>
7 * John Scipione <jscipione@gmail.com>
8 * Ingo Weinhold <bonefish@cs.tu-berlin.de>
10 #ifndef EXPRESSION_PARSER_H
11 #define EXPRESSION_PARSER_H
17 class ParseException
{
19 ParseException(const char* message
, int32 position
)
25 ParseException(const ParseException
& other
)
26 : message(other
.message
),
27 position(other
.position
)
38 class ExpressionParser
{
45 void SetDegreeMode(bool degrees
);
47 void SetSupportHexInput(bool enabled
);
49 BString
Evaluate(const char* expressionString
);
50 int64
EvaluateToInt64(const char* expressionString
);
51 double EvaluateToDouble(const char* expressionString
);
63 void _InitArguments(MAPM values
[],
65 MAPM
_ParseFunction(const Token
& token
);
67 MAPM
_ParseFactorial(MAPM value
);
69 void _EatToken(int32 type
);
71 Tokenizer
* fTokenizer
;
76 #endif // EXPRESSION_PARSER_H