problem_idl_test.c

Go to the documentation of this file.
00001 /* 
00002  * @file
00003  *
00004  * A small test program that dumps the problem data structure to
00005  * stdout after scanning and parsing the IDL file.  This simply checks
00006  * if the IDL file can be parsed.
00007  *
00008  */
00009 /* $Id: problem_idl_test.c,v 1.10 2005/11/10 20:46:01 seymour Exp $ */
00010 /* $UTK_Copyright: $ */
00011 
00012 
00013 #include <stdlib.h>
00014 #include <stdio.h>
00015 
00016 #include "problem.h"
00017 #include "utility.h"
00018 #include "problem_idl_parser.h"
00019 
00020 int
00021 main(int argc, char *argv[])
00022 {
00023   FILE *fin;
00024   int status;
00025   extern gs_problem_t *problemp;
00026   extern int idl_parse();
00027   extern FILE *idl_in;
00028 
00029   if(argc != 2) {
00030     ERRPRINTF("Usage: %s <problem_idl_file> \n", argv[0]);
00031     exit(-1);
00032   }
00033 
00034   if((fin = fopen(argv[1], "r")) == NULL) {
00035     ERRPRINTF("Could not open idl file: %s \n", argv[1]);
00036     exit(-1);
00037   }
00038 
00039   idl_in = fin;
00040   status = idl_parse();
00041   gs_problemlist_dump(problemp);
00042   fclose(fin);
00043 
00044   exit(status);
00045 }