Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
b233a689
Commit
b233a689
authored
Nov 11, 2015
by
Francis Dupont
Browse files
[4088fd] Removed unused File functions
parent
6ae4da98
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/lib/eval/eval.dox
View file @
b233a689
...
...
@@ -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.
...
...
src/lib/eval/eval_context.cc
View file @
b233a689
...
...
@@ -26,18 +26,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
)
{
...
...
src/lib/eval/eval_context.h
View file @
b233a689
...
...
@@ -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
...
...
src/lib/eval/lexer.cc
View file @
b233a689
...
...
@@ -2262,26 +2262,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
()
{
...
...
src/lib/eval/lexer.ll
View file @
b233a689
...
...
@@ -150,26 +150,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
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment