1

I could use some hints to start writing a simple parser using C# (preferably superpower or perhaps sprache) to parse files defining some simple structures like:

Header
  HeaderDataItem1   "Value of item 1"
  HeaderDataItem2   "Value of item 2"
End Header
(* Single line comment *)
(* Another single line comment *)
EntityInfo
  SubGroupType1
    ItemName  "Name1"
    Item1  "Value of item 1"
    Item2  "Value of item 2"
  End SubGroupType1
    :
    :
  SubGroupType1
    ItemName  "Name2"
    Item1  "Value of item 1"
    Item2  "Value of item 2"
  End SubGroupType1
End EntityInfo

The real case is more complex, more keywords (tokens?), deeper, contains enums etc. but not infinitely nested though.

I guess this should be very simple, but as mentioned, I would highly appreciate some start help and would possibly being able to develop further what I need. I have checked some of the samples, but my experience in parsing is simply too little (quite experienced programming C# though)

4

0 回答 0