X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/bb80145308ea388d7c6ed5336c061340e78f66e8..0bc19f1cfd8df00eabb0bab82eca3f38f178e141:/doc/parsing.tex diff --git a/doc/parsing.tex b/doc/parsing.tex index e39a9e9..28a747b 100644 --- a/doc/parsing.tex +++ b/doc/parsing.tex @@ -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 @@ -124,11 +124,12 @@ consumed any input items. \end{describe*} \begin{describe}{mac} - {with-default-error-location (@) @^* @> @^*} + {with-default-error-location (@) @^* @
^* + @> @^*} \end{describe} \begin{describe}{mac} - {count-and-report-errors () @^* + {count-and-report-errors () @^* @^* @> @ @ @} \end{describe} @@ -209,7 +210,8 @@ the scanner and read that data again. Therefore it's possible to \end{describe} \begin{describe}{mac} - {with-scanner-place (@ @) @^* @> @^*} + {with-scanner-place (@ @) @^* @^* + @> @^*} Capture the @'s current position as a place, evaluate the @s as an implicit progn with the variable @ bound to the captured place. When control leaves the @s, the place is released. The return @@ -446,14 +448,16 @@ file-location protocols. \begin{describe}{mac} {defparse @ (@[[ :context (@ @) @]] @^*) \\ \ind - @^* \- + @[[ @^* @! @ @]] \\ + @^* \- \nlret @} \end{describe} \begin{describe}{mac} {with-parser-context (@ @{ @ @ @}^*) \\ \ind - @^* \- + @^* \\ + @^* \- \nlret @^*} \end{describe} @@ -461,6 +465,13 @@ file-location protocols. {parse @ @> @ @ @} \end{describe} +\begin{describe}{mac} + {parser @ + @[[ @^* @! @ @]] + @ + @> @} +\end{describe} + \begin{describe}{gf}{parser-at-eof-p @ @> @} \end{describe} @@ -482,7 +493,7 @@ file-location protocols. \begin{describe}{mac} {when-parse (@[@@]) @ \\ \ind - @^* \- + @^* \- \nlret @^*} \end{describe} @@ -563,7 +574,9 @@ file-location protocols. \end{describe} \begin{describe}{mac} - {define-pluggable-parser @ @ @ @^*} + {define-pluggable-parser @ @ @ + @[[ @^* @! @ @]] + @^*} \end{describe} \begin{describe}{gf}{parser-capture-place @ @> @} @@ -580,7 +593,9 @@ file-location protocols. \end{describe} \begin{describe}{mac} - {with-parser-place (@ @) @^*} + {with-parser-place (@ @) + @[[ @^* @! @ @]] + @^*} \end{describe} \begin{describe}{parseform}{peek @} @@ -654,11 +669,108 @@ file-location protocols. \&key :scanner} \end{describe} -%% FIXME parser-expr +\begin{describe}{gf}{push-operator @ @} +\end{describe} + +\begin{describe}{gf}{push-value @ @} +\end{describe} + +\begin{describe}{gf}{apply-operator @ @} +\end{describe} + +\begin{describe}{gf}{operator-push-action @ @} +\end{describe} + +\begin{describe}{parseform} + {expr \=(@[[ :nestedp @ @]]) \+ \\ + @ @ + @ @} +\end{describe} + +\begin{describe}{gf}{operator-left-precedence @ @> @} +\end{describe} + +\begin{describe}{gf}{operator-right-precedence @ @> @} +\end{describe} + +\begin{describe}{gf}{operator-associativity @ @> @} +\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 @ (@ @) + @^* @^* + @> @} + \dhead{mac}{postop @ + (@ @ @[[ :rprec @ @]]) + @^* @^* + \nlret @} + \dhead{mac}{binop @ (@ @ @ @) + @^*@^* + @> @}} +\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 @ @> @} + \dhead{fun}{rparen @ @> @}} +\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 @ @} +\end{describe} + +\begin{describe}{fun}{syntax-error @ @ \&key :continuep} +\end{describe} + +\begin{describe}{fun} + {lexer-error @ @ @} +\end{describe} + +\begin{describe}{parseform} + {skip-until (@[[ :keep-end @ @]]) @^*} +\end{describe} + +\begin{describe}{parseform}{error () @ @} +\end{describe} + +\begin{describe}{fun} + {scan-comment @ + @> @ @ @} +\end{describe} + %%%----- That's all, folks -------------------------------------------------- %%% Local variables: