aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/src/compiler_main.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-03-22 14:17:29 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-03-22 14:17:29 +0000
commitf12ccd62ecf08774ce599a2e15d9042500d2760a (patch)
tree12012ae296025441c3329e23a7290732cf33c36c /c_compiler/src/compiler_main.cpp
parent190b7a0e5d45367230795ac0bdf6fc2f248ba9e1 (diff)
downloadCompiler-f12ccd62ecf08774ce599a2e15d9042500d2760a.tar.gz
Compiler-f12ccd62ecf08774ce599a2e15d9042500d2760a.zip
Adding test and break working
Diffstat (limited to 'c_compiler/src/compiler_main.cpp')
-rw-r--r--c_compiler/src/compiler_main.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/c_compiler/src/compiler_main.cpp b/c_compiler/src/compiler_main.cpp
index dcc9e09..e9a12b9 100644
--- a/c_compiler/src/compiler_main.cpp
+++ b/c_compiler/src/compiler_main.cpp
@@ -6,20 +6,21 @@
Node* parseAST();
-int main(int argc, char *argv[])
+int main(int, char**)
{
- (void)argc, (void)argv;
-
- try {
+ try
+ {
std::unique_ptr<Node> ast(parseAST());
VariableStackBindings bindings;
unsigned label_count = 0;
- ast->printAsm(bindings, label_count);
-
- } catch(std::string error_msg) {
+ ast->printAsm(bindings, label_count);
+ }
+ catch(std::string error_msg)
+ {
fprintf(stderr, "%s\n", error_msg.c_str());
-
- } catch(...) {
+ }
+ catch(...)
+ {
fprintf(stderr, "Error : Exception thrown\n");
}