Changes between Initial Version and Version 1 of Ticket #5037, comment 14


Ignore:
Timestamp:
Jan 26, 2017, 11:42:03 AM (3 years ago)
Author:
fdupont
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5037, comment 14

    initial v1  
    77
    88=> IMHO we should first fix SimpleParser defects:
    9  - move DhcpConfigError and ConfigPair declarations in a new file in lib/cc which will be included by simpleparser.h and lib/dhcpsrv/parsers/dhcp_config_parser.h
    10 
    11  - add a requireParam tool in simpleparser which must be called before the FOREACH of parsers (the idea is one day the existence of required parameters will be done too in .yy files)
     9 - move DhcpConfigError (and perhaps ConfigPair) declarations in a new file in lib/cc which will be included by simpleparser.h and lib/dhcpsrv/parsers/dhcp_config_parser.h
    1210
    1311 - raise DhcpConfigError with location in simple parser tools: the convention should be when DhcpConfigError is raise there is a location with parenthesis. (i.e. make far easier to track if the location has to be added or not)
    1412
    1513Either:
     14   - add a requireParam tool in simpleparser which must be called before the FOREACH of parsers (the idea is one day the existence of required parameters will be done too in .yy files)
     15
    1616  - with requireParam the getXXX can get the value (vs parent) and be easier to use in FOREACH loop
    1717
     
    1919
    2020Or (as the grammar already eliminates unknown parameters):
    21  - get rid of FOREACH loops and simply handle each parameter in sequence
     21 - create a ticket to handle missing required parameters in grammar: more efficient, can put in the error message the syntactic context name with { and } positions (in addition to the location of the keyword aka parent).
    2222
    23  - update my simpleparser templates to use the parent vs value
     23 - get rid of FOREACH loops and simply handle each parameter in sequence (aka flat simpleparser style)
     24
     25 - use defaults when possible so we know parameters exist
     26
     27 - update my simpleparser templates to use the parent vs value and internally getXXX tools
     28
     29It seems you prefer the second.