Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EbeamDriver.h
Go to the documentation of this file.
1 
8 #ifndef EBEAMPARSER_DRIVER_H
9 #define EBEAMPARSER_DRIVER_H
10 
11 #include "EbeamDataBase.h"
12 
16 namespace EbeamParser {
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(EbeamDataBase& 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 
91  void units_cbk(int d1);
92  void ebeam_cbk();
93  void ebeam_cbk_offset(double d1);
94  void ebeam_cbk_width(double d1);
95  void ebeam_cbk_step(double d1);
96  void ebeam_cbk_layerid(vector<int> const& v1);
97  void ebeam_cbk_layer(vector<string> const& v1);
98  void macro_cbk(string const& s1);
99  void macro_cbk_name(string const& s1);
100  void macro_cbk_confsite_name(string const& s1);
101  void macro_cbk_confsite_layerid(int const& d1);
102  void macro_cbk_confsite_layer(string const& s1);
103  void macro_cbk_confsite_site(vector<int> const& v1);
104  void macro_cbk_confsite(string const& s1);
106 protected:
110 
115 
116 };
117 
122 bool read(EbeamDataBase& db, const string& ebeamFile);
123 
124 } // namespace example
125 
126 #endif // EXAMPLE_DRIVER_H
bool trace_parsing
enable debug output in the bison parser
Definition: EbeamDriver.h:46
Driver(EbeamDataBase &db)
class Scanner * lexer
Definition: EbeamDriver.h:88
describe conflict sites for each standard cell type
string streamname
stream name (file or input stream) used for error messages.
Definition: EbeamDriver.h:49
EbeamDataBase & m_db
Definition: EbeamDriver.h:109
void error(const class location &l, const string &m)
EbeamBoundary m_ebeam_boundary
temporary storage of ebeam boundary
Definition: EbeamDriver.h:112
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
Database for Ebeam parser.
bool trace_scanning
enable debug output in the flex scanner
Definition: EbeamDriver.h:43
bool parse_stream(std::istream &in, const string &sname="stream input")
Base class for ebeam database. Only pure virtual functions are defined. User needs to inheritate this...
bool parse_string(const string &input, const string &sname="string stream")
namespace for EbeamParser
Definition: EbeamDataBase.h:19
Macro m_macro
temporary storage of ebeam macro for a standard cell
Definition: EbeamDriver.h:114