Merge branch 'master' of https://github.com/dopefishh/cc1516
authorpimjager <pim@pimjager.nl>
Thu, 9 Jun 2016 16:41:09 +0000 (18:41 +0200)
committerpimjager <pim@pimjager.nl>
Thu, 9 Jun 2016 16:41:09 +0000 (18:41 +0200)
deliverables/report/pars.tex
deliverables/report/report.tex

index f67b82a..e666a47 100644 (file)
@@ -1,7 +1,29 @@
 \section{Lexing \& parsing}\label{sec:pars}
-\subsection{Yard}
+\subsection{\Yard}
+For both lexing and parsing we use proof of concept state of the art minimal
+parser combinators library called \Yard. \Yard{} is inspired by the well-known
+\textsc{Parsec} library. Where \Yard{} only has 9 parser combinators
+\textsc{Parsec} already has 9 categories of parser combinators with in every
+category there are numerous combinators.
+
+\begin{lstlisting}[language=Clean]
+:: Error = PositionalError Int Int String | Error String
+:: Parser a b = Parser ([a] -> (Either Error b, [a]))
+
+(<?>) :: (Parser a b) Error -> Parser a b
+fail :: Parser a b
+top :: Parser a a
+peek :: Parser a a
+satisfy :: (a -> Bool) -> Parser a a
+check :: (a -> Bool) -> Parser a a
+(until) infix 2 :: (Parser a b) (Parser a c) -> Parser a [b]
+item :: a -> Parser a a | Eq a
+list :: [a] -> Parser a [a] | Eq a
+eof :: Parser a Void
+\end{lstlisting}
 
 \subsection{Lexing}
+Listing~\ref{lst:grammar}.
 
 \subsection{Parsing}
 %On March 10 you have to give a very brief presentation.  In this presentation you tell the other
index efd98e0..248bcb2 100644 (file)
@@ -20,6 +20,7 @@
 \newcommand{\SPLC}{\texttt{SPLC}}
 \newcommand{\SPL}{\texttt{SPL}}
 \newcommand{\SSM}{\texttt{SSM}}
+\newcommand{\Yard}{\textsc{Yard}}
 \def\AST/{\texttt{AST}}
 
 \let\tt\texttt
@@ -39,4 +40,9 @@
 
 \input{ext.tex}
 
+\newpage
+\section{Appendices}
+\subsection{Grammar}
+\lstinputlisting[label={lst:grammar}{../../grammar/grammar.txt}
+
 \end{document}