• Thomas Markwalder's avatar
    [5110] D2 now uses JSON parsing and SimpleParsers to handle D2 global scalars · 94938484
    Thomas Markwalder authored
    new files:
        src/bin/d2/tests/
            d2_simple_parser_unittest.cc
            parser_unittest.cc
            parser_unittest.h
    
    src/bin/d2/d2_cfg_mgr.h
    src/bin/d2/d2_cfg_mgr.cc
        D2CfgMgr::parseElement() - overrides base class implementation,
        flag global parameters as parsed without pushing them to D2CfgContext
        value stores
    
        D2CfgMgr::setCfgDefaults() - overrides base class implementation,
        sets defaults for D2
    
        D2CfgMgr::buildParams() - revamped to pull parameters from the given
        element map instead of context value stores.  Removed checks that
        are now done by JSON parser.
    
    src/bin/d2/d2_controller.cc
        D2Controller::parseFile() - instead of generic JSON parsing, parse
        file with PARSER_DHCPDDNS context
    
    src/bin/d2/d2_lexer.ll
    src/bin/d2/d2_parser.yy
        Changed namespace from dhcp to d2
        Added PARSER_SUB_DHCPDDNS and D2 global parameter parsing
        Added objects for forward-ddns, reverse-ddns, tsig-keys
    
    src/bin/d2/parser_context.cc
    src/bin/d2/parser_context.h
        Added PARSER_DHCPDDNS, PARSER_SUB_DHCPDDNS
    
    src/bin/d2/tests/Makefile.am
        Added new test source files
    
    src/bin/d2/tests/d2_cfg_mgr_unittests.cc
    src/bin/d2/tests/testdata/d2_cfg_tests.json
        TEST_F(D2CfgMgrTest, configPermutations) - revamped to test JSON parsing
        as well as element parsing
    
    src/bin/d2/tests/parser_unittest.h
    src/bin/d2/tests/parser_unittest.cc
        New file that tests basic JSON parsing
    
    src/lib/cc/data.h
        Added parens around TypeError position error text
    
    src/lib/cc/simple_parser.cc
        SimpleParser::setDefaults() - added logic to detect bad lexical casts
        when handling integers
    94938484
data.h 29.6 KB