% output=pdftex engine=pdftex language=uk
%
% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa

\startcomponent mfun-020

\environment mfun-000

\chapter {\METAPOST\ syntax}

\startintro

In the \METAFONT\ book as well as the \METAPOST\ manual, you
can find the exact specification of the language. Below you
find the full \METAPOST\ syntax, to which we add the basic
\METAFUN\ extensions. If this page looks too cryptic, you
can safely skip to the next chapter.

% {\em There are still some bits and pieces missing.}

\stopintro

\section {Syntax diagrams}

The following syntax diagrams are derived from the diagrams
in the \METAPOST\ manual. The \mathematics {\rightarrow}
represents \quote {means} and the \mathematics {\vert}
symbol stands for \quote {or}.

The diagrams describe the hard coded \METAPOST\ syntax as
well as most of the macros and variables defined in the plain
\METAPOST\ format that belongs to the core of the system. They
also include some of the more fundamental \METAFUN\ commands.

\start \switchtobodyfont[small]

\StartSyntax
\S{atom}
  \M \S{variable} \S{argument}
  \O \S{number or fraction}
  \O \S{internal variable}
  \O \L{(} \S{expression} \L{)}
  \O \L{begingroup} \S{statement list} \S{expression} \L{endgroup}
  \O \S{nullary op}
  \O \L{btex} \S{typesetting command} \L{etex}
  \O \S{pseudo function}
\StopSyntax

\StartSyntax
\S{primary}
  \M \S{atom}
  \O \L{(} \S{numeric expression} \L{,} \S{numeric expression} \L{)}
  \O \L{(} \S{numeric expression} \L{,} \S{numeric expression} \L{,} \S{numeric expression} \L{)}
  \O \S{of operator} \S{expression} \L{of} \S{primary}
  \O \S{of operator} \S{expression} \FL{along} \S{primary}
  \O \S{of operator} \S{expression} \FL{on} \S{primary}
  \O \S{unary op} \S{primary}
  \O \L{str} \S{suffix}
  \O \L{z} \S{suffix}
  \O \S{numeric atom} \L{[} \S{expression} \L{,} \S{expression} \L{]}
  \O \S{scalar multiplication op} \S{primary}
\StopSyntax

\StartSyntax
\S{secondary}
  \M \S{primary}
  \O \S{secondary} \S{primary binop} \S{primary}
  \O \S{secondary} \S{transformer}
\StopSyntax

\StartSyntax
\S{tertiary}
  \M \S{secondary}
  \O \S{tertiary} \S{secondary binop} \S{secondary}
\StopSyntax

\StartSyntax
\S{subexpression}
  \M \S{tertiary}
  \O \S{path expression} \S{path join} \S{path knot}
\StopSyntax

\StartSyntax
\S{expression}
  \M \S{subexpression}
  \O \S{expression} \S{tertiary binop} \S{tertiary}
  \O \S{path subexpression} \S{direction specifier}
  \O \S{path subexpression} \S{path join} \L{cycle}
\StopSyntax

\StartSyntax
\S{path knot}
  \M \S{tertiary}
\StopSyntax

\StartSyntax
\S{path join}
  \M \L{--}
  \O \S{direction specifier} \S{basic path join} \S{direction specifier}
\StopSyntax

\StartSyntax
\S {direction specifier}
  \M \S{empty}
  \O \LB \L{curl} \S{numeric expression} \RB
  \O \LB \S{pair expression} \RB
  \O \LB \S{numeric expression} \L{,} \S{numeric expression} \RB
\StopSyntax

\StartSyntax
\S{basic path join}
  \M \L{..}
  \O \L{...}
  \O \L{..} \S{tension} \L{..}
  \O \L{..} \S{tension} \L{..}
  \O \L{..} \S{controls} \L{..}
\StopSyntax

\StartSyntax % atleast added
\S{tension}
  \M \L{tension} \S{numeric primary}
  \O \L{tension} \L{atleast} \S{numeric primary}
  \O \L{tension} \S{numeric primary} \L{and} \S{numeric primary}
\StopSyntax

\StartSyntax
\S{controls}
  \M controls\S{pair primary}
  \O controls\S{pair primaryiandhpair primary}
\StopSyntax

\StartSyntax
\S{argument}
  \M \S{symbolic token}
\StopSyntax

\StartSyntax
\S{number or fraction}
  \M \S{number} \L{/} \S{number}
  \O \S{number not followed by \Q{\L{/}\S{numberi}}}
\StopSyntax

\StartSyntax
\S{scalar multiplication op}
  \M \L{+} \O \L{-}
  \O \S{\Q{\S{number or fractioni}} not followed by \Q{\S{add op} \S{number}}}
\StopSyntax

\StartSyntax
\S{transformer}
  \M \L {rotated}        \S {numeric primary}
  \O \L {scaled}         \S {numeric primary}
  \O \L {shifted}        \S {pair primary}
  \O \L {slanted}        \S {numeric primary}
  \O \L {transformed}    \S {transform primary}
  \O \L {xscaled}        \S {numeric primary}
  \O \L {yscaled}        \S {numeric primary}
  \O \L {zscaled}        \S {pair primary}
  \O \FL{xyscaled}       \S {numeric or pair primary}
  \O \L {reflectedabout} \L {(} \S{pair expression} \L{,} \S{pair expressioni} \L{)}
  \O \L {rotatedaround}  \L {(} \S{pair expression} \L{,} \S{numeric expression} \L{)}
  \O \FL{xsized}         \S {numeric primary}
  \O \FL{ysized}         \S {numeric primary}
  \O \FL{xysized}        \S {numeric or pair primary}
  \O \FL{enlarged}       \FS{numeric or pair primary}
  \O \FL{leftenlarged}   \FS{numeric primary}
  \O \FL{rightenlarged}  \FS{numeric primary}
  \O \FL{topenlarged}    \FS{numeric primary}
  \O \FL{bottomenlarged} \FS{numeric primary}
  \O \FL{randomized}     \FS{numeric or pair or color primary}
  \O \FL{cornered}       \FS{numeric or pair}
  \O \FL{smoothed}       \FS{numeric or pair}
  \O \FL{sqeezed}        \FS{numeric or pair primary}
  \O \FL{superellipsed}  \S {numeric primary}
  \O \FL{randomshifted}  \FS{numeric or pair primary}
  \O \FL{uncolored}      \S {color primary}
  \O \FL{softened}       \FS{numeric or color primary}
\StopSyntax

\StartSyntax
\FS{numeric or pair primary}
  \M \FS{numeric primary}
  \O \FS{pair primary}
\StopSyntax

\StartSyntax
\FS{numeric or pair or color primary}
  \M \FS{numeric primary}
  \O \FS{pair primary}
  \O \FS{color primary}
\StopSyntax

\StartSyntax
\FS{numeric or color primary}
  \M \FS{numeric primary}
  \O \FS{color primary}
\StopSyntax

\StartSyntax
\S{nullary op}
  \M \L{false} \O \L{normaldeviate} \O \L{nullpicture} \O \L{pencircle}%
     \O \L{true} \O \L{whatever}
\StopSyntax

\StartSyntax
\S{unary op}
  \M \S{type}
  \O \L {abs}%
  \O \FL{acos}%
  \O \FL{acosh}%
  \O \L {angle}%
  \O \L {arclength}%
  \O \L {ASCII}%
  \O \FL{asin}%
  \O \FL{asinh}%
  \O \FL{atan}
  \O \L {bbox}%
  \O \L {bluepart}%
  \O \L {bot}%
  \O \FL{bottomboundary}%
  \O \L {bounded}%
  \O \FL{boundingbox}
  \O \L {ceiling}%
  \O \L {center}%
  \O \L {char}%
  \O \L {clipped}%
  \O \FL{condition}%
  \O \L {cosd}%
  \O \FL{cos}%
  \O \FL{cosh}%
  \O \FL{cot}%
  \O \FL{cotd}%
  \O \L {cycle}
  \O \L {dashpart}%
  \O \L {decimal}%
  \O \FL{ddecimal}%
  \O \FL{dddecimal}%
  \O \L {dir}%
  \O \FL{exp}
  \O \L {filled}%
  \O \L {floor}%
  \O \L {fontpart}%
  \O \L {fontsize}%
  \O \FL{grayed}%
  \O \L {greenpart}
  \O \L {hex}%
  \O \FL{innerboundingbox}%
  \O \FL{inv}%
  \O \FL{invcos}%
  \O \L {inverse}%
  \O \FL{inverted}%
  \O \FL{invsin}
  \O \L {known}%
  \O \FL{leftboundary}%
  \O \L {length}%
  \O \L {lft}%
  \O \L {llcorner}%
  \O \FL{ln}%
  \O \FL{log}%
  \O \L {lrcorner}
  \O \L {makepath}%
  \O \L {makepen}%
  \O \L {mexp}%
  \O \L {mlog}%
  \O \L {not}%
  \O \L {oct}%
  \O \L {odd}%
  \O \FL{outerboundingbox}
  \O \L {pathpart}%
  \O \L {penpart}%
  \O \L {redpart}%
  \O \L {reverse}%
  \O \FL{rightboundary}%
  \O \L {round}%
  \O \L {rt}
  \O \FL{simplified}%
  \O \FL{sin}%
  \O \L {sind}%
  \O \FL{sinh}%
  \O \FL{sqr}%
  \O \L {sqrt}%
  \O \L {stroked}
  \O \FL{tan}%
  \O \FL{tand}%
  \O \L {textpart}%
  \O \L {textual}%
  \O \L {top}%
  \O \FL{topboundary}
  \O \L {ulcorner}%
  \O \L {uniformdeviate}%
  \O \L {unitvector}%
  \O \L {unknown}%
  \O \FL{unspiked}%
  \O \L {urcorner}
  \O \L {xpart}%
  \O \L {xxpart}%
  \O \L {xypart}%
  \O \L {ypart}%
  \O \L {yxpart}%
  \O \L {yypart}%
\StopSyntax

\StartSyntax
\S{type}
  \M \L{boolean} \O \L{color} \O \L{numeric} \O \L{pair} \O \L{path}
  \O \L{pen} \O \L{picture} \O \L{string} \O \L{transform}
\StopSyntax

\StartSyntax
\S{primary binop}
  \M \L{*} \O \L{/} \O \L{**} \O \L{and}
  \O \L{dotprod} \O \L{div} \O \L{infont} \O \L{mod}
\StopSyntax

\StartSyntax
\S{secondary binop}
  \M \L{+} \O \L{-} \O \L{++} \O \L{+-+} \O \L{or}
  \O \L{intersectionpoint} \O \L{intersectiontimes}
\StopSyntax

\StartSyntax
\S{tertiary binop}
  \M \L{&} \O \L{<} \O \L{<=} \O \L{<>} \O \L{=} \O \L{>} \O \L{>=}
  \O \L{cutafter} \O \L{cutbefore} \O \FL{cutends}
\StopSyntax

\StartSyntax
\S{of operator}
  \M \L{arctime} \O \L{direction} \O \L{directiontime} \O \L{directionpoint}%
     \O \L{penoffset} \O \L{point}
  \O \L{postcontrol} \O \L{precontrol} \O \L{subpath} \O \L{substring}
\StopSyntax

\StartSyntax
\S{variable}
  \M \S{tag} \S{suffix}
\StopSyntax

\StartSyntax
\S{suffix}
  \M \S{empty}
  \O \S{suffix} \S{subscript}
  \O \S{suffix} \S{tag}
  \O \S{suffix parameter}
\StopSyntax

\StartSyntax
\S{subscript}
  \M \S{number}
  \O \L{[} \S{numeric expression} \L{]}
\StopSyntax

\StartSyntax
\S{internal variable}
  \M \L{ahangle} \O \L{ahlength} \O \L{bboxmargin} \O \L{charcode}%
     \O \L{day} \O \L{defaultpen} \O \L{defaultscale} \O \L{labeloffset}
  \O \L{linecap} \O \L{linejoin} \O \L{miterlimit} \O \L{month}%
     \O \L{pausing} \O \L{prologues} \O \L{showstopping} \O \L{time}
  \O \L{tracingoutput} \O \L{tracingcapsules} \O \L{tracingchoices}%
     \O \L{tracingcommands} \O \L{tracingequations}
  \O \L{tracinglostchars} \L{tracingmacros} \O \L{tracingonline}%
     \O \L{tracingrestores} \L{tracingspecs}
  \O \L{tracingstats} \O \L{tracingtitles} \L{truecorners}%
     \O \L{warningcheck} \O \L{year}
  \O \S{symbolic token defined by \L{newinternal}}
\StopSyntax

\StartSyntax
\S{pseudo function}
  \M \L {min}          \L{(} \S{expression list}         \L{)}
  \O \L {max}          \L{(} \S{expression list}         \L{)}
  \O \L {incr}         \L{(} \S{numeric variable}        \L{)}
  \O \L {decr}         \L{(} \S{numeric variable}        \L{)}
  \O \L {dashpattern}  \L{(} \S{on/off list}             \L{)}
  \O \L {interpath}    \L{(} \S{numeric expression}      \L{,}%
                             \S{path expression}         \L{,}%
                             \S{path expression}         \L{)}
  \O \L {buildcycle}   \L{(} \S{path expression list}    \L{)}
  \O \L {thelabel}           \S{label suffix}%
                       \L{(} \S{expression}              \L{,}%
                             \S{pair expression}         \L{)}
  \O \FL{thefreelabel} \L{(} \S{expression}              \L{,}%
                             \S{pair expression}         \L{,}%
                             \S{pair expression}         \L{)}
  \O \FL{anglebetween} \L{(} \S{path expression}         \L{,}%
                             \S{path expression}         \L{,}%
                             \S{expression}              \L{)}
  \O \FL{pointarrow}   \L{(} \S{path expression}         \L{,}%
                            \FS{numeric or pair primary} \L{,}%
                             \S{numeric expression}      \L{,}%
                             \S{numeric expression}      \L{)}
  \O \FL{leftarrow}    \L{(} \S{path expression}         \L{,}%
                            \FS{numeric or pair primary} \L{,}%
                             \S{numeric expression}      \L{)}
  \O \FL{centerarrow}  \L{(} \S{path expression}         \L{,}%
                            \FS{numeric or pair primary} \L{,}%
                             \S{numeric expression}      \L{)}
  \O \FL{rightarrow}   \L{(} \S{path expression}         \L{,}%
                            \FS{numeric or pair primary} \L{,}%
                             \S{numeric expression}      \L{)}
  \O \FL{paired}       \L{(} \S{numeric or pair}         \L{)}
  \O \FL{tripled}      \L{(} \S{numeric or color}        \L{)}
  \O \FL{remappedcolor}\L{(} \S{color expression}        \L{)}
\StopSyntax

\StartSyntax
\S{path expression list}
  \M \S{path expression}
  \O \S{path expression list} \L{,} \S{path expression}
\StopSyntax

\StartSyntax
\S{on/off list}
  \M \S{on/off list} \S{on/off clause}
  \O \S{on/off clause}
\StopSyntax

\StartSyntax
\S{on/off clause}
  \M \L{on} \S{numeric tertiary}
  \O \L{off} \S{numeric tertiary}
\StopSyntax

\StartSyntax
\S{boolean expression} \M \S{expression}
\S{color expression}   \M \S{expression}
\S{numeric atom}       \M \S{atom}
\S{numeric expression} \M \S{expression}
\S{numeric primary}    \M \S{primary}
\S{numeric tertiary}   \M \S{tertiary}
\S{numeric variable}   \M \S{variable} \O \S{internal variable}
\S{pair expression}    \M \S{expression}
\S{pair primary}       \M \S{primary}
\S{path expression}    \M \S{expression}
\S{path subexpression} \M \S{subexpression}
\S{pen expression}     \M \S{expression}
\S{picture expression} \M \S{expression}
\S{picture variable}   \M \S{variable}
\S{string expression}  \M \S{expression}
\S{suffix parameter}   \M \S{parameter}
\S{transform primary}  \M \S{primary}
\StopSyntax

\StartSyntax
\S{program}
  \M \S{statement list} \L{end}
\StopSyntax

\StartSyntax
\S{statement list}
  \M \S{empty}
  \O \S{statement list} \L{;} \S{statement}
\StopSyntax

\StartSyntax
\S{statement}
  \M \S{empty}
  \O \S{equation}
  \O \S{assignment}
  \O \S{declaration}
  \O \S{macro definition}
  \O \S{compound}
  \O \S{pseudo procedure}
  \O \S{command}
\StopSyntax

\StartSyntax
\S{compound}
  \M \L{begingroup} \S{statement list} \L{endgroup}
  \O \L{beginfig}   \L{(} \S{numeric expression} \L{)} \L{;} \S{statement list} \S{;} \L{endfig}
\StopSyntax

\StartSyntax
\S{equation}
  \M \S{expression} \L{=} \S{right-hand side}
\StopSyntax

\StartSyntax
\S{assignment}
  \M \S{variable}          \L{:=} \S{right-hand side}
  \O \S{internal variable} \L{:=} \S{right-hand side}
\StopSyntax

\StartSyntax
\S{right-and side}
  \M \S{expression}
  \O \S{equation}
  \O \S{assignment}
\StopSyntax

\StartSyntax
\S{declaration}
  \M \S{type} \S{declaration list}
\StopSyntax

\StartSyntax
\S{declaration list}
  \M \S{generic variable}
  \O \S{declaration list} \L{,} \S{generic variable}
\StopSyntax

\StartSyntax
\S{generic variable}
  \M \S{Symbolic token} \S{generic suffix}
\StopSyntax

\StartSyntax
\S{generic suffix}
  \M \S{empty}
  \O \S{generic suffix} \S{tag}
  \O \S{generic suffix} \L{[]}
\StopSyntax

\StartSyntax
\S{macro de nition}
  \M \S{macro heading} \L{=} \S{replacement text} \L{enddef}
\StopSyntax

\StartSyntax
\S{macro heading}
  \M \L{def}        \S{Symbolic token} \S{delimited part} \S{undelimited part}
  \O \L{vardef}     \S{generic variable} \S{delimited part} \S{undelimited part}
  \O \L{vardef}     \S{generic variable} \L{@#} \S{delimited part} \S{undelimited part}
  \O \S{binary def} \S{parameter} \S {symbolic token} \S{parameter}
\StopSyntax

\StartSyntax
\S{delimited part}
  \M \S{empty}
  \O \S{delimited part} \L{(} \S{parameter type} \S{parameter tokens} \L{)}
\StopSyntax

\StartSyntax
\S{parameter type}
  \M \L{expr}
  \O \L{suffix}
  \O \L{text}
\StopSyntax

\StartSyntax
\S{parameter tokens}
  \M \S{parameter}
  \O \S{parameter tokens} \L{,} \S{parameter}
\StopSyntax

\StartSyntax
\S{parameter}
  \M \S{Symbolic token}
\StopSyntax

\StartSyntax
\S{undelimited part}
  \M \S{empty}
  \O \S{parameter type} \S{parameter}
  \O \S{precedence level} \S{parameter}
  \O \L{expr} \S{parameter} \L{of} \S{parameter}
\StopSyntax

\StartSyntax
\S{precedence level}
  \M \L{primary}
  \O \L{secondary}
  \O \L{tertiary}
\StopSyntax

\StartSyntax
\S{binary def}
  \M \S{primarydef}
  \O \S{secondarydef}
  \O \S{tertiarydef}
\StopSyntax

\StartSyntax
\S{pseudo procedure}
  \M \L {drawoptions}  \L{(} \S{option list} \L{)}
  \O \L {label}        \S{label suffix} \L{(} \S{expression} \L{,} \S{pair expression} \L{)}
  \O \L {dotlabel}     \S{label suffix} \L{(} \S{expression} \L{,} \S{pair expression} \L{)}
  \O \L {labels}       \S{label suffix} \L{(} \S{point number list} \L{)}
  \O \L {dotlabels}    \S{label suffix} \L{(} \S{point number list} \L{)}
  \O \FL{textext}      \S{label suffix} \L{(} \S{expression} \L{)}
  \O \FL{freelabel}    \L{(} \S{expression} \L{,} \S{pair expression} \L{,} \S{pair expression} \L{)}
  \O \FL{freedotlabel} \L{(} \S{expression} \L{,} \S{pair expression} \L{,} \S{pair expression} \L{)}
  \O \FL{remapcolor}   \L{(} \S{color expression} \L{,} \S{color expression} \L{)}
  \O \FL{resetcolormap}
  \O \FL{recolor}      \S{picture expression}
\StopSyntax

\StartSyntax
\S{point number list}
  \M \S{suffix} \O \S{point number list} \L{,} \S{suffix}
\StopSyntax

\StartSyntax
\S{label suffix}
  \M \S{empty}
  \O \L{lft} \O \L{rt}\O \L{top} \O \L{bot} \O \L{ulft} \O \L{urt}%
     \O \L{llft} \O \L{lrt} \O \FL{raw} \O \FL{origin}
\StopSyntax

\StartSyntax
\S{command}
  \M \L{clip}        \S{picture variable} \L{to} \S{path expression}
  \O \L{interim}     \S{internal variable} \L{:=} \S{right-hand side}
  \O \L{let}         \S{symbolic token} \L{=} \S{symbolic token}
  \O \L{newinternal} \S{symbolic token list}
  \O \L{pickup}      \S{expression}
  \O \L{randomseed}  \L{:=} \S{numeric expression}
  \O \L{save}        \S{symbolic token list}
  \O \L{setbounds}   \S{picture variable} \L{to} \S{path expression}
  \O \L{shipout}     \S{picture expression}
  \O \L{special}     \S{string expression}
  \O \S{addto command}
  \O \S{drawing command}
  \O \S{font metric command}
  \O \S{show command}
  \O \S{tracing command}
  \O \L{mpxbreak}
  \O \L{verbatimtex} \S{typesetting command} \L{etex}
\StopSyntax

\StartSyntax
\S{show command}
  \M \L{show}             \S{expression list}
  \O \L{showvariable}     \S{symbolic token list}
  \O \L{showtoken}        \S{symbolic token list}
  \O \L{showdependencies}
\StopSyntax

\StartSyntax
\S{symbolic token list}
  \M \S{symbolic token}
  \O \S{symbolic token} \L{,} \S{symbolic token list}
\StopSyntax

\StartSyntax
\S{expression list}
  \M \S{expression}
  \O \S{expression list} \L{,} \S{expression}
\StopSyntax

\StartSyntax
\S{addto command}
  \M \L{addto} \S{picture variable} \L{also}       \S{picture expression} \S{option list}
  \O \L{addto} \S{picture variable} \L{contour}    \S{path expression} \S{option list}
  \O \L{addto} \S{picture variable} \L{doublepath} \S{path expression} \S{option list}
\StopSyntax

\StartSyntax
\S{option list}
  \M \S{empty}
  \O \S{drawing option} \S{option list}
\StopSyntax

\StartSyntax
\S{drawing option}
  \M \L {withcolor} \S{color expression}
  \O \L {withpen}   \S{pen expression}
  \O \L {dashed}    \S{picture expression}
  \O \FL{withshade} \S{numeric expression}
\StopSyntax

\StartSyntax
\S{drawing command}
  \M \L{draw}      \S{picture expression} \S{option list}
  \O \S{fill type} \S{path expression}    \S{option list}
\StopSyntax

\StartSyntax
\S{fill type}
  \M \L {fill} \O \L {unfill} \O \FL{refill}
  \O \L {draw} \O \L {undraw} \O \FL{redraw}
  \O \L {filldraw} \O \FL{drawfill} \O \L {unfilldraw}
  \O \L {drawarrow} \O \L {drawdblarrow}
  \O \L {cutdraw}
\StopSyntax

\StartSyntax
\S{tracing command}
  \M \L{tracingall}
  \O \L{loggingall}
  \O \L{tracingnone}
\StopSyntax

\StartSyntax
\S{if test}
  \M \L{if} \S{boolean expression} \L{:} \S{balanced tokens} \S{alternatives} \L{fi}
\StopSyntax

\StartSyntax
\S{alternatives}
  \M \S{empty}
  \O \L{else} \L{:} \S{balanced tokens}
  \O \L{elseif} \S{boolean expression} \S{:} \S{balanced tokens} \S{alternatives}
\StopSyntax

\StartSyntax
\S{loop}
  \M \S{loop header} \L{:} \S{loop text} \L{endfor}
\StopSyntax

\StartSyntax
\S{loop header}
  \M \L{for} \S{symbolic token} \L{=} \S{progression}
  \O \L{for} \S{symbolic token} \L{=} \S{for list}
  \O \L{for} \S{symbolic token} \L{within} \S{picture expression}
  \O \L{forsuffixes} \S{symbolic token} \L{=} \S{suffix list}
  \O \L{forever}
\StopSyntax

\StartSyntax
\S{progression}
  \M \S{numeric expression} \L{upto} \S{numeric expression}
  \O \S{numeric expression} \L{downto} \S{numeric expression}
  \O \S{numeric expression} \L{step} \S{numeric expression} \L{until} \S{numeric expression}
\StopSyntax

\StartSyntax
\S{for list}
  \M \S{expression}
  \O \S{for list} \L{,} \S{expression}
\StopSyntax

\StartSyntax
\S{suffix list}
  \M \S{suffix}
  \O \S{suffix list} \L{,} \S{suffix}
\StopSyntax

\stop

\section {Left overs}

There are a few more concepts and commands available in
\METAFUN, like color remapping, shading and graphic
inclusion. Because they have their own small syntax world,
we present them here.

You may consider shades to be internally represented by a
hidden datastructure. The end user has access to a shade by
means of a pointer, expressed in a numeric.

\start \switchtobodyfont[small]

\StartSyntax
\S{pseudo procedure}
  \M \FL{linear\_shade}%
      \L{(} \S{path expression}  \L{,} \S{numeric expression}%
      \L{,} \S{color expression} \L{,} \S{color expression} \L{)}
  \O \FL{circular\_shade}%
      \L{(} \S{path expression}  \L{,} \S{numeric expression}%
      \L{,} \S{color expression} \L{,} \S{color expression} \L{)}
\StopSyntax

\StartSyntax
\S{pseudo function}
  \M \FL{define\_linear\_shade}%
      \L{(} \S{pair  expr} \L{,} \S{pair    expr}%
      \L{,} \S{color expr} \L{,} \S{color   expr} \L{)}
  \O \FL{define\_circular\_shade}%
      \L{(} \S{pair  expr} \L{,} \S{pair    expr}%
      \L{,} \S{path  expr} \L{,} \S{path    expr}%
      \L{,} \S{color expr} \L{,} \S{color   expr} \L{)}
  \O \FL{predefined\_linear\_shade}%
      \L{(} \S{path  expr} \L{,} \S{numeric expr}%
      \L{,} \S{color expr} \L{,} \S{color   expr} \L{)}
  \O \FL{predefined\_circular\_shade}%
      \L{(} \S{path  expr} \L{,} \S{numeric expr}%
      \L{,} \S{color expr} \L{,} \S{color   expr} \L{)}
\StopSyntax

\stop

External figures are just files, so the string passed as
first argument needs to be a valid filename. Additionally,
they need to be given dimensions.

\start \switchtobodyfont[small]

\StartSyntax
\S{pseudo procedure}
  \M \FL{externalfigure} \S{string expression} \S{transformer}
\StopSyntax

\stop

An external \METAPOST\ graphic can be loaded by filename and
figure number. The normal transformations can be applied.

\start \switchtobodyfont[small]

\StartSyntax
\S{pseudo procedure}
  \M \FL{loadfigure} \S{string expression} \FS{figure number} \S{transformer}
\StopSyntax

\StartSyntax
\FS{figure number}
  \M \L{number} \S{numeric expression}
\StopSyntax

\stop

A graphic text is (normally) an outline representation of a
snippet of text typeset by \TEX. This procedure has a couple
of dedicated options.

\start \switchtobodyfont[small]

\StartSyntax
\S{pseudo procedure}
  \M \FL{graphictext} \S{string expression} \S{transformer} \FS{text option list}
  \O \FL{regraphictext} \S{transformer} \FS{text option list}
\StopSyntax

\StartSyntax
\FS{text option list}
  \M \S{empty}
  \O \FS{text drawing option} \FS{text option list}
\StopSyntax

\StartSyntax
\FS{text drawing option}
  \M \S{drawing option}
  \O \FL{reversefill}
  \O \FL{outlinefill}
  \O \FL{withdrawcolor} \S{color expression}
  \O \FL{withfillcolor} \S{color expression}
\StopSyntax

\StartSyntax
\S{pseudo procedure}
  \M \FL{resetgraphictextdirective}
  \O \FL{graphictextdirective} \S {string expression}
\StopSyntax

\StartSyntax
\S{internal variable}
  \M \FL{graphictextformat}
\StopSyntax

\stop

\stopcomponent
