aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_parser.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-06 04:51:33 +1000
committerDavid Walter Seikel2012-01-06 04:51:33 +1000
commit14cfc7d0932dd67bfcd980776049e652fee4a5f4 (patch)
tree2503e81a8fef238f672249ab12e34edd8773644f /LuaSL/src/LuaSL_parser.c
parentUpdate the not yet used real parser includes to. (diff)
downloadSledjHamr-14cfc7d0932dd67bfcd980776049e652fee4a5f4.zip
SledjHamr-14cfc7d0932dd67bfcd980776049e652fee4a5f4.tar.gz
SledjHamr-14cfc7d0932dd67bfcd980776049e652fee4a5f4.tar.bz2
SledjHamr-14cfc7d0932dd67bfcd980776049e652fee4a5f4.tar.xz
Add more LSL parsing structure.
Diffstat (limited to 'LuaSL/src/LuaSL_parser.c')
-rw-r--r--LuaSL/src/LuaSL_parser.c10
1 files changed, 6 insertions, 4 deletions
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 @@
5int main(void) 5int main(void)
6{ 6{
7 const char test[] = " 4 + 2*10 + 3*( 5 + 1 )"; 7 const char test[] = " 4 + 2*10 + 3*( 5 + 1 )";
8 SExpression *e = NULL; 8 LSL_Expression *exp;
9 9
10 if ((e = getAST(test))) 10 if ((exp = newTree(test)))
11 { 11 {
12 int result = evaluate(e); 12 int result = evaluateExpression(exp, 0);
13 13
14 printf("Result of '%s' is %d\n", test, result); 14 printf("Result of '%s' is %d\n", test, result);
15 deleteExpression(e); 15 outputExpression(exp);
16 printf("\n");
17 burnLSLExpression(exp);
16 } 18 }
17 19
18 return 0; 20 return 0;