I’m attempting to define a grammar file that parses the following:
Section0:
Key0 = “Val0”
Key1 = “Val1”
…
My attempts thus far have just resulted in one long concatenation string with no real ability to split.
Section0:
(var=ID ‘=‘ String)*
I’m looking to have a list of dictionary-like objects.
Here is a possible solution:
By default,
textX
will return a list ofPair
objects inpairs
attribute of theSection
object. But, it is easy to transform it to a dictionary by using an object processor for the section as shown above.