/usr/share/doc/frown-doc/examples/other/Fun.g is in frown-doc 0.6.1-13.
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 40 | {-
An ambiguous grammar (3 reduce/reduce conflicts).
frown --backtrack Fun.g
-}
module Fun
where
import Monad
type Result = []
%{
Terminal = Special ';' | Special ',' | Special '=' | Special '|' | Var;
Nonterminal = bindings | binding | alts | expr | vars | fun;
bindings : bindings, binding;
| ;
binding : fun, vars, Special '=', expr, Special ';', alts;
alts : vars, Special '|', expr, Special ';', alts;
| ;
expr : Var;
| fun, vars;
vars : vars, Var;
| ;
fun : Var;
}%
data Terminal = Special Char | Var
frown _ = fail "syntax error"
|