namespace dhcp {
Parser4Context::Parser4Context()
- : ctx_(NO_KEYWORD), trace_scanning_(false), trace_parsing_(false)
-{
+ : sfile_(nullptr), ctx_(NO_KEYWORD), trace_scanning_(false),
+ trace_parsing_(false) {
}
-Parser4Context::~Parser4Context()
-{
+Parser4Context::~Parser4Context() {
}
isc::data::ElementPtr
-Parser4Context::parseString(const std::string& str, ParserType parser_type)
-{
+Parser4Context::parseString(const std::string& str, ParserType parser_type) {
scanStringBegin(str, parser_type);
return (parseCommon());
}
void
Parser4Context::error(const isc::dhcp::location& loc,
const std::string& what,
- size_t pos)
-{
+ size_t pos) {
if (pos == 0) {
isc_throw(Dhcp4ParseError, loc << ": " << what);
} else {
}
void
-Parser4Context::error(const std::string& what)
-{
+Parser4Context::error(const std::string& what) {
isc_throw(Dhcp4ParseError, what);
}
void
-Parser4Context::fatal(const std::string& what)
-{
+Parser4Context::fatal(const std::string& what) {
isc_throw(Dhcp4ParseError, what);
}
isc::data::Element::Position
-Parser4Context::loc2pos(isc::dhcp::location& loc)
-{
+Parser4Context::loc2pos(isc::dhcp::location& loc) {
const std::string& file = *loc.begin.filename;
const uint32_t line = loc.begin.line;
const uint32_t pos = loc.begin.column;
void
Parser4Context::require(const std::string& name,
isc::data::Element::Position open_loc,
- isc::data::Element::Position close_loc)
-{
+ isc::data::Element::Position close_loc) {
ConstElementPtr value = stack_.back()->get(name);
if (!value) {
isc_throw(Dhcp4ParseError,
void
Parser4Context::unique(const std::string& name,
- isc::data::Element::Position loc)
-{
+ isc::data::Element::Position loc) {
ConstElementPtr value = stack_.back()->get(name);
if (value) {
if (ctx_ != NO_KEYWORD) {
}
void
-Parser4Context::enter(const ParserContext& ctx)
-{
+Parser4Context::enter(const ParserContext& ctx) {
cstack_.push_back(ctx_);
ctx_ = ctx;
}
void
-Parser4Context::leave()
-{
+Parser4Context::leave() {
#if 1
if (cstack_.empty()) {
fatal("unbalanced syntactic context");
}
const std::string
-Parser4Context::contextName()
-{
+Parser4Context::contextName() {
switch (ctx_) {
case NO_KEYWORD:
return ("__no keyword__");
namespace dhcp {
Parser6Context::Parser6Context()
- : ctx_(NO_KEYWORD), trace_scanning_(false), trace_parsing_(false)
-{
+ : sfile_(nullptr), ctx_(NO_KEYWORD), trace_scanning_(false),
+ trace_parsing_(false) {
}
-Parser6Context::~Parser6Context()
-{
+Parser6Context::~Parser6Context() {
}
isc::data::ElementPtr
-Parser6Context::parseString(const std::string& str, ParserType parser_type)
-{
+Parser6Context::parseString(const std::string& str, ParserType parser_type) {
scanStringBegin(str, parser_type);
return (parseCommon());
}
void
Parser6Context::error(const isc::dhcp::location& loc,
const std::string& what,
- size_t pos)
-{
+ size_t pos) {
if (pos == 0) {
isc_throw(Dhcp6ParseError, loc << ": " << what);
} else {
}
void
-Parser6Context::error (const std::string& what)
-{
+Parser6Context::error (const std::string& what) {
isc_throw(Dhcp6ParseError, what);
}
void
-Parser6Context::fatal (const std::string& what)
-{
+Parser6Context::fatal (const std::string& what) {
isc_throw(Dhcp6ParseError, what);
}
isc::data::Element::Position
-Parser6Context::loc2pos(isc::dhcp::location& loc)
-{
+Parser6Context::loc2pos(isc::dhcp::location& loc) {
const std::string& file = *loc.begin.filename;
const uint32_t line = loc.begin.line;
const uint32_t pos = loc.begin.column;
void
Parser6Context::require(const std::string& name,
isc::data::Element::Position open_loc,
- isc::data::Element::Position close_loc)
-{
+ isc::data::Element::Position close_loc) {
ConstElementPtr value = stack_.back()->get(name);
if (!value) {
isc_throw(Dhcp6ParseError,
void
Parser6Context::unique(const std::string& name,
- isc::data::Element::Position loc)
-{
+ isc::data::Element::Position loc) {
ConstElementPtr value = stack_.back()->get(name);
if (value) {
if (ctx_ != NO_KEYWORD) {
}
void
-Parser6Context::enter(const ParserContext& ctx)
-{
+Parser6Context::enter(const ParserContext& ctx) {
cstack_.push_back(ctx_);
ctx_ = ctx;
}
void
-Parser6Context::leave()
-{
+Parser6Context::leave() {
#if 1
if (cstack_.empty()) {
fatal("unbalanced syntactic context");
}
const std::string
-Parser6Context::contextName()
-{
+Parser6Context::contextName() {
switch (ctx_) {
case NO_KEYWORD:
return ("__no keyword__");