FLAME  devel
 All Classes Functions Variables Typedefs Enumerations Pages
test_parse.cpp
1 
2 #include <iostream>
3 #include <stdio.h>
4 #include <string.h>
5 
6 #include "flame/config.h"
7 
8 extern int glps_debug;
9 
10 int main(int argc, char *argv[])
11 {
12 try {
13 
14  glps_debug = 1;
15 
16  std::auto_ptr<Config> conf;
17 
18  try {
19  GLPSParser P;
20  conf.reset(P.parse_file(argc>=2 ? argv[1] : NULL));
21  }catch(std::exception& e){
22  std::cerr<<"Parse error: "<<e.what()<<"\n";
23  return 1;
24  }
25 
26  std::cerr<<"Generic AST:\n";
27  std::cerr << *conf;
28  std::cerr<<"GLPS:\n";
29  GLPSPrint(std::cout, *conf);
30 
31  fprintf(stderr, "Done\n");
32  return 0;
33 }catch(std::exception& e){
34  std::cerr<<"Error: "<<e.what()<<"\n";
35  return 1;
36 }
37 }
Interface to lattice file parser.
Definition: config.h:240
Config * parse_file(const char *fname)
Open and parse a file.
Definition: config.cpp:362