Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GdfDriver.h
Go to the documentation of this file.
1 
8 #ifndef GDFPARSER_DRIVER_H
9 #define GDFPARSER_DRIVER_H
10 
11 #include "GdfDataBase.h"
12 
16 namespace 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 
35 class Driver
36 {
37 public:
40  Driver(GdfDataBase& db);
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 
109 protected:
112 };
113 
118 bool read(GdfDataBase& db, const string& filename);
119 
120 } // namespace example
121 
122 #endif // EXAMPLE_DRIVER_H
void error(const class location &l, const string &m)
bool parse_string(const string &input, const string &sname="string stream")
Cell m_cell
temporary storage of cell
Definition: GdfDriver.h:111
void cellCbk(std::string &name)
Base class for def database. Only pure virtual functions are defined. User needs to inheritate this c...
Definition: GdfDataBase.h:456
namespace for GdfParser
Definition: GdfDataBase.h:24
bool parse_file(const string &filename)
the whole routing layout is describe by a cell
Definition: GdfDataBase.h:407
PathObjTypeEnum
type of path object
Definition: GdfDataBase.h:252
string streamname
stream name (file or input stream) used for error messages.
Definition: GdfDriver.h:49
Driver(GdfDataBase &db)
bool parse_stream(std::istream &in, const string &sname="stream input")
class Scanner * lexer
Definition: GdfDriver.h:88
PortTypeEnum
type of port
Definition: GdfDataBase.h:157
bool trace_scanning
enable debug output in the flex scanner
Definition: GdfDriver.h:43
bool read(GdfDataBase &db, const string &filename)
API for GdfParser. Read GDF file and initialize database by calling user-defined callback functions...
Database for Gdf parser.
TextTypeEnum
type of text
Definition: GdfDataBase.h:321
bool trace_parsing
enable debug output in the bison parser
Definition: GdfDriver.h:46
GdfDataBase & m_db
Definition: GdfDriver.h:92