Interesting languages
“Hardest” languages to test parsers. Most examples taken from Expressive power of LL(k) Boolean grammars
Linear context-free language
“Balanced brackets”:
And variations of the above:
Classical context sensitive (LinConjLL)
Classical context sensitive example:
S → A&C
A → aA | D
D → bDc | ε
C → aCc | B
B → bB | ε
PEG
Same example used by Ford to show that PEG can handle context sensitive grammar.
A ← aAb/ε
B ← bBc/ε
S ← &(A!b)a∗ B!.
Actually it can’t handle exactly this language, but it still can handle other context sensitive language. See https://github.com/SRI-CSL/PVSPackrat/issues/3
Other context sensitive
“copy langauge”:
TAG (Tree Adjoining Grammar)
MG (Minimalist Grammar)
CFLL, but not in LinCFLL
S → X &¬T
T → X &¬Aca&¬Acb
A → aAb | ε
X → aX | bX | cX | ε.
Strongly non-left-recursive Boolean P-complete language
S → E&¬AbS&¬CS
A → aA | ε
C → aCAb | b
E → aE | bE | ε.
Strongly non-left-recursive conjunctive language
S → C &D
C → XCX | c
X → a | b
D → aA&aD | bB&bD | cE
A → XAX | cEa
B → XBX | cEb
E → aE | bE | ε.
Jeż language
A1 → A1 A3 & A2 A2 | a
A2 → A1 A1 & A2 A6 | aa
A3 → A1 A2 & A6 A6 | aaa
A6 → A1 A2 & A3 A3.
LL(1) linear Boolean language
S → aS&¬A | bB
A → aAb | ε
B → bB | ε