Limbo 3.5.4
Loading...
Searching...
No Matches
test_bison.cpp
Go to the documentation of this file.
1
7
8#include <iostream>
9#include <fstream>
10
12
13using std::cout;
14using std::cin;
15using std::endl;
16using std::string;
17
21{
22 public:
25 {
26 cout << "constructing EbeamDataBase" << endl;
27 }
28
30 virtual void set_ebeam_unit(int token)
31 {
32 cout << __func__ << " => " << token << endl;
33 }
34
36 {
37 cout << __func__ << endl;
38 }
39
40 virtual void add_ebeam_macro(EbeamParser::Macro const&)
41 {
42 cout << __func__ << endl;
43 }
44};
45
47void test1(string const& filename)
48{
49 cout << "////////////// test1 ////////////////" << endl;
51 EbeamParser::read(db, filename);
52}
53
55void test2(string const& filename)
56{
57 cout << "////////////// test2 ////////////////" << endl;
59 EbeamParser::Driver driver (db);
60 //driver.trace_scanning = true;
61 //driver.trace_parsing = true;
62
63 driver.parse_file(filename);
64}
65
70int 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}
Driver for Ebeam parser.
void test2(string const &filename)
test 2: use class wrapper BookshelfParser::Driver
Custom class that inheritates EbeamParser::EbeamDataBase with all the required callbacks defined.
EbeamDataBase()
constructor
virtual void set_ebeam_boundary(EbeamParser::EbeamBoundary const &)
set ebeam boundary
virtual void set_ebeam_unit(int token)
set database unit
virtual void add_ebeam_macro(EbeamParser::Macro const &)
set ebeam macro
bool parse_file(const string &filename)
Base class for ebeam database. Only pure virtual functions are defined. User needs to inheritate th...
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
describe conflict sites for each standard cell type
int main()
void test1()
test function API