doc/parsing.tex: Reorganize the parsing-syntax section.
[sod] / doc / parsing.tex
index cd0e12f..c694ef8 100644 (file)
@@ -542,7 +542,18 @@ file-location protocols.
 \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}
@@ -562,14 +573,6 @@ file-location protocols.
      \-\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}
@@ -611,6 +614,9 @@ file-location protocols.
      \-\nlret @<value>^*}
 \end{describe}
 
+
+\subsection{Basic parser syntax} \label{sec:parsing.syntax.basic}
+
 \begin{describe}{parse}{:eof}
 \end{describe}
 
@@ -686,6 +692,9 @@ file-location protocols.
       @<form>^*}
 \end{describe}
 
+
+\subsection{Place-capture protocol} \label{sec:parsing.syntax.place}
+
 \begin{describe}{gf}{parser-capture-place @<context> @> @<form>}
 \end{describe}
 
@@ -711,6 +720,9 @@ file-location protocols.
 \begin{describe}{parseform}{commit}
 \end{describe}
 
+
+\subsection{Character parsers} \label{sec:parsing.syntax.character}
+
 \begin{describe}{cls}{character-parser-context () \&key}
 \end{describe}
 
@@ -760,6 +772,9 @@ file-location protocols.
 \begin{describe}{parse}[atom]{@<atom>}
 \end{describe}
 
+
+\subsection{Scanner contexts} \label{sec:parsing.syntax.scanner}
+
 \begin{describe}{cls}{scanner-context () \&key :scanner}
 \end{describe}
 
@@ -776,6 +791,9 @@ file-location protocols.
       \&key :scanner}
 \end{describe}
 
+
+\subsection{Expression parsing} \label{sec:parsing.syntax.expression}
+
 \begin{describe}{gf}{push-operator @<operator> @<state>}
 \end{describe}
 
@@ -850,7 +868,7 @@ file-location protocols.
 \end{describe*}
 
 %%%-------------------------------------------------------------------------
-\section{Lexical analyser}
+\section{Lexical analyser} \label{sec:parsing.lexical}
 
 \begin{describe}{cls}
     {sod-token-scanner (token-scanner)