Limbo 3.5.4
Loading...
Searching...
No Matches
GdfDriver.h
Go to the documentation of this file.
1
7
8#ifndef GDFPARSER_DRIVER_H
9#define GDFPARSER_DRIVER_H
10
11#include "GdfDataBase.h"
12
16namespace GdfParser {
17
18 using std::cout;
19 using std::endl;
20 using std::cerr;
21 using std::string;
22 using std::vector;
23 using std::pair;
24 using std::make_pair;
25 using std::ostringstream;
26
35class Driver
36{
37public:
41
44
47
49 string streamname;
50
56 bool parse_stream(std::istream& in,
57 const string& sname = "stream input");
58
64 bool parse_string(const string& input,
65 const string& sname = "string stream");
66
72 bool parse_file(const string& filename);
73
74 // To demonstrate pure handling of parse errors, instead of
75 // simply dumping them on the standard error output, we will pass
76 // them to the driver using the following two member functions.
77
80 void error(const class location& l, const string& m);
81
84 void error(const string& m);
85
88 class Scanner* lexer;
89
93
95 void cellPortCbk(std::string& name, CellPort::PortTypeEnum type, std::string& layer, double x, double y);
96 void cellInstanceCbk(std::string& name, std::string& cellType, double x, double y, int32_t orient);
97 void textCbk(Text::TextTypeEnum textType, std::string const& name, std::string& content);
98 void pathObjCbk(PathObj::PathObjTypeEnum pathObjType, std::string const& name, std::string& layer, double width, double xl, double yl, double xh, double yh);
99 void pathCbk(std::string& name);
100 void netPortCbk(std::string& name, std::string& instName);
101 void netPortCbk(std::string& name);
102 void netCbk(std::string& name);
104
107 void cellCbk(std::string& name);
108
109protected:
112};
113
118bool read(GdfDataBase& db, const string& filename);
119
120} // namespace example
121
122#endif // EXAMPLE_DRIVER_H
Database for Gdf parser.
Driver(GdfDataBase &db)
void error(const string &m)
bool parse_string(const string &input, const string &sname="string stream")
bool trace_parsing
enable debug output in the bison parser
Definition GdfDriver.h:46
Cell m_cell
temporary storage of cell
Definition GdfDriver.h:111
string streamname
stream name (file or input stream) used for error messages.
Definition GdfDriver.h:49
bool parse_file(const string &filename)
void error(const class location &l, const string &m)
bool parse_stream(std::istream &in, const string &sname="stream input")
bool trace_scanning
enable debug output in the flex scanner
Definition GdfDriver.h:43
GdfDataBase & m_db
Definition GdfDriver.h:92
void cellCbk(std::string &name)
class Scanner * lexer
Definition GdfDriver.h:88
Base class for def database. Only pure virtual functions are defined. User needs to inheritate this...
namespace for GdfParser
Definition GdfDataBase.h:24
bool read(GdfDataBase &db, const string &filename)
API for GdfParser. Read GDF file and initialize database by calling user-defined callback functions.
the whole routing layout is describe by a cell
PortTypeEnum
type of port
PathObjTypeEnum
type of path object
TextTypeEnum
type of text