Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

parse specific data in C#

I have data stored in specific text format:

FIDS_A1=CF_LAST:1|line_NETCHNG:2|QoS:3; FIDS_A2=[High and Low]:[{High} – {Low}]:1|CF_LAST:2; FIDS_A3=YR_RANGE:3|VOL:3; FIDS_A4=GR_AskBid; FIDS_C3=line_BID:3|line_ASK:3;

I need to parse it and get a C# typed data structure from it.

It's not simple to write parser in C# (very many Regexps and hard code).

I heard something about Oslo\MGrammar from Microsoft. Does this tool generate C# parser code for my specific data ?

Output i need only C# code of parser without reference to other libraries.

like image 765
Eugene Gluhotorenko Avatar asked Mar 20 '26 04:03

Eugene Gluhotorenko


1 Answers

You could have a look at the GOLD Parser Builder and the bsn GoldParser engine (which can create a typed data structure when parsing the data using a grammar built with GOLD).

There's also a CodeProject article which shows how to use this engine.

like image 191
Lucero Avatar answered Mar 21 '26 18:03

Lucero