/usr/share/doc/frown-doc/examples/other/Paren.lg is in frown-doc 0.6.1-14.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | {-
frown Paren.lg
Try
Left-recursive definition.
Expr : Expr, '(', Expr, ')';
| ;
-}
> module Paren
> where
>
> data Tree = Node [Tree]
> deriving (Show)
>
> empty = Node []
> join t (Node us) = Node (t : us)
>
> type Terminal = Char
>
> type Result = []
>
> %{
>
> Terminal = '(' | ')';
>
> Nonterminal = expr {Tree};
>
> expr {join t u} : expr {t}, '(', expr {u}, ')';
> {empty} | ;
>
> }%
>
> frown ts = fail "syntax error"
|