Limbo 3.5.4
Loading...
Searching...
No Matches
EbeamParser::Driver Class Reference

#include <EbeamDriver.h>

Public Member Functions

 Driver (EbeamDataBase &db)
bool parse_stream (std::istream &in, const string &sname="stream input")
bool parse_string (const string &input, const string &sname="string stream")
bool parse_file (const string &filename)
void error (const class location &l, const string &m)
void error (const string &m)

Public Attributes

bool trace_scanning
 enable debug output in the flex scanner
bool trace_parsing
 enable debug output in the bison parser
string streamname
 stream name (file or input stream) used for error messages.
class Scanner * lexer

Protected Attributes

EbeamDataBasem_db
EbeamBoundary m_ebeam_boundary
 temporary storage of ebeam boundary
Macro m_macro
 temporary storage of ebeam macro for a standard cell

Detailed Description

The Driver class brings together all components. It creates an instance of the Parser and Scanner classes and connects them. Then the input stream is fed into the scanner object and the parser gets it's token sequence. Furthermore the driver object is available in the grammar rules as a parameter. Therefore the driver class contains a reference to the structure into which the parsed data is saved.

Definition at line 35 of file EbeamDriver.h.

Constructor & Destructor Documentation

◆ Driver()

EbeamParser::Driver::Driver ( EbeamDataBase & db)

construct a new parser driver context

Parameters
dbreference to database

Member Function Documentation

◆ error() [1/2]

void EbeamParser::Driver::error ( const class location & l,
const string & m )

Error handling with associated line number. This can be modified to output the error e.g. to a dialog box.

◆ error() [2/2]

void EbeamParser::Driver::error ( const string & m)

General error handling. This can be modified to output the error e.g. to a dialog box.

◆ parse_file()

bool EbeamParser::Driver::parse_file ( const string & filename)

Invoke the scanner and parser on a file. Use parse_stream with a std::ifstream if detection of file reading errors is required.

Parameters
filenameinput file name
Returns
true if successfully parsed

◆ parse_stream()

bool EbeamParser::Driver::parse_stream ( std::istream & in,
const string & sname = "stream input" )

Invoke the scanner and parser for a stream.

Parameters
ininput stream
snamestream name for error messages
Returns
true if successfully parsed

◆ parse_string()

bool EbeamParser::Driver::parse_string ( const string & input,
const string & sname = "string stream" )

Invoke the scanner and parser on an input string.

Parameters
inputinput string
snamestream name for error messages
Returns
true if successfully parsed

Member Data Documentation

◆ lexer

class Scanner* EbeamParser::Driver::lexer

Pointer to the current lexer instance, this is used to connect the parser to the scanner. It is used in the yylex macro.

Definition at line 88 of file EbeamDriver.h.

◆ m_db

EbeamDataBase& EbeamParser::Driver::m_db
protected

Reference to the database filled during parsing of the expressions.

Definition at line 109 of file EbeamDriver.h.

◆ m_ebeam_boundary

EbeamBoundary EbeamParser::Driver::m_ebeam_boundary
protected

temporary storage of ebeam boundary

Definition at line 112 of file EbeamDriver.h.

◆ m_macro

Macro EbeamParser::Driver::m_macro
protected

temporary storage of ebeam macro for a standard cell

Definition at line 114 of file EbeamDriver.h.

◆ streamname

string EbeamParser::Driver::streamname

stream name (file or input stream) used for error messages.

Definition at line 49 of file EbeamDriver.h.

◆ trace_parsing

bool EbeamParser::Driver::trace_parsing

enable debug output in the bison parser

Definition at line 46 of file EbeamDriver.h.

◆ trace_scanning

bool EbeamParser::Driver::trace_scanning

enable debug output in the flex scanner

Definition at line 43 of file EbeamDriver.h.


The documentation for this class was generated from the following file: