lex ding
authorMart Lubbers <mart@martlubbers.net>
Thu, 9 Jun 2016 14:02:02 +0000 (16:02 +0200)
committerMart Lubbers <mart@martlubbers.net>
Thu, 9 Jun 2016 14:02:02 +0000 (16:02 +0200)
deliverables/report/pars.tex
deliverables/report/report.tex

index f67b82a..7172aa2 100644 (file)
@@ -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}
 
index 5131eb0..490ca32 100644 (file)
@@ -19,6 +19,7 @@
 \newcommand{\SPLC}{\texttt{SPLC}}
 \newcommand{\SPL}{\texttt{SPLC}}
 \newcommand{\SSM}{\texttt{SPLC}}
+\newcommand{\Yard}{\textsc{Yard}}
 
 \begin{document}
 \maketitle