From 14cfc7d0932dd67bfcd980776049e652fee4a5f4 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 6 Jan 2012 04:51:33 +1000 Subject: Add more LSL parsing structure. --- LuaSL/src/LuaSL_parser.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'LuaSL/src/LuaSL_parser.c') diff --git a/LuaSL/src/LuaSL_parser.c b/LuaSL/src/LuaSL_parser.c index f5a56d3..35cb782 100644 --- a/LuaSL/src/LuaSL_parser.c +++ b/LuaSL/src/LuaSL_parser.c @@ -5,14 +5,16 @@ int main(void) { const char test[] = " 4 + 2*10 + 3*( 5 + 1 )"; - SExpression *e = NULL; + LSL_Expression *exp; - if ((e = getAST(test))) + if ((exp = newTree(test))) { - int result = evaluate(e); + int result = evaluateExpression(exp, 0); printf("Result of '%s' is %d\n", test, result); - deleteExpression(e); + outputExpression(exp); + printf("\n"); + burnLSLExpression(exp); } return 0; -- cgit v1.1