I’d like to bring together NimbleParsec and the remnants of my knowledge of grammars.
NimbleParsec can obviously parse a regular language (what regular expressions can parse). But can it also parse context-free languages? For example this one (from wikipedia)
S → SS
S → (S)
S → ()
which produces all strings with balanced parentheses, like () or ((())).
When I have production rules (eg in BNF), are there clear steps to get a NimbleParsec-parser from them?
What about “mild” context sensitive features, like remembering the name of a xml-tag to decide if the closing tag matches?