blob: a15f2ef391b0f739556110a8c9e6b2fb939534c4 (
plain)
1
2
3
4
5
6
7
8
9
|
name = 'paren/2'
slug = 'properly nested parens'
description = '''\
<p>Write a DCG with the starting symbol <code>paren</code> for the language of properly nested sequences of parentheses. The terminal symbols in the grammar should be written like this: <code>['(']</code> and <code>[')']</code>.</p>
<p>Example words: <code>()</code>, <code>(())</code>, <code>()(())</code>, <code>(()())()</code>.</p>
<p>Example non-words: <code>)(</code>, <code>((()</code>, <code>))</code>.</p>'''
hint = {}
|