How can i parse the following Content?
data (DIR1:input bit;
DGG2:input bit;
OENEG1:input bit;
OE_NEG2:input bit;
A1:inputoutput bit_vector(1 to 9);
A2,H5,J7:inputoutput bit_vector(1 to 9);
B1,E4,Y7:inputoutput bit_vector(1 to 9);
B2:inputoutput bit_vector(1 to 9);
TGY:output bit;
THHH, Tff, TsD:input bit);
I want the output in dictionary which is shown below
Dictionary<string,string> l_dictData = new Dictionary<string,string>();
After parsing the l_dictData
should be filled with the result :
l_dictData["inputbit"] = "DIR1,DGG2,OENEG1,OE_NEG2,THHH,Tff,TsD";
l_dictData["inputoutputbit"] = "A1(1),A1(2),....,A1(9)A2(1),A2(2)....A2(9),H5(1)....H5(9),J7(1),...J7(9),B1(1),....B1(9),E4(1),....E4(9),Y7(1),...Y7(9),B2(1),....B2(9)";
l_dictData["outputbit"] = "TGY";
Here is my Regular Expression
1. ([ \t\r\n]*)?(data|DATA)([ \t\r\n]*)?(\()?
2. "[ \t\r\n]*(?<PINFUNC>(inputbit|outputbit|inputoutputbit))(_vector[ \t\r\n]*\([ \t\r\n]*(?<START>([0-9]+))[ \t\r\n]*(to|downto)[ \t\r\n]*(?<END>([0-9]+))[ \t\r\n]*\))?
NOTE:
The Text before the ":"(Semi colon is taken as Value for the Dictionary)
Please let me know if u have any queries