aboutsummaryrefslogtreecommitdiff
path: root/doc/grammar.tex
blob: ac4f0ee5c95a8e4efaa7e3bf831c9c12bcbdd08a (plain) (blame)
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
41
\section{Grammar}
\label{sec:grammar}

\setlength{\grammarparsep}{4pt}
\setlength{\grammarindent}{10em}
\begin{grammar}
	<Fuspel> ::= <Rewrite-list>

	<Rewrite-list> ::= <Rewrite> `;' <Rewrite-list> | <empty>

	<Rewrite> ::= <Name> <Arg-list> `=' <Rhs>

	<Arg-list> ::= <Arg> ` ' <Arg-list> | <empty>

	<Arg> ::= <Simple-expr>

	<Simple-expr> ::= <Int>
		\alt <Name>
		\alt <Simple-list>
		\alt <Simple-tuple>

	<Simple-list> ::= `[' <Simple-expr> `:' <Simple-list> `]'
		\alt `[]'
	
	<Simple-tuple> ::= `(' <Simple-expr> `,' <Simple-expr> `)'

	<Rhs> ::= <Expr>

	<Expr> ::= <Int>
		\alt <Name>
		\alt <List>
		\alt <Tuple>
		\alt <Expr> <Expr>
		\alt `code' <Name>
		\alt `(' <Expr> `)'

	<List> ::= `[' <Expr> `:' <List> `]'
		\alt `[]'
	
	<Tuple> ::= `(' <Simple-expr> `,' <Simple-expr> `)'
\end{grammar}