Browse Source

[5017] Doc updated, doxygen warnings removed.

Tomek Mrugalski 8 years ago
parent
commit
3f050858c7

+ 7 - 11
doc/guide/config.xml

@@ -37,27 +37,23 @@
       <itemizedlist>
         <listitem>
           <simpara>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.</simpara>
+          character is ignored. Both Dhcp4 and Dhcp6 allow # in any column,
+          while Ddns requires hash to be in the first column.</simpara>
         </listitem>
         <listitem>
           <simpara>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.</simpara>
+          character is ignored. Both Dhcp4 and Dhcp6 supports this
+          feature.</simpara>
         </listitem>
         <listitem>
           <simpara>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.</simpara>
+          ignored. This commenting can span multiple lines. Both Dhcp4 and
+          Dhcp6 supports this feature.</simpara>
         </listitem>
         <listitem>
           <simpara>File inclusion: JSON files can include other JSON
           files. This can be done by using &lt;?include
-          "file.json"?&gt;. We're in a process of migrating the
-          configuation parsers and currently only Dhcp6 supports this
+          "file.json"?&gt;. Both Dhcp4 and Dhcp6 supports this
           feature.</simpara>
         </listitem>
       </itemizedlist>

+ 37 - 0
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.

+ 2 - 2
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.

+ 3 - 3
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 {

+ 1 - 1
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 {