aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorCamil Staps2016-08-25 11:16:49 +0200
committerCamil Staps2016-08-25 11:16:49 +0200
commit7d9b5a0c84a931542c088cfe6bc4325be22ecb71 (patch)
tree085e5ae27cfbabc2e1533f4927969f5784dd1cfc /doc
Initial commit
Diffstat (limited to 'doc')
-rw-r--r--doc/.gitignore7
-rw-r--r--doc/doc.tex26
-rw-r--r--doc/grammar.tex40
3 files changed, 73 insertions, 0 deletions
diff --git a/doc/.gitignore b/doc/.gitignore
new file mode 100644
index 0000000..3c0381d
--- /dev/null
+++ b/doc/.gitignore
@@ -0,0 +1,7 @@
+*.aux
+*.fdb_latexmk
+*.fls
+*.log
+*.out
+*.pdf
+*.toc
diff --git a/doc/doc.tex b/doc/doc.tex
new file mode 100644
index 0000000..576d966
--- /dev/null
+++ b/doc/doc.tex
@@ -0,0 +1,26 @@
+\documentclass[a4paper]{article}
+
+\author{Camil Staps}
+\title{Fuspel}
+
+\usepackage{geometry}
+\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
+\definecolor{linkcolor}{rgb}{0.65,0,0}
+\definecolor{citecolor}{rgb}{0,0.65,0}
+\definecolor{urlcolor}{rgb}{0,0,0.65}
+\usepackage[
+ colorlinks=true,
+ linkcolor=linkcolor,
+ urlcolor=urlcolor,
+ citecolor=citecolor]{hyperref}
+
+\usepackage{syntax}
+
+\begin{document}
+
+\maketitle
+\tableofcontents
+
+\input{grammar}
+
+\end{document}
diff --git a/doc/grammar.tex b/doc/grammar.tex
new file mode 100644
index 0000000..7a67a30
--- /dev/null
+++ b/doc/grammar.tex
@@ -0,0 +1,40 @@
+\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 `(' <Expr> `)'
+
+ <List> ::= `[' <Expr> `:' <List> `]'
+ \alt `[]'
+
+ <Tuple> ::= `(' <Simple-expr> `,' <Simple-expr> `)'
+\end{grammar}