author | Markus Bröker <mbroeker@largo.dyndns.tv> |
Wed, 02 Jun 2010 00:22:32 +0200 | |
changeset 131 | b5ad49852adc |
parent 77 | 49e0babccb23 |
permissions | -rw-r--r-- |
37 | 1 |
/** |
77 | 2 |
* parser/c_compiler/main.c |
37 | 3 |
* Copyright (C) 2008 Markus Broeker |
4 |
*/ |
|
5 |
||
6 |
#include <stdio.h> |
|
7 |
#include <stdlib.h> |
|
8 |
#include <string.h> |
|
9 |
||
10 |
#include <prototypes.h> |
|
11 |
||
12 |
extern FILE *yyin; |
|
13 |
||
14 |
void usage (char *cmd) |
|
15 |
{ |
|
16 |
printf ("Usage: %s <options> <source files>\n", cmd); |
|
17 |
} |
|
18 |
||
19 |
int main (int argc, char **argv) |
|
20 |
{ |
|
21 |
FILE *fp; |
|
22 |
||
23 |
if (argc < 2) { |
|
24 |
usage (argv[0]); |
|
48
b94d657a9acb
Policy Inonsistency on many files
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
37
diff
changeset
|
25 |
return EXIT_FAILURE; |
37 | 26 |
} |
27 |
||
28 |
if ((fp = fopen (argv[1], "r")) == NULL) { |
|
29 |
perror ("FOPEN"); |
|
30 |
return EXIT_FAILURE; |
|
31 |
} |
|
32 |
||
33 |
yyin = fp; |
|
34 |
yyparse (); |
|
35 |
||
36 |
fclose (fp); |
|
37 |
||
38 |
return EXIT_SUCCESS; |
|
39 |
} |