From: Mart Lubbers Date: Thu, 9 Jun 2016 14:02:02 +0000 (+0200) Subject: lex ding X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=50e013797dcd2cd0e925edd4d6bf7d0336035ac0;p=cc1516.git lex ding --- diff --git a/deliverables/report/pars.tex b/deliverables/report/pars.tex index f67b82a..7172aa2 100644 --- a/deliverables/report/pars.tex +++ b/deliverables/report/pars.tex @@ -1,5 +1,26 @@ \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} diff --git a/deliverables/report/report.tex b/deliverables/report/report.tex index 5131eb0..490ca32 100644 --- a/deliverables/report/report.tex +++ b/deliverables/report/report.tex @@ -19,6 +19,7 @@ \newcommand{\SPLC}{\texttt{SPLC}} \newcommand{\SPL}{\texttt{SPLC}} \newcommand{\SSM}{\texttt{SPLC}} +\newcommand{\Yard}{\textsc{Yard}} \begin{document} \maketitle