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


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

    if ((e = getAST(test)))
    {
	int result = evaluate(e);

	printf("Result of '%s' is %d\n", test, result);
	deleteExpression(e);
    }

    return 0;
}