aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_parser.c
blob: 35cb7823546b7d440cd9089d9a00b0bb59c379f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "LuaSL_LSL_tree.h"
#include <stdio.h>


int main(void)
{
    const char test[] = " 4 + 2*10 + 3*( 5 + 1 )";
    LSL_Expression *exp;

    if ((exp = newTree(test)))
    {
	int result = evaluateExpression(exp, 0);

	printf("Result of '%s' is %d\n", test, result);
	outputExpression(exp);
	printf("\n");
	burnLSLExpression(exp);
    }

    return 0;
}