11.07.2015 Views

Recursive descent parsing for grammars with contexts

Recursive descent parsing for grammars with contexts

Recursive descent parsing for grammars with contexts

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Grammars <strong>with</strong> <strong>contexts</strong> (B, Okhotin, 2012)A → α 1 & . . . & α k & ✄β 1 & . . . & ✄β m & γ 1 & . . . & γ nGiven a string x = u w v:each α i defines weach β i defines v (the right context of w)each γ i defines wv (the extended right context of w)Semantics by logical deduction of elementary propositions[X , 〈w〉v] : “a string w written in right context v has the property X ”{a n b n c} ∪ {a n b 2n d}S → Ac | BdA → aAb | ε L(A) = {a n b n }B → aBbb | ε L(B) = {a n b 2n }X → aX | bX | ε L(X ) = (a | b) ∗the language is not standard LL(k) <strong>for</strong> any kway out: use right <strong>contexts</strong> to peek the last symbol of the stringMikhail Barash<strong>Recursive</strong> <strong>descent</strong> <strong>for</strong> <strong>grammars</strong> <strong>with</strong> <strong>contexts</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!