Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test_bison.cpp
Go to the documentation of this file.
1 
8 #include <iostream>
9 #include <fstream>
10 
12 
13 using std::cout;
14 using std::cin;
15 using std::endl;
16 using std::string;
17 
21 {
22  public:
25  {
26  cout << "constructing EbeamDataBase" << endl;
27  }
30  virtual void set_ebeam_unit(int token)
31  {
32  cout << __func__ << " => " << token << endl;
33  }
36  {
37  cout << __func__ << endl;
38  }
40  virtual void add_ebeam_macro(EbeamParser::Macro const&)
41  {
42  cout << __func__ << endl;
43  }
44 };
45 
47 void test1(string const& filename)
48 {
49  cout << "////////////// test1 ////////////////" << endl;
50  EbeamDataBase db;
51  EbeamParser::read(db, filename);
52 }
53 
55 void test2(string const& filename)
56 {
57  cout << "////////////// test2 ////////////////" << endl;
58  EbeamDataBase db;
59  EbeamParser::Driver driver (db);
60  //driver.trace_scanning = true;
61  //driver.trace_parsing = true;
62 
63  driver.parse_file(filename);
64 }
65 
70 int main(int argc, char** argv)
71 {
72 
73  if (argc > 1)
74  {
75  test1(argv[1]);
76  test2(argv[1]);
77  }
78  else
79  cout << "at least 1 argument is required" << endl;
80 
81  return 0;
82 }
virtual void set_ebeam_unit(int token)
set database unit
Definition: test_bison.cpp:30
EbeamDataBase()
constructor
Definition: test_bison.cpp:24
virtual void add_ebeam_macro(EbeamParser::Macro const &)
set ebeam macro
Definition: test_bison.cpp:40
describe conflict sites for each standard cell type
Custom class that inheritates EbeamParser::EbeamDataBase with all the required callbacks defined...
Definition: test_bison.cpp:20
void test2(string const &filename)
test 2: use class wrapper BookshelfParser::Driver
Definition: test_bison.cpp:104
bool parse_file(const string &filename)
bool read(EbeamDataBase &db, const string &ebeamFile)
API for EbeamParser. Read Ebeam file and initialize database by calling user-defined callback functio...
describe ebeam boundary
void test1(string const &filename)
test 1: use function wrapper BookshelfParser::read
Definition: test_bison.cpp:96
Driver for Ebeam parser.
Base class for ebeam database. Only pure virtual functions are defined. User needs to inheritate this...
virtual void set_ebeam_boundary(EbeamParser::EbeamBoundary const &)
set ebeam boundary
Definition: test_bison.cpp:35
int main(int argc, char **argv)
main function
Definition: test_bison.cpp:119