aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/src/compiler_main.cpp
blob: 4ac641ced68f577bedb4369e837aadd8fb9a8566 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "node.hpp"
#include "bindings.hpp"

#include <cstdio>
#include <string>

Node* parseAST();

int main(int, char**)
{
    try
    {
	std::unique_ptr<Node> ast(parseAST());
	VariableStackBindings bindings;
	unsigned label_count = 0;
	ast->printAsm(bindings, label_count);	
    }
    catch(const std::exception& e)
    {
	fprintf(stderr, "%s\n", e.what());
    }
    catch(...)
    {
	fprintf(stderr, "Error : Exception thrown\n");
    }

    return 0;
}