Commit | Line | Data |
---|---|---|
d44e3c4f | 1 | /****************************************************************************** |
2 | * Copyright (c) 2000-2016 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 | * Contributors: | |
9 | * Balasko, Jeno | |
10 | * Forstner, Matyas | |
11 | * | |
12 | ******************************************************************************/ | |
970ed795 EL |
13 | #include <stdio.h> |
14 | #include <string.h> | |
15 | #include "../common/memory.h" | |
16 | #include "error.h" | |
17 | #include "Node.hh" | |
18 | #include "Grammar.hh" | |
19 | #include "Iterator.hh" | |
20 | #include "Graph.hh" | |
21 | ||
22 | extern int bison_parse_file(const char* filename); | |
23 | ||
24 | Grammar *grammar=0; | |
25 | ||
26 | void show_usage() | |
27 | { | |
28 | fprintf(stderr, "Usage: %s bison_filename\n", argv0); | |
29 | } | |
30 | ||
31 | int main(int argc, char *argv[]) | |
32 | { | |
33 | argv0 = argv[0]; | |
34 | ||
35 | if(argc!=2) { | |
36 | show_usage(); | |
37 | return 1; | |
38 | } | |
39 | ||
40 | char *infilename=argv[1]; | |
41 | grammar=new Grammar(); | |
42 | ||
43 | bison_parse_file(infilename); | |
44 | ||
45 | grammar->compute_all(); | |
46 | graph_use(grammar); | |
47 | ||
48 | delete grammar; | |
49 | Node::chk_counter(); | |
50 | check_mem_leak(argv0); | |
51 | } |