 |
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::dhcp::Dhcp6Parser::symbol_type parser6_lex (Parser6Context& driver)
109 std::vector<isc::data::ElementPtr>
stack_;
163 void error(
const isc::dhcp::location& loc,
const std::string& what);
172 void error(
const std::string& what);
181 static void fatal(
const std::string& what);
201 void require(
const std::string& name,
331 std::vector<isc::dhcp::location>
locs_;
375 bool trace_scanning_;
381 std::vector<ParserContext> cstack_;
@ RESERVATIONS
Used while parsing Dhcp6/reservations structures.
Parser6Context()
Default constructor.
@ OPTION_DATA
Used while parsing Dhcp6/option-data, Dhcp6/subnet6/option-data or anywhere option-data is present (c...
@ SHARED_NETWORK
Used while parsing shared-networks structures.
@ PARSER_JSON
This parser will parse the content as generic JSON.
@ CONFIG_DATABASE
Used while parsing config-control/config-databases.
@ CONTROL_SOCKET
Used while parsing Dhcp6/control-socket structures.
@ PD_POOLS
Used while parsing Dhcp6/subnet6/pd-pools structures.
const std::string contextName()
Get the syntactic context name.
@ PARSER_INTERFACES
This will parse the input as interfaces content.
@ PARSER_DHCP_DDNS
This will parse the input as dhcp-ddns. (D2 client config)
@ PARSER_DHCP6
This parser will parse the content as Dhcp6 config wrapped in a map (that's the regular config file)
@ DATABASE_TYPE
Used while parsing Dhcp6/*-database/type.
@ RELAY
Used while parsing Dhcp6/subnet6/relay structures.
void scanFileBegin(FILE *f, const std::string &filename, ParserType type)
Method called before scanning starts on a file.
Evaluation context, an interface to the expression evaluation.
ParserContext
Defines syntactic contexts for lexical tie-ins.
@ PARSER_CONFIG_CONTROL
This will parse the input as config-control.
void scanStringBegin(const std::string &str, ParserType type)
Method called before scanning starts on a string.
@ NCR_PROTOCOL
Used while parsing Dhcp6/dhcp-ddns/ncr-protocol.
@ OUTPUT_OPTIONS
Used while parsing Logging/loggers/output_options structures.
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.
@ PARSER_OPTION_DATA
This will parse the input as option data.
Dhcp6ParseError(const char *file, size_t line, const char *what)
ParserType
Defines currently supported scopes.
virtual ~Parser6Context()
destructor
@ PARSER_HOOKS_LIBRARY
This will parse the input as hooks-library.
std::vector< std::string > files_
File name stack.
This is a base class for exceptions thrown from the DNS library module.
@ HOST_RESERVATION_IDENTIFIERS
Used while parsing Dhcp6/host-reservation-identifiers.
Defines the logger used by the top-level component of kea-dhcp-ddns.
std::vector< isc::dhcp::location > locs_
Location stack.
@ PARSER_OPTION_DEF
This will parse the input as option definition.
@ REPLACE_CLIENT_NAME
Used while parsing Dhcp6/dhcp-ddns/replace-client-name.
@ CONFIG_CONTROL
Used while parsing Dhcp4/config-control.
void error(const isc::dhcp::location &loc, const std::string &what)
Error handler.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
std::vector< isc::data::ElementPtr > stack_
JSON elements being parsed.
isc::data::ElementPtr parseFile(const std::string &filename, ParserType parser_type)
Run the parser on the file specified.
@ DUID_TYPE
Used while parsing Dhcp6/server-id/type structures.
std::vector< FILE * > sfiles_
sFile (aka FILE) stack
std::vector< struct yy_buffer_state * > states_
Lexer state stack.
@ RESERVATION_MODE
Used while parsing Dhcp6/reservation-mode.
Represents the position of the data element within a configuration string.
@ SERVER_ID
Used while parsing Dhcp6/server-id structures.
void enter(const ParserContext &ctx)
Enter a new syntactic context.
@ PARSER_POOL6
This will parse the input as pool6 content.
@ DHCP_DDNS
Used while parsing Dhcp6/dhcp-ddns.
isc::data::ElementPtr parseString(const std::string &str, ParserType parser_type)
Run the parser on the string specified.
@ HOSTS_DATABASE
Used while parsing Dhcp6/hosts-database[s] structures.
void leave()
Leave a syntactic context.
isc::dhcp::location loc_
Location of the current token.
ParserContext ctx_
Current syntactic context.
@ SUBPARSER_DHCP6
This parser will parse the content of Dhcp6 (without outer { } and without "Dhcp6").
FILE * sfile_
sFile (aka FILE)
@ OPTION_DEF
Used while parsing Dhcp6/option-def structures.
void scanEnd()
Method called after the last tokens are scanned.
@ NCR_FORMAT
Used while parsing Dhcp6/dhcp-ddns/ncr-format.
@ MAC_SOURCES
Used while parsing Dhcp6/mac-sources structures.
@ DHCP_QUEUE_CONTROL
Used while parsing Dhcp4/dhcp-queue-control structures.
@ LOGGERS
Used while parsing Logging/loggers structures.
isc::data::Element::Position loc2pos(isc::dhcp::location &loc)
Converts bison's position to one understandable by isc::data::Element.
@ HOOKS_LIBRARIES
Used while parsing Dhcp6/hooks-libraries.
@ CLIENT_CLASSES
Used while parsing Dhcp6/client-classes structures.
void includeFile(const std::string &filename)
Divert input to an include file.
@ SUBNET6
Used while parsing Dhcp6/Subnet6 structures.
std::string file_
File name.
static void fatal(const std::string &what)
Fatal error handler.
@ LOGGING
Used while parsing content of Logging.
@ PARSER_SUBNET6
This will parse the input as Subnet6 content.
@ CONFIG
Used while parsing content of Dhcp6.
boost::shared_ptr< Element > ElementPtr
@ INTERFACES_CONFIG
Used while parsing Dhcp6/interfaces structures.
Evaluation error exception raised when trying to parse.
@ NO_KEYWORD
This one is used in pure JSON mode.
@ LEASE_DATABASE
Used while parsing Dhcp6/lease-database structures.
@ EXPIRED_LEASES_PROCESSING
Used while parsing Dhcp6/expired-leases-processing.
@ PARSER_LOGGING
This will parse the content of Logging.
@ SANITY_CHECKS
Sanity checks.
@ POOLS
Used while parsing Dhcp6/subnet6/pools structures.
@ PARSER_OPTION_DEFS
This will parse the input option definitions (for tests).
@ PARSER_HOST_RESERVATION
This will parse the input as host-reservation.
@ PARSER_PD_POOL
This will parse the input as pd-pool content.