I have a file that I would like to parse that is made up of pipe delimited lines of text where the first value describes the type of line it is. So for example, the file may look something like this:
ABC | Name | Description | 01234ClienNo | 01-01-1900 | | true
L1 | Name | Description | formula
D1 | Name | 03-15-2010 | N
DA | D1 | Line 1 | formula
DB | D1 | Line 2 | formula
Note that DA and DB are children under D1 and some fields like Description can span multiple lines, but each line type has a set number of fields.
Anyhow, I am currently using the System.String Split method and I'm leaning toward switching to Irony so that the result would be a tree and the lines with formulas would continued to be parsed and maintain awareness of their child/parent relationship.
Originally, I felt that I could continue to use this design and simply parse the formulas, however, Irony seems to have no way to pass the parser meta data to maintain the needed awareness.
The only meta data that seems to be passed in is a filename string which defaults to <source> - referring to the Parse methods in Parser.cs.
So, what's the most efficient way to handle this scenario? Should I continue to use the Split method from System.String and only use the Parser for the formulas, or is there an easier way for Irony to parse the pipe delimited data and the formulas
together while maintaining it's parent/child relationship?