 |
Kea
1.5.0
|
Go to the documentation of this file.
7 #ifndef PARSER_CONTEXT_H
8 #define PARSER_CONTEXT_H
17 #define YY_DECL isc::agent::AgentParser::symbol_type agent_lex (ParserContext& driver)
66 std::vector<isc::data::ElementPtr>
stack_;
121 void error(
const isc::agent::location& loc,
const std::string& what);
130 void error(
const std::string& what);
139 static void fatal(
const std::string& what);
197 std::vector<isc::agent::location>
locs_;
250 bool trace_scanning_;
256 std::vector<LexerContext> cstack_;
void scanStringBegin(const std::string &str, ParserType type)
Method called before scanning starts on a string.
@ NO_KEYWORDS
This one is used in pure JSON mode.
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.
void leave()
Leave a syntactic context.
void enter(const LexerContext &ctx)
Enter a new syntactic context.
std::vector< FILE * > sfiles_
sFile (aka FILE) stack
void scanFileBegin(FILE *f, const std::string &filename, ParserType type)
Method called before scanning starts on a file.
ParserContext()
Default constructor.
ParserType
Defines currently supported scopes.
std::vector< struct yy_buffer_state * > states_
Lexer state stack.
isc::data::Element::Position loc2pos(isc::agent::location &loc)
Converts bison's position to one understandable by isc::data::Element.
@ AGENT
Used while parsing content of Logging.
const std::string contextName()
Get the syntactic context name.
Defines the logger used by the top-level component of kea-dhcp-ddns.
isc::agent::location loc_
Location of the current token.
std::vector< isc::agent::location > locs_
Location stack.
void error(const isc::agent::location &loc, const std::string &what)
Error handler.
@ LOGGERS
Used while parsing Logging/loggers/output_options structures.
Represents the position of the data element within a configuration string.
static void fatal(const std::string &what)
Fatal error handler.
@ SOCKET_TYPE
Used while parsing Control-agent/hooks-libraries.
@ PARSER_SUB_AGENT
This parser will expect only the content of Control-agent.
@ PARSER_AGENT
This parser will expect the content as Control-agent config wrapped in a map (that's the regular conf...
@ SERVER
Used while parsing Control-agent/control-socket/*-server/socket-type.
FILE * sfile_
sFile (aka FILE)
std::vector< std::string > files_
File name stack.
@ CONFIG
Used while parsing content of Agent.
std::string file_
File name.
LexerContext
Defines syntactic contexts for lexical tie-ins.
void scanEnd()
Method called after the last tokens are scanned.
LexerContext ctx_
Current syntactic context.
virtual ~ParserContext()
destructor
boost::shared_ptr< Element > ElementPtr
@ HOOKS_LIBRARIES
Used while parsing Logging/loggers structures.
Parser context is a wrapper around flex/bison instances dedicated to Control-agent config file parser...
@ CONTROL_SOCKETS
Used while parsing Control-agent/control-socket/*-server.
@ PARSER_JSON
This parser will parse the content as generic JSON.
void includeFile(const std::string &filename)
Divert input to an include file.
std::vector< isc::data::ElementPtr > stack_
JSON elements being parsed.
@ LOGGING
Used while parsing Control-agent/control-sockets.