Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2589 closed task (fixed)

Remove CParser

Reported by: Josh Owned by: leper
Priority: Should Have Milestone: Alpha 18
Component: Core engine Keywords:
Cc: Patch:

Description

CParser is slow and of poor quality. It should be phased out in favor of individual dedicated parsers.

Ticket #2005 previously tried to replace CParser, but it resulted in something nearly as bad.

Attachments (1)

no-cparser-GUI.diff (15.3 KB ) - added by Josh 10 years ago.
A start at replacing cparser in the GUI code.

Download all attachments as: .zip

Change History (11)

by Josh, 10 years ago

Attachment: no-cparser-GUI.diff added

A start at replacing cparser in the GUI code.

comment:1 by Josh, 10 years ago

no-cparser-GUI.diff was committed in r15213:

"Start phasing out the use of CParser in the GUI. Makes GUI parsing generally faster and stricter while adding better tests and debug information."

Only remaining use of CParser in /source/gui is the text parser.

comment:2 by leper, 10 years ago

In 15278:

Replace usage of CParser for CColor.
Switches format to use integers only.
Adds logging if the string is invalid.
Refs #2589.

comment:3 by JoshuaJB, 10 years ago

In 15279:

Fix GCC build of r15278. Refs #2589

comment:4 by leper, 10 years ago

Milestone: Alpha 17Alpha 18

comment:5 by leper, 9 years ago

Owner: changed from Josh to leper
Status: newassigned

I have local changes for TerrainProperties.cpp and a rewrite of the parsing logic in GuiText.cpp which remove the use of CParser in there. The last remaining use of it is in ConfigDB which I'll tackle next.

comment:6 by leper, 9 years ago

In 15967:

Parse terrain properties without CParser. Refs #2589.

comment:7 by leper, 9 years ago

In 15969:

Change GUI tag parsing to use a FSM instead of using CParser. Refs #2589.

Parameters now have to be quoted with ".
Supports " in parameters by escaping them with \.
Tag start characters can be included in normal text by escaping them with \.
Better error handling and a error messages to help with fixing invalid/malformed strings.

comment:8 by leper, 9 years ago

In 15980:

Use an FSM to parse our config files instead of using CParser. Refs #2589.

Properly write config settings with multiple values back to files. Refs #1810.
Print error messages if we encountered an invalid setting.

comment:9 by leper, 9 years ago

Resolution: fixed
Status: assignedclosed

In 15981:

Remove CParser. Fixes #2589.

comment:10 by Josh, 9 years ago

Thank you leper!

Note: See TracTickets for help on using tickets.