2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-05 00:15:17 +00:00

[5014] Added scanner include

This commit is contained in:
Francis Dupont
2016-11-18 10:39:02 +01:00
committed by Tomek Mrugalski
parent 77bee10170
commit b27c84297a
5 changed files with 242 additions and 36 deletions

View File

@@ -57,11 +57,14 @@ public:
void scanStringEnd();
/// @brief Method called before scanning starts on a file.
void scanFileBegin(FILE * f, ParserType type);
void scanFileBegin(FILE * f, const std::string& filename, ParserType type);
/// @brief Method called after the last tokens are scanned from a file.
void scanFileEnd(FILE * f);
/// @brief Divert input to an include file.
static void includeFile(const std::string& filename);
/// @brief Run the parser on the string specified.
///
/// @param str string to be parsed
@@ -74,10 +77,6 @@ public:
isc::data::ConstElementPtr parseFile(const std::string& filename,
ParserType parser_type);
/// @brief The name of the file being parsed.
/// Used later to pass the file name to the location tracker.
std::string file_;
/// @brief Error handler
///
/// @param loc location within the parsed file when experienced a problem.
@@ -96,18 +95,6 @@ public:
static void fatal(const std::string& what);
private:
/// @brief Divert input to an include file.
void includeFile(const std::string& filename);
/// @brief File name stack.
std::vector<std::string> files_;
/// @brief Location stack.
std::vector<isc::dhcp::location> locs_;
/// @brief State stack.
std::vector<struct yy_buffer_state*> states_;
/// @brief Flag determining scanner debugging.
bool trace_scanning_;