author | Markus Bröker <mbroeker@largo.dyndns.tv> |
Thu, 16 Apr 2009 12:49:13 +0200 | |
changeset 61 | 4b4c97f179da |
parent 48 | b94d657a9acb |
child 77 | 49e0babccb23 |
permissions | -rw-r--r-- |
37 | 1 |
/** |
2 |
* test/demos/parser/c_compiler/main.c |
|
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 |
} |