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

[5014_phase2] Fixed lexer cleanup on any exit (note parser uses try-catch)

This commit is contained in:
Francis Dupont
2016-11-28 15:31:10 +01:00
committed by Tomek Mrugalski
parent b4264859fd
commit 58bb8f3445
4 changed files with 62 additions and 39 deletions

View File

@@ -53,14 +53,11 @@ public:
/// @brief Method called before scanning starts on a string.
void scanStringBegin(const std::string& str, ParserType type);
/// @brief Method called after the last tokens are scanned from a string.
void scanStringEnd();
/// @brief Method called before scanning starts on a file.
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 Method called after the last tokens are scanned.
void scanEnd();
/// @brief Divert input to an include file.
void includeFile(const std::string& filename);
@@ -144,9 +141,15 @@ public:
/// @brief Location stack
std::vector<isc::dhcp::location> locs_;
/// @brief State stack
/// @brief Lexer state stack
std::vector<struct yy_buffer_state*> states_;;
/// @brief sFile (aka FILE)
FILE* sfile_;
/// @brief sFile (aka FILE) stack
std::vector<FILE*> sfiles_;
/// @brief Current syntactic context
ParserContext ctx_;
@@ -169,6 +172,9 @@ public:
/// @brief Syntactic context stack
std::vector<ParserContext> cstack_;
/// @brief Common part of parseXXX
isc::data::ConstElementPtr parseCommon();
};
}; // end of isc::eval namespace