2 * Copyright 2006 Haiku, Inc. All Rights Reserved.
3 * Copyright 1997, 1998 R3 Software Ltd. All Rights Reserved.
4 * Distributed under the terms of the MIT License.
7 * Timothy Wayper <timmy@wunderbear.com>
8 * Stephan Aßmus <superstippi@gmx.de>
14 #include "CalcApplication.h"
15 #include "ExpressionParser.h"
19 main(int argc
, char* argv
[])
23 CalcApplication
* app
= new CalcApplication();
28 // evaluate expression from command line
32 expression
<< argv
[i
];
37 ExpressionParser parser
;
38 BString result
= parser
.Evaluate(expression
.String());
39 printf("%s\n", result
.String());
40 } catch (ParseException e
) {
41 printf("%s at %" B_PRId32
"\n", e
.message
.String(), e
.position
+ 1);