From: Tomek Mrugalski Date: Thu, 15 Dec 2016 15:53:35 +0000 (+0100) Subject: [5017] Doc updated, doxygen warnings removed. X-Git-Tag: trac5088_base~1^2~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3f050858c7e0320402ff5791944c1a4a4e47cfef;p=thirdparty%2Fkea.git [5017] Doc updated, doxygen warnings removed. --- diff --git a/doc/guide/config.xml b/doc/guide/config.xml index d2f81f48d9..645ee9c9e5 100644 --- a/doc/guide/config.xml +++ b/doc/guide/config.xml @@ -37,27 +37,23 @@ shell comments: any text after the hash (#) - character is ignored. Dhcp6 allows # in any column, while - Dhcp4 and Ddns require hash to be in the first - column. + character is ignored. Both Dhcp4 and Dhcp6 allow # in any column, + while Ddns requires hash to be in the first column. C comments: any text after the double slashes (//) - character is ignored. We're in a process of - migrating the configuation parsers and currently only Dhcp6 - supports this feature. + character is ignored. Both Dhcp4 and Dhcp6 supports this + feature. Multiline comments: any text between /* and */ is - ignored. This commenting can span multiple lines. We're in a - process of migrating the configuation parsers and currently - only Dhcp6 supports this feature. + ignored. This commenting can span multiple lines. Both Dhcp4 and + Dhcp6 supports this feature. File inclusion: JSON files can include other JSON files. This can be done by using <?include - "file.json"?>. We're in a process of migrating the - configuation parsers and currently only Dhcp6 supports this + "file.json"?>. Both Dhcp4 and Dhcp6 supports this feature. diff --git a/src/bin/dhcp4/dhcp4.dox b/src/bin/dhcp4/dhcp4.dox index 24fe44c5ea..17fba6eb40 100644 --- a/src/bin/dhcp4/dhcp4.dox +++ b/src/bin/dhcp4/dhcp4.dox @@ -41,6 +41,43 @@ all configuration parsers. All DHCPv4 parsers deriving from this class directly have their entire implementation in the src/bin/dhcp4/json_config_parser.cc. +@section dhcpv4ConfigParserBison Configuration Parser for DHCPv4 (bison) + +If you are here only to learn absolute minimum about the new parser, here's how you +use it: + +@code + // The following code: + json = isc::data::Element::fromJSONFile(file_name, true); + + // can be replaced with this: + Parser4Context parser; + json = parser.parseFile(file_name, Parser4Context::PARSER_DHCP4); +@endcode + +For an introduction, rationale and issues the new parser tries to address, +see @ref dhcpv6ConfigParserBison. + +The code change for 5017 introduces flex/bison based parser. It is +essentially defined in two files: dhcp4_lexer.ll, which defines +regular expressions that are used on the input (be it a file or a +string in memory). In essence, this code is being called repeatedly +and each time it returns a token. This repeats until either the +parsing is complete or syntax error is encountered. For detailed +discussion, how they operate see @ref dhcpv6ConfigParserBison. + +@section dhcpv4ConfigSubParser Parsing Partial Configuration in DHCPv4 + +See @ref dhcpv6ConfigSubParser. + +@section dhcp4ParserIncludes Config File Includes + +See @ref dhcp6ParserIncludes. + +@section dhcp4ParserConflicts Avoiding syntactical conflicts in parsers + +See @ref dhcp6ParserConflicts. + @section dhcpv4ConfigInherit DHCPv4 configuration inheritance One notable useful feature of DHCP configuration is its parameter inheritance. diff --git a/src/bin/dhcp4/parser_context.h b/src/bin/dhcp4/parser_context.h index 14e4015613..b340bfda28 100644 --- a/src/bin/dhcp4/parser_context.h +++ b/src/bin/dhcp4/parser_context.h @@ -95,14 +95,14 @@ public: /// @brief Method called before scanning starts on a string. /// /// @param str string to be parsed - /// @param parser_type specifies expected content + /// @param type specifies expected content void scanStringBegin(const std::string& str, ParserType type); /// @brief Method called before scanning starts on a file. /// /// @param f stdio FILE pointer /// @param filename file to be parsed - /// @param parser_type specifies expected content + /// @param type specifies expected content void scanFileBegin(FILE* f, const std::string& filename, ParserType type); /// @brief Method called after the last tokens are scanned. diff --git a/src/bin/dhcp4/parser_context_decl.h b/src/bin/dhcp4/parser_context_decl.h index 367f163492..039a790f8c 100644 --- a/src/bin/dhcp4/parser_context_decl.h +++ b/src/bin/dhcp4/parser_context_decl.h @@ -4,10 +4,10 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -#ifndef PARSER6_CONTEXT_DECL_H -#define PARSER6_CONTEXT_DECL_H +#ifndef PARSER4_CONTEXT_DECL_H +#define PARSER4_CONTEXT_DECL_H -/// @file parser_context_decl.h Forward declaration of the ParserContext class +/// @file dhcp4/parser_context_decl.h Forward declaration of the ParserContext class namespace isc { namespace dhcp { diff --git a/src/bin/dhcp6/parser_context_decl.h b/src/bin/dhcp6/parser_context_decl.h index c98444fdb2..f84686364a 100644 --- a/src/bin/dhcp6/parser_context_decl.h +++ b/src/bin/dhcp6/parser_context_decl.h @@ -7,7 +7,7 @@ #ifndef PARSER6_CONTEXT_DECL_H #define PARSER6_CONTEXT_DECL_H -/// @file parser_context_decl.h Forward declaration of the ParserContext class +/// @file dhcp6/parser_context_decl.h Forward declaration of the ParserContext class namespace isc { namespace dhcp {