Hi All,

I need to parse the text file below and process the data using Qt. However, I do not have such an experience and do not know what is best way to handle this job in Qt.

Here is an example of my text file:

Frame(BoardList(Board(ID("Board1"),
TestPointList((NO(1),
X(1m),
Y(1m),
Z(0)),
(No(2),
X(2m),
Y(2m),
Z(0)),
(No(3),
X(2.5m),
Y(2.5m),
Z(0))),
NetList((ID("Net1"),
PinList((ID("Pin1")),
(ID("Pin2")))),
(ID("Net2"),
PinList((ID("Pin3")),
(ID("Pin4")),
(ID("Pin5")))),
(ID("Net3")))),
(Board(ID("Board2"),
...
)))

This text file is used to describe the data of PCB boards. Basically, each file contains a frame, which contains a list of board. Each board contains a list of test points and a list of Nets. Each Net contains a list of Pins.

In the example above, there are two boards. The first board "board1" contains three test points ( (1,1m,1m,0),(2,2m,2m,0) and (3, 2.5m, 2.5m, 0) ) and three nets. The first net "Net1" contains two pins ("Pin1" and "Pin2"). The second net "Net2" contains three pins ("Pin3", "Pin2", "Pin3"). The third net "Net3" contains no pin.
The content of the second board is omitted here.

My job is to
1) Parse a given text file and get the data (e.g. boards, test points and nets) out of it.
2) Process the data in the memory. For example, add/remove/modify a net or a test point.
3) Save the updated data back into the text file.

Any guide will be appreciated. Thanks.


Rice