aboutsummaryrefslogtreecommitdiff
path: root/vendor/cmilan/src/main.cpp
blob: 9de9803125ff4321e22d9455d7dc4c9fc2fe58b2 (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
29
30
31
32
#include "parser.h"
#include <iostream>
#include <cstdlib>

using namespace std;

void printHelp()
{
  cout << "Usage: cmilan input_file" << endl;
}

int main(int argc, char** argv)
{
  if(argc < 2) {
    printHelp();
    return EXIT_FAILURE;
  }

  ifstream input;
  input.open(argv[1]);

  if(input) {
    Parser p(argv[1], input);
    p.parse();
    return EXIT_SUCCESS;
  }
  else {
    cerr << "File '" << argv[1] << "' not found" << endl;
    return EXIT_FAILURE;
  }
}