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