Opened 3 years ago

Closed 3 years ago

#5015 closed task (complete)

Design parser refactoring

Reported by: tomek Owned by: tomek
Priority: high Milestone: Kea 1.2 - Mozilla Milestone 1
Component: remote-management Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 20
Total Hours: 20 Internal?: no


Once #5014 is done, we should use the lessons learned and design the new parser architecture and a transition plan. Refactoring the whole parser is definitely too large to a single ticket to cover. As such, there has to be a way to split the work into separate tickets that could be merged independently.

ConfigParseDesign provides a wealth of information regarding the issue bugging existing implementation. This design should either update this document significantly or a new document could be created.


Change History (12)

comment:1 Changed 3 years ago by tomek

  • Milestone changed from Kea-proposed to Kea1.2

comment:2 Changed 3 years ago by tomek

  • Type changed from defect to task

comment:3 Changed 3 years ago by tomek

  • Component changed from configuration to remote-management

comment:4 Changed 3 years ago by tomek

  • Owner set to tomek
  • Status changed from new to assigned

comment:5 Changed 3 years ago by tomek

  • Owner changed from tomek to Unassigned
  • Status changed from assigned to reviewing

The proof of concept code developed in #5014 is now available on trac5014_phase2 branch. The design of the proposed refactoring is documented here: SimpleParser. Please share your comments.

comment:6 Changed 3 years ago by fdupont

Two notes about the c++11 construct:

  • IMHO the copy constructor style is be readable so I added a = in the code.
  • initialisation of non-aggregate type (here a vector) is a C++11 extension. As C++11 features are not uniformly supported (or with other words not all compilers are gcc and derivates) this one should be checked for in configure by #4631 or a child.

comment:7 Changed 3 years ago by fdupont

Pushed a lot of improvements and fixes to the flex/bison part. Perhaps they should be ported back to #5014 branch?

comment:8 Changed 3 years ago by fdupont

Implemented the escape mechanism of JSON (cf its official spec at the exception of the unicode (mainly because it raises the problem of representation of \uXYZT where X or Y is not 0, but I did a few unit tests for bad unicode escapes).
BTW I agree the scanner should be a strict as possible because the right case will be the most frequent, even this requires more work to get useful messages for bad cases...

Another point: I notice there are a lot of missing stuff in the grammar of the parser and not only things added since it was forked. I don't know what is the plan about this?

comment:9 Changed 3 years ago by fdupont

There are 2 children tickets:

  • #5085 which addressed some not blocking defects of #5036: as they were not blocking they were not included in #5036 but anyway they should be merged before the release.
  • #5086 is an "after work" cleanup and improvement.

comment:10 Changed 3 years ago by stephen

  • Milestone changed from Kea1.2 to Kea 1.2 - Mozilla Milestone 1

Moved to milestone "Kea 1.2 - Mozilla Milestone 1" as a result of Kea meeting on 15 December 2016

comment:11 Changed 3 years ago by tomek

  • Owner changed from Unassigned to tomek

The design has been now reviewed by Francis and Marcin. There are some follow up actions needed, but those have their own dedicated tickets. Also, the Dhcpv6 parser is already merged, with the Dhcp4 being in review and the first parsers (option data and option definitions) have completed first round of reviews.

As such, the design phase is complete. Closing ticket.

comment:12 Changed 3 years ago by tomek

  • Add Hours to Ticket changed from 0 to 20
  • Resolution set to complete
  • Status changed from reviewing to closed
  • Total Hours changed from 0 to 20
Note: See TracTickets for help on using tickets.