Ans Piter
Ans Piter

Reputation: 573

Right-hand Context Notation[DCG]

in this site, I found a part that explains how to build Right-hand Context Notation using DCG

A → ε | a A

Head, [T_1,...,T_n] --> Body.

someone help me figure out this method by example and illustrate its benefits to parse context-free grammar

Upvotes: 4

Views: 278

Answers (2)

CapelliC
CapelliC

Reputation: 60034

Look for Semicontext notation at DCG Primer: it's well explained, with examples

Upvotes: 2

false
false

Reputation: 10152

This notation is called a semicontext. See, e.g. this answer. With it you have strictly more power than context-free grammars. In fact, it is already type 0.

Upvotes: 3

Related Questions