diff options
author | Francis Dupont <fdupont@isc.org> | 2015-11-11 17:13:54 +0100 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2015-11-11 17:13:54 +0100 |
commit | b233a6898475e7b0d7c29b783880aa86cc043f7c (patch) | |
tree | 1837e85fc89a64dfdcefa9ca14473e6206f70ec9 /src/lib/eval | |
parent | [4088fd] Moved option code range check to the parser, freeing INTEGER tokens (diff) | |
download | kea-b233a6898475e7b0d7c29b783880aa86cc043f7c.tar.xz kea-b233a6898475e7b0d7c29b783880aa86cc043f7c.zip |
[4088fd] Removed unused File functions
Diffstat (limited to 'src/lib/eval')
-rw-r--r-- | src/lib/eval/eval.dox | 5 | ||||
-rw-r--r-- | src/lib/eval/eval_context.cc | 12 | ||||
-rw-r--r-- | src/lib/eval/eval_context.h | 12 | ||||
-rw-r--r-- | src/lib/eval/lexer.cc | 20 | ||||
-rw-r--r-- | src/lib/eval/lexer.ll | 20 |
5 files changed, 2 insertions, 67 deletions
diff --git a/src/lib/eval/eval.dox b/src/lib/eval/eval.dox index 95a0c53f2e..b116f337e7 100644 --- a/src/lib/eval/eval.dox +++ b/src/lib/eval/eval.dox @@ -22,9 +22,8 @@ classification, but in the future may be also used for other applications. The external interface to the library is the @ref isc::eval::EvalContext - class. Once instantiated, it offers two major methods: - @ref isc::eval::EvalContext::parseFile which parses the content of a file - and @ref isc::eval::EvalContext::parseString, which parses the specified + class. Once instantiated, it offers a major method: + @ref isc::eval::EvalContext::parseString, which parses the specified string. Once the expression is parsed, it is converted to a collection of tokens that are stored in Reverse Polish Notation in EvalContext::expression. diff --git a/src/lib/eval/eval_context.cc b/src/lib/eval/eval_context.cc index 9c6a9ddd72..7dc46fc4cc 100644 --- a/src/lib/eval/eval_context.cc +++ b/src/lib/eval/eval_context.cc @@ -27,18 +27,6 @@ EvalContext::~EvalContext() } bool -EvalContext::parseFile(const std::string &filename) -{ - file_ = filename; - scanFileBegin(); - isc::eval::EvalParser parser(*this); - parser.set_debug_level(trace_parsing_); - int res = parser.parse(); - scanFileEnd(); - return (res == 0); -} - -bool EvalContext::parseString(const std::string& str) { file_ = "<string>"; diff --git a/src/lib/eval/eval_context.h b/src/lib/eval/eval_context.h index 3cb31eddcf..6b28e2b161 100644 --- a/src/lib/eval/eval_context.h +++ b/src/lib/eval/eval_context.h @@ -50,24 +50,12 @@ public: /// @brief Parsed expression (output tokens are stored here) isc::dhcp::Expression expression; - /// @brief Method called before scanning starts on a file. - void scanFileBegin(); - - /// @brief Method called after the last tokens are scanned from a file. - void scanFileEnd(); - /// @brief Method called before scanning starts on a string. void scanStringBegin(); /// @brief Method called after the last tokens are scanned from a string. void scanStringEnd(); - /// @brief Runs the parser on specified file. - /// - /// @param filename - /// @return true on success. - bool parseFile(const std::string& filename); - /// @brief Run the parser on the string specified. /// /// @param str string to be written diff --git a/src/lib/eval/lexer.cc b/src/lib/eval/lexer.cc index 696de045ec..3dbd4d19dd 100644 --- a/src/lib/eval/lexer.cc +++ b/src/lib/eval/lexer.cc @@ -2263,26 +2263,6 @@ void yyfree (void * ptr ) using namespace isc::eval; void -EvalContext::scanFileBegin() -{ - loc.initialize(&file_); - yy_flex_debug = trace_scanning_; - if (file_.empty () || file_ == "-") { - yyin = stdin; - } - else if (!(yyin = fopen(file_.c_str (), "r"))) { - error("cannot open " + file_ + ": " + strerror(errno)); - exit(EXIT_FAILURE); - } -} - -void -EvalContext::scanFileEnd() -{ - fclose(yyin); -} - -void EvalContext::scanStringBegin() { loc.initialize(&file_); diff --git a/src/lib/eval/lexer.ll b/src/lib/eval/lexer.ll index 61d851b474..9044c2f2e8 100644 --- a/src/lib/eval/lexer.ll +++ b/src/lib/eval/lexer.ll @@ -151,26 +151,6 @@ blank [ \t] using namespace isc::eval; void -EvalContext::scanFileBegin() -{ - loc.initialize(&file_); - yy_flex_debug = trace_scanning_; - if (file_.empty () || file_ == "-") { - yyin = stdin; - } - else if (!(yyin = fopen(file_.c_str (), "r"))) { - error("cannot open " + file_ + ": " + strerror(errno)); - exit(EXIT_FAILURE); - } -} - -void -EvalContext::scanFileEnd() -{ - fclose(yyin); -} - -void EvalContext::scanStringBegin() { loc.initialize(&file_); |