Limbo
3.5.4
Toggle main menu visibility
Loading...
Searching...
No Matches
test
parsers
gdf
test_bison.cpp
Go to the documentation of this file.
1
7
8
#include <iostream>
9
#include <fstream>
10
11
#include <
limbo/parsers/gdf/bison/GdfDriver.h
>
12
13
using
std::cout;
14
using
std::cin;
15
using
std::endl;
16
using
std::string;
17
20
class
GdfDataBase
:
public
GdfParser::GdfDataBase
21
{
22
public
:
24
GdfDataBase
()
25
{
26
cout <<
"GdfDataBase::"
<< __func__ << endl;
27
}
28
31
virtual
void
add_gdf_cell
(
GdfParser::Cell
& cell)
32
{
33
cout << cell << endl;
34
}
35
};
36
38
void
test1
(
string
const
& filename)
39
{
40
cout <<
"////////////// test1 ////////////////"
<< endl;
41
GdfDataBase
db;
42
GdfParser::read
(db, filename);
43
}
44
46
void
test2
(
string
const
& filename)
47
{
48
cout <<
"////////////// test2 ////////////////"
<< endl;
49
GdfDataBase
db;
50
GdfParser::Driver
driver (db);
51
//driver.trace_scanning = true;
52
//driver.trace_parsing = true;
53
54
driver.
parse_file
(filename);
55
}
56
61
int
main
(
int
argc,
char
** argv)
62
{
63
64
if
(argc > 1)
65
{
66
test1
(argv[1]);
67
//test2(argv[1]);
68
}
69
else
70
cout <<
"at least 1 argument is required"
<< endl;
71
72
return
0;
73
}
GdfDriver.h
Driver for Gdf parser.
test2
void test2(string const &filename)
test 2: use class wrapper BookshelfParser::Driver
Definition
test_bison.cpp:149
GdfDataBase
Custom class that inheritates GdfParser::GdfDataBase with all the required callbacks gdfined.
Definition
test_bison.cpp:21
GdfDataBase::add_gdf_cell
virtual void add_gdf_cell(GdfParser::Cell &cell)
add routing cell
Definition
test_bison.cpp:31
GdfDataBase::GdfDataBase
GdfDataBase()
constructor
Definition
test_bison.cpp:24
GdfParser::Driver
Definition
GdfDriver.h:36
GdfParser::Driver::parse_file
bool parse_file(const string &filename)
GdfParser::GdfDataBase
Base class for def database. Only pure virtual functions are defined. User needs to inheritate this...
Definition
GdfDataBase.h:457
GdfParser::read
bool read(GdfDataBase &db, const string &filename)
API for GdfParser. Read GDF file and initialize database by calling user-defined callback functions.
GdfParser::Cell
the whole routing layout is describe by a cell
Definition
GdfDataBase.h:408
main
int main()
Definition
test_ChromaticNumber.cpp:78
test1
void test1()
test function API
Definition
test_solvers.cpp:11
Generated on
for Limbo by
1.17.0