VCDFileParser.hpp
Go to the documentation of this file.
1 /*!
2 @file
3 @brief Contains the declaration of the parser driver class.
4 */
5 
6 #ifndef VCD_PARSER_DRIVER_HPP
7 #define VCD_PARSER_DRIVER_HPP
8 
9 #include <string>
10 #include <map>
11 #include <set>
12 #include <stack>
13 #include <limits>
14 
15 #include "VCDParser.hpp"
16 #include "VCDTypes.hpp"
17 #include "VCDFile.hpp"
18 
19 #define YY_DECL \
20  VCDParser::parser::symbol_type yylex (VCDFileParser & driver)
21 
22 YY_DECL;
23 
24 
25 /*!
26 @brief Class for parsing files containing CSP notation.
27 */
29 
30  public:
31 
32  //! Create a new parser/
33  VCDFileParser();
34  virtual ~VCDFileParser();
35 
36  /*!
37  @brief Parse the suppled file.
38  @returns A handle to the parsed VCDFile object or nullptr if parsing
39  fails.
40  */
41  VCDFile * parse_file(const std::string & filepath);
42 
43  //! The current file being parsed.
44  std::string filepath;
45 
46  //! Should we debug tokenising?
48 
49  //! Should we debug parsing of tokens?
51 
52  //! Ignore anything before this timepoint
54 
55  //! Ignore anything after this timepoint
57 
58  //! Reports errors to stderr.
59  void error(const VCDParser::location & l, const std::string & m);
60 
61  //! Reports errors to stderr.
62  void error(const std::string & m);
63 
64  //! Current file being parsed and constructed.
66 
67  //! Current stack of scopes being parsed.
68  std::stack<VCDScope*> scopes;
69 
70  protected:
71 
72  //! Utility function for starting parsing.
73  void scan_begin ();
74 
75  //! Utility function for stopping parsing.
76  void scan_end ();
77 };
78 
79 #endif
80 
void scan_end()
Utility function for stopping parsing.
#define YY_DECL
VCDTime end_time
Ignore anything after this timepoint.
virtual ~VCDFileParser()
Class for parsing files containing CSP notation.
A file for common types and data structures used by the VCD parser.
bool trace_scanning
Should we debug tokenising?
void error(const VCDParser::location &l, const std::string &m)
Reports errors to stderr.
VCDFile * fh
Current file being parsed and constructed.
VCDTime start_time
Ignore anything before this timepoint.
bool trace_parsing
Should we debug parsing of tokens?
std::stack< VCDScope * > scopes
Current stack of scopes being parsed.
Top level object to represent a single VCD file.
Definition: VCDFile.hpp:16
double VCDTime
Represents a single instant in time in a trace.
Definition: VCDTypes.hpp:26
VCDFileParser()
Create a new parser/.
VCDFile * parse_file(const std::string &filepath)
Parse the suppled file.
void scan_begin()
Utility function for starting parsing.
std::string filepath
The current file being parsed.