Titan Core Initial Contribution
[deliverable/titan.core.git] / langviz / main.cc
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2014 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
8 #include <stdio.h>
9 #include <string.h>
10 #include "../common/memory.h"
11 #include "error.h"
12 #include "Node.hh"
13 #include "Grammar.hh"
14 #include "Iterator.hh"
15 #include "Graph.hh"
16
17 extern int bison_parse_file(const char* filename);
18
19 Grammar *grammar=0;
20
21 void show_usage()
22 {
23 fprintf(stderr, "Usage: %s bison_filename\n", argv0);
24 }
25
26 int main(int argc, char *argv[])
27 {
28 argv0 = argv[0];
29
30 if(argc!=2) {
31 show_usage();
32 return 1;
33 }
34
35 char *infilename=argv[1];
36 grammar=new Grammar();
37
38 bison_parse_file(infilename);
39
40 grammar->compute_all();
41 graph_use(grammar);
42
43 delete grammar;
44 Node::chk_counter();
45 check_mem_leak(argv0);
46 }
This page took 0.040702 seconds and 5 git commands to generate.