chiark / gitweb /
debian/libsod-dev.install: Fix name of manpage.
[sod] / doc / parsing.tex
index e39a9e967b168ead5b8fe34a84a256e588bb0c9d..c04ab562657ca18220723bded6a9eb79c86e6871 100644 (file)
@@ -7,7 +7,7 @@
 
 %%%----- Licensing notice ---------------------------------------------------
 %%%
-%%% This file is part of the Sensble Object Design, an object system for C.
+%%% This file is part of the Sensible Object Design, an object system for C.
 %%%
 %%% SOD is free software; you can redistribute it and/or modify
 %%% it under the terms of the GNU General Public License as published by
@@ -43,6 +43,13 @@ consumed any input items.
 \begin{describe}{fun}{combine-parser-failures @<failures> @> @<list>}
 \end{describe}
 
+\begin{describe}{fun}{parse-empty \&optional @<value> @> @<function>}
+\end{describe}
+
+\begin{describe}{fun}
+    {parse-fail @<indicator> \&optional @<consumedp> @> @<function>}
+\end{describe}
+
 %%%--------------------------------------------------------------------------
 \section{File locations} \label{sec:parsing.floc}
 
@@ -124,11 +131,12 @@ consumed any input items.
 \end{describe*}
 
 \begin{describe}{mac}
-    {with-default-error-location (@<floc>) @<body-form>^* @> @<value>^*}
+    {with-default-error-location (@<floc>) @<declaration>^* @<form>^*
+      @> @<value>^*}
 \end{describe}
 
 \begin{describe}{mac}
-    {count-and-report-errors () @<body-form>^*
+    {count-and-report-errors () @<declaration>^* @<form>^*
       @> @<value> @<n-errors> @<n-warnings>}
 \end{describe}
 
@@ -209,7 +217,8 @@ the scanner and read that data again.  Therefore it's possible to
 \end{describe}
 
 \begin{describe}{mac}
-    {with-scanner-place (@<place> @<scanner>) @<body-form>^* @> @<value>^*}
+    {with-scanner-place (@<place> @<scanner>) @<declarations>^* @<form>^*
+      @> @<value>^*}
   Capture the @<scanner>'s current position as a place, evaluate the
   @<body-form>s as an implicit progn with the variable @<place> bound to the captured
   place.  When control leaves the @<body-form>s, the place is released.  The return
@@ -446,14 +455,16 @@ file-location protocols.
 \begin{describe}{mac}
     {defparse @<name> (@[[ :context (@<var> @<context-class>) @]]
                        @<destructuring-lambda-list-item>^*) \\ \ind
-      @<body-form>^* \-
+      @[[ @<declaration>^* @! @<doc-string> @]] \\
+      @<form>^* \-
      \nlret @<name>}
 \end{describe}
 
 \begin{describe}{mac}
     {with-parser-context
         (@<context-class> @{ @<init-keyword> @<value> @}^*) \\ \ind
-      @<body-form>^* \-
+      @<declaration>^* \\
+      @<form>^* \-
      \nlret @<value>^*}
 \end{describe}
 
@@ -461,6 +472,13 @@ file-location protocols.
     {parse @<parser> @> @<result> @<success-flag> @<consumed-flag>}
 \end{describe}
 
+\begin{describe}{mac}
+    {parser @<lambda-list>
+      @[[ @<declaration>^* @! @<doc-string> @]]
+      @<parser>
+      @> @<function>}
+\end{describe}
+
 \begin{describe}{gf}{parser-at-eof-p @<context> @> @<form>}
 \end{describe}
 
@@ -482,7 +500,7 @@ file-location protocols.
 
 \begin{describe}{mac}
     {when-parse (@[@<result-var>@]) @<parser> \\ \ind
-      @<body-form>^* \-
+      @<form>^* \-
      \nlret @<value>^*}
 \end{describe}
 
@@ -563,7 +581,9 @@ file-location protocols.
 \end{describe}
 
 \begin{describe}{mac}
-    {define-pluggable-parser @<symbol> @<tag> @<lambda-list> @<body-form>^*}
+    {define-pluggable-parser @<symbol> @<tag> @<lambda-list>
+      @[[ @<declaration>^* @! @<doc-string> @]]
+      @<form>^*}
 \end{describe}
 
 \begin{describe}{gf}{parser-capture-place @<context> @> @<form>}
@@ -580,12 +600,17 @@ file-location protocols.
 \end{describe}
 
 \begin{describe}{mac}
-    {with-parser-place (@<place-var> @<context>) @<body-form>^*}
+    {with-parser-place (@<place-var> @<context>)
+      @[[ @<declaration>^* @! @<doc-string> @]]
+      @<form>^*}
 \end{describe}
 
 \begin{describe}{parseform}{peek @<parser>}
 \end{describe}
 
+\begin{describe}{parseform}{commit}
+\end{describe}
+
 \begin{describe}{cls}{character-parser-context () \&key}
 \end{describe}
 
@@ -654,11 +679,108 @@ file-location protocols.
       \&key :scanner}
 \end{describe}
 
-%% FIXME parser-expr
+\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}
+
+\begin{describe}{gf}{operator-push-action @<left> @<right>}
+\end{describe}
+
+\begin{describe}{parseform}
+    {expr \=(@[[ :nestedp @<nestedp-var> @]]) \+ \\
+            @<operand-parser> @<binop-parser>
+            @<preop-parser> @<postop-parser>}
+\end{describe}
+
+\begin{describe}{gf}{operator-left-precedence @<operator> @> @<prec>}
+\end{describe}
+
+\begin{describe}{gf}{operator-right-precedence @<operator> @> @<prec>}
+\end{describe}
+
+\begin{describe}{gf}{operator-associativity @<operator> @> @<assoc>}
+\end{describe}
+
+\begin{describe}{cls}{prefix-operator () \&key}
+\end{describe}
+
+\begin{describe}{cls}{simple-operator () \&key :name :function}
+\end{describe}
+
+\begin{describe}{cls}
+    {simple-unary-operator (simple-operator) \&key :name :function}
+\end{describe}
+
+\begin{describe*}
+    {\quad\=\kill
+     \dhead{cls}{simple-binary-operator (simple-operator) \\ \>
+                  \&key :name :function :lprec :rprec :associativity}
+     \dhead{cls}{simple-postfix-operator (simple-unary-operator) \\ \>
+                  \&key :name :function :lprec :rprec}
+     \dhead{cls}{simple-prefix-operator
+                    (prefix-operator simple-unary-operator) \\ \>
+                  \&key :name :function :rprec}}
+\end{describe*}
+
+\begin{describe*}
+    {\dhead{mac}{preop @<name> (@<operand-var> @<lprec>)
+                  @<declaration>^* @<form>^*
+                  @> @<prefix-operator>}
+     \dhead{mac}{postop @<name>
+                     (@<operand-var> @<lprec> @[[ :rprec @<rprec> @]])
+                  @<declaration>^* @<form>^*
+                  \nlret @<postfix-operator>}
+     \dhead{mac}{binop @<name> (@<operand-var> @<lprec> @<rprec> @<assoc>)
+                  @<declaration>^*@<form>^*
+                  @> @<binary-operator>}}
+\end{describe*}
+
+\begin{describe*}
+    {\dhead{cls}{parenthesis () \&key :tag}
+     \dhead{cls}{open-parenthesis (parenthesis prefix-operator) \&key :tag}
+     \dhead{cls}{close-parenthesis (parenthesis) \&key :tag}}
+\end{describe*}
+
+\begin{describe*}
+    {\dhead{fun}{lparen @<tag> @> @<open-paren>}
+     \dhead{fun}{rparen @<tag> @> @<close-paren>}}
+\end{describe*}
 
 %%%-------------------------------------------------------------------------
 \section{Lexical analyser}
 
+\begin{describe}{cls}
+    {sod-token-scanner (token-scanner)
+      \&key :filename (:line 1) (:column 0) :char-scanner}
+\end{describe}
+
+\begin{describe}{fun}{define-indicator @<indicator> @<description>}
+\end{describe}
+
+\begin{describe}{fun}{syntax-error @<scanner> @<expected> \&key :continuep}
+\end{describe}
+
+\begin{describe}{fun}
+    {lexer-error @<char-scanner> @<expected> @<consumed-flag>}
+\end{describe}
+
+\begin{describe}{parseform}
+    {skip-until (@[[ :keep-end @<keep-end-flag> @]]) @<token-type>^*}
+\end{describe}
+
+\begin{describe}{parseform}{error () @<sub-parser> @<recover-parser>}
+\end{describe}
+
+\begin{describe}{fun}
+    {scan-comment @<char-scanner>
+      @> @<result> @<success-flag> @<consumed-flag>}
+\end{describe}
+
 %%%----- That's all, folks --------------------------------------------------
 
 %%% Local variables: