#include "../include/parser.h"
#include "../include/exceptions.h"

int main(int argc, const char** argv)
{
    if(argc != 2)
    {
        printf("Arguments: file name.\n");
        return 1;
    }
    else
    {
        try
        {
           FileAccess * file = new FileAccess(argv[1]); 
           TextCursor cursor(file);
           parse_file(cursor);
        }
        catch(FileNotExistsError)
        {
            printf("File not exists.\n");
            return 2;
        }
    }
    return 0;
}

#include "../include/parser.h"
#include "../include/exceptions.h"

int main(int argc, const char** argv)
{
    if(argc != 2)
    {
        printf("Arguments: file name.\n");
        exit(1);
    }
    else
    {
        try
        {
           FileAccess * file = new FileAccess(argv[1]); 
           TextCursor cursor(file);
           parse_file(cursor);
        }
        catch(FileNotExistsError)
        {
            printf("File not exists.\n");
            exit(2);
        }
    }
}

--- 
+++ 
@@ -6,7 +6,7 @@
     if(argc != 2)
     {
         printf("Arguments: file name.\n");
-        exit(1);
+        return 1;
     }
     else
     {
@@ -19,7 +19,8 @@
         catch(FileNotExistsError)
         {
             printf("File not exists.\n");
-            exit(2);
+            return 2;
         }
     }
+    return 0;
 }
Use return instead of exit.
