7 #ifndef NETCONF_PARSER_CONTEXT_H
8 #define NETCONF_PARSER_CONTEXT_H
18 #define YY_DECL isc::netconf::NetconfParser::symbol_type netconf_lex (ParserContext& driver)
67 std::vector<isc::data::ElementPtr>
stack_;
126 void error(
const isc::netconf::location& loc,
127 const std::string& what,
137 void error(
const std::string& what);
146 static void fatal(
const std::string& what);
166 void require(
const std::string& name,
178 void unique(
const std::string& name,
228 std::vector<isc::netconf::location>
locs_;
281 bool trace_scanning_;
287 std::vector<LexerContext> cstack_;
ParserContext()
Default constructor.
static void fatal(const std::string &what)
Fatal error handler.
std::vector< struct yy_buffer_state * > states_
Lexer state stack.
Used while parsing Netconf/loggers/output_options structures.
Used while parsing Netconf/managed-servers/*/control-socket/socket-type.
void includeFile(const std::string &filename)
Divert input to an include file.
LexerContext
Defines syntactic contexts for lexical tie-ins.
void scanEnd()
Method called after the last tokens are scanned.
void leave()
Leave a syntactic context.
boost::shared_ptr< Element > ElementPtr
LexerContext ctx_
Current syntactic context.
void scanStringBegin(const std::string &str, ParserType type)
Method called before scanning starts on a string.
std::vector< isc::data::ElementPtr > stack_
JSON elements being parsed.
Forward declaration of the ParserContext class.
void scanFileBegin(FILE *f, const std::string &filename, ParserType type)
Method called before scanning starts on a file.
void require(const std::string &name, isc::data::Element::Position open_loc, isc::data::Element::Position close_loc)
Check if a required parameter is present.
isc::netconf::location loc_
Location of the current token.
This parser will expect the content as Netconf config wrapped in a map (that's the regular config fil...
isc::data::ElementPtr parseString(const std::string &str, ParserType parser_type)
Run the parser on the string specified.
isc::data::ElementPtr parseFile(const std::string &filename, ParserType parser_type)
Run the parser on the file specified.
std::vector< std::string > files_
File name stack.
std::vector< isc::netconf::location > locs_
Location stack.
std::vector< FILE * > sfiles_
sFile (aka FILE) stack
Used while parsing Netconf/hooks-libraries.
This parser will parse the content as generic JSON.
isc::data::Element::Position loc2pos(isc::netconf::location &loc)
Converts bison's position to one understandable by isc::data::Element.
void error(const isc::netconf::location &loc, const std::string &what, size_t pos=0)
Error handler.
Used while parsing Netconf/loggers structures.
Used while parsing Netconf/manages-servers/*/control-socket.
Represents the position of the data element within a configuration string.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Used while parsing content of Netconf.
This one is used in pure JSON mode.
Define the isc::netconf::parser class.
void unique(const std::string &name, isc::data::Element::Position loc)
Check if a parameter is already present.
std::string file_
File name.
virtual ~ParserContext()
destructor
Parser context is a wrapper around flex/bison instances dedicated to Netconf-agent config file parser...
void enter(const LexerContext &ctx)
Enter a new syntactic context.
ParserType
Defines currently supported scopes.
This parser will expect only the content of Netconf.
Used while parsing Netconf/managed-servers.
FILE * sfile_
sFile (aka FILE)
const std::string contextName()
Get the syntactic context name.