\end{describe}
%%%--------------------------------------------------------------------------
+\section{Streams} \label{sec:parsing.streams}
+
+\begin{describe*}
+ {\dhead{cls}{position-aware-stream \&key :file :line :column}
+ \dhead{gf}{position-aware-stream-file @<stream> @> @<pathname>}
+ \dhead{gf}{setf (position-aware-stream-file @<stream>) @<pathname>}
+ \dhead{gf}{position-aware-stream-line @<stream> @> @<fixnum>}
+ \dhead{gf}{setf (position-aware-stream-line @<stream>) @<fixnum>}
+ \dhead{gf}{position-aware-stream-column @<stream> @> @<fixnum>}
+ \dhead{gf}{setf (position-aware-stream-column @<stream>) @<fixnum>}}
+\end{describe*}
+
+\begin{describe*}
+ {\dhead{cls}{position-aware-input-stream \&key :file :line :column}
+ \dhead{cls}{position-aware-output-stream \&key :file :line :column}}
+\end{describe*}
+
+\begin{describe}{gf}{stream-pathname @<stream> @> @<pathname-or-nil>}
+ \begin{describe}{meth}{stream}
+ {stream-pathname (@<stream> stream) @> nil}
+ \end{describe}
+ \begin{describe}{meth}{file-stream}
+ {stream-pathname (@<stream> file-stream) @> @<pathname>}
+ \end{describe}
+ \begin{describe}{meth}{position-aware-stream}
+ {stream-pathname (@<stream> position-aware-stream) @> @<pathname>}
+ \end{describe}
+\end{describe}
+
+\begin{describe}{gf}{stream-line-and-column @<stream> @> @<line> @<column>}
+ \begin{describe}{meth}{stream}
+ {stream-line-and-column (@<stream> stream) @> nil nil}
+ \end{describe}
+ \begin{describe}{meth}{position-aware-stream}
+ {stream-line-and-column (@<stream> position-aware-stream)
+ \nlret @<line> @<column>}
+ \end{describe}
+\end{describe}
+
+%%%--------------------------------------------------------------------------
\section{File locations} \label{sec:parsing.floc}
\begin{describe}{cls}{file-location}
{information-with-location (condition-with-location information) \\ \>
\&key :location}
\dhead{cls}
+ {enclosing-condition-with-location (condition) \\ \>
+ \&key :location}
+ \dhead{cls}
{enclosing-error-with-location
(enclosing-error-with-location error) \\ \>
\&key :condition :location}
\dhead{fun}{cerror-with-location @<floc> @<continue-string>
@<datum> \&rest @<arguments>}
\dhead{fun}{cerror*-with-location @<floc> @<datum> \&rest @<arguments>}
- \dhead{fun}{warn-with-location @<floc> @<datum> \&rest @<arguments>}}
+ \dhead{fun}{warn-with-location @<floc> @<datum> \&rest @<arguments>}
+ \dhead{fun}{info-with-location @<floc> @<datum> \&rest @<arguments>}}
\end{describe*}
\begin{describe*}
allows rewinding the scanner to an earlier point in the input so that it can
be scanned again.
+
\subsection{Basic scanner protocol} \label{sec:parsing.scanner.basic}
The basic protocol supports stepping the scanner forward through its input
step the scanner.
\end{describe}
+
\subsection{Place-capture scanner protocol} \label{sec:parsing.scanner.place}
The place-capture protocol allows rewinding to an earlier point in the
return values are the values of the final @<form>.
\end{describe}
+
\subsection{Scanner file-location protocol} \label{sec:parsing.scanner.floc}
Some scanners participate in the file-location protocol
return nil.
\end{describe*}
+
\subsection{Character scanners} \label{sec:parsing.scanner.char}
Character scanners are scanners which read sequences of characters.
character scanner protocols is suitable. See @|make-scanner-stream|.
\end{describe}
+
\subsection{String scanners} \label{sec:parsing.scanner.string}
A \emph{string scanner} is a simple kind of character scanner which reads
to the end of the @<string>).
\end{describe}
+
\subsection{Character buffer scanners} \label{sec:parsing.scanner.charbuf}
A \emph{character buffer scanner}, or \emph{charbuf scanner} for short, is an
the scanner will update the location as it reads its input.
\end{describe}
+\begin{describe}{cls}
+ {charbuf-scanner-stream (character-scanner-stream) \&key :scanner}
+\end{describe}
+
\begin{describe}{cls}{charbuf-scanner-place}
The class of place objects captured by a charbuf scanner.
\end{describe}
at least once, or with $@<used> > @<start>$.
\end{describe}
+
\subsection{Token scanners} \label{sec:parsing.scanner.token}
\begin{describe}{cls}
{token-scanner () \&key :filename (:line 1) (:column 0)}
\end{describe}
+\begin{describe*}
+ {\dhead{gf}{setf (scanner-line @<scanner>) @<fixnum>}
+ \dhead{gf}{setf (scanner-column @<scanner>) @<fixnum>}}
+\end{describe*}
+
\begin{describe}{gf}{token-type @<scanner> @> @<type>}
\end{describe}
{token-scanner-place-p @<value> @> @<generalized-boolean>}
\end{describe}
+
\subsection{List scanners}
\begin{describe}{ty}{list-scanner}
\end{describe}
%%%--------------------------------------------------------------------------
-\section{Parsing syntax}
+\section{Parser contexts and parser syntax} \label{sec:parsing.syntax}
+
+
+\subsection{Parser contexts} \label{sec:parsing.syntax.contexts}
+
+\begin{describe}{mac}
+ {with-parser-context
+ (@<context-class> @{ @<init-keyword> @<value> @}^*) \\ \ind
+ @<declaration>^* \\
+ @<form>^*
+ \-\nlret @<value>^*}
+\end{describe}
\begin{describe}{gf}{expand-parser-spec @<context> @<spec> @> @<form>}
\end{describe}
\-\nlret @<name>}
\end{describe}
-\begin{describe}{mac}
- {with-parser-context
- (@<context-class> @{ @<init-keyword> @<value> @}^*) \\ \ind
- @<declaration>^* \\
- @<form>^*
- \-\nlret @<value>^*}
-\end{describe}
-
\begin{describe}{lmac}
{parse @<parser> @> @<result> @<success-flag> @<consumed-flag>}
\end{describe}
\-\nlret @<value>^*}
\end{describe}
+\begin{describe}{cls}{list-parser () \&key :var}
+\end{describe}
+
+
+\subsection{Basic parser syntax} \label{sec:parsing.syntax.basic}
+
\begin{describe}{parse}{:eof}
\end{describe}
@<form>^*}
\end{describe}
+
+\subsection{Place-capture protocol} \label{sec:parsing.syntax.place}
+
\begin{describe}{gf}{parser-capture-place @<context> @> @<form>}
\end{describe}
\begin{describe}{parseform}{commit}
\end{describe}
+
+\subsection{Character parsers} \label{sec:parsing.syntax.character}
+
\begin{describe}{cls}{character-parser-context () \&key}
\end{describe}
\begin{describe}{gf}{parser-current-char @<context> @> @<form>}
\end{describe}
+\begin{describe}{cls}
+ {string-parser (character-parser-context) \&key :string :index :length}
+\end{describe}
+
\begin{describe}{parseform}
{if-char (@[@<result-var>@]) @<condition> @<consequent> @<alternative>}
\end{describe}
\begin{describe}{parse}[atom]{@<atom>}
\end{describe}
+
+\subsection{Scanner contexts} \label{sec:parsing.syntax.scanner}
+
\begin{describe}{cls}{scanner-context () \&key :scanner}
\end{describe}
-\begin{describe}{gf}{parse-scanner @<context> @> @<symbol>}
+\begin{describe}{gf}{parser-scanner @<context> @> @<symbol>}
\end{describe}
\begin{describe}{cls}
\&key :scanner}
\end{describe}
-\begin{describe}{gf}{push-operator @<operator> @<state>}
-\end{describe}
-
-\begin{describe}{gf}{push-value @<value> @<state>}
-\end{describe}
-\begin{describe}{gf}{apply-operator @<operator> @<state>}
-\end{describe}
+\subsection{Expression parsing} \label{sec:parsing.syntax.expression}
\begin{describe}{gf}{operator-push-action @<left> @<right>}
\end{describe}
\end{describe*}
\begin{describe*}
- {\dhead{cls}{parenthesis () \&key :tag}
- \dhead{cls}{open-parenthesis (parenthesis prefix-operator) \&key :tag}
+ {\dhead{cls}{open-parenthesis (parenthesis prefix-operator) \&key :tag}
\dhead{cls}{close-parenthesis (parenthesis) \&key :tag}}
\end{describe*}
\end{describe*}
%%%-------------------------------------------------------------------------
-\section{Lexical analyser}
+\section{Lexical analyser} \label{sec:parsing.lexical}
\begin{describe}{cls}
{sod-token-scanner (token-scanner)