Commit 09c613f8 authored by snuverink_j's avatar snuverink_j
Browse files

clean format.tex

parent a32d869d
\input{header}
\chapter{Command Format}
\label{chp:format}
\index{Format!Commands}
\index{Command!Format|(}
All flavors of \textit{OPAL} using the same input language the \texttt{MAD} language. The language dialect here is
ajar to \texttt{MAD9}, for hard core \texttt{MAD}eight users there is a conversion guide.
ajar to \textit{MAD9}, for hard core \textit{MAD}eight users there is a conversion guide.
It is the first time that
It is the first time that
machines such as cyclotrons, proton and electron linacs can be described within the same language
in the same simulation framework.
\section{Statements and Comments}
......@@ -156,8 +154,8 @@ The following types of command attributes are available in \textit{OPAL}:
\item Range see~Section~\ref{arange},
\item Constraint see~Section~\ref{aconstraint},
\item Variable Reference see~Section~\ref{areference}
\item Regular expression see~Section~\ref{wildcard}\ifthenelse{\boolean{ShowMap}}{,
\item Token list see~Section~\ref{toklist}}{}.
\item Regular expression see~Section~\ref{wildcard}
\item Token list see~Section~\ref{toklist}.
\item Array see~Section~\ref{anarray} of
\begin{itemize}
\item Logical see~Section~\ref{logarray},
......@@ -189,13 +187,13 @@ An operand in a string can also use the
function \texttt{STRING} see~Table~\ref{stringfun}.
String values can occur in string arrays see~Section~\ref{anarray}.
\begin{table}[!htb] \footnotesize
\begin{table}[!htb]
\begin{center}
\caption{String Operator in \textit{OPAL}}
\label{tab:stroperator}
\begin{tabular}{|l|p{0.5\textwidth}|l|l|}
\hline
\tabhead{Operator & Meaning & result type & operand types}
\tabhead Operator & Meaning & result type & operand types \\
\hline
\texttt{X \& Y} & concatenate the strings \texttt{X} and \texttt{Y}.
String concatenations are always evaluated immediately when read. &
......@@ -211,7 +209,7 @@ String values can occur in string arrays see~Section~\ref{anarray}.
\label{tab:stringfun}
\begin{tabular}{|l|p{0.5\textwidth}|l|l|}
\hline
\tabhead{Function & Meaning & result type & argument type}
\tabhead{Function & Meaning & result type & argument type \\
\hline
\texttt{STRING(X)} &
return string representation of the value
......@@ -264,7 +262,7 @@ logical-expr ::= and-expr | logical-expr "||" and-expr
\label{tab:logoperator}
\begin{tabular}{|l|p{0.5\textwidth}|l|l|}
\hline
\tabhead{Operator & Meaning & result type & operand type}
\tabhead Operator & Meaning & result type & operand type \\
\hline
\texttt{X $<$ Y} & true, if \texttt{X} is less than \texttt{Y} &
logical &real,real \\
......@@ -370,7 +368,7 @@ acting on operands see~Section~\ref{operand}.
\label{tab:operator}
\begin{tabular}{|l|p{0.5\textwidth}|l|l|}
\hline
\tabhead{Operator & Meaning & result type & operand type(s)}
\tabhead Operator & Meaning & result type & operand type(s) \\
\hline
\multicolumn{4}{|c|}{\textbf{Real operators with one operand}}\\
\hline
......@@ -403,7 +401,7 @@ acting on operands see~Section~\ref{operand}.
\label{tab:realfun}
\begin{tabular}{|l|l|l|l|}
\hline
\tabhead{Function & Meaning & result type & argument type(s)}
\tabhead Function & Meaning & result type & argument type(s) \\
\hline
\multicolumn{4}{|c|}{\textbf{Real functions with no arguments}} \\
\hline%
......@@ -415,22 +413,6 @@ acting on operands see~Section~\ref{operand}.
real &- \\
\texttt{USER0()} & random number, user-defined distribution &
real &-
\ifthenelse{\boolean{ShowMap}}{\\
\texttt{SI()} &
arc length from start of ring to the entry of the current element.
This function is only available in the
\texttt{EALIGN} command see~Section~\ref{erroralign} &
real &- \\
\texttt{SC()} &
arc length from start of ring to the center of the current element.
This function is only available in the
\texttt{EALIGN} command see~Section~\ref{erroralign} &
real &- \\
\texttt{SO()} &
arc length from start of ring to the exit of current the element.
This function is only available in the
\texttt{EALIGN} command see~Section~\ref{erroralign} &
real &- }{}\\
\hline
\multicolumn{4}{|c|}{\textbf{Real functions with one argument}} \\
\hline
......@@ -505,7 +487,7 @@ acting on operands see~Section~\ref{operand}.
\label{tab:arrayfun}
\begin{tabular}{|l|p{0.45\textwidth}|l|l|}
\hline
\tabhead{Function & Meaning & result type & operand type}
\tabhead Function & Meaning & result type & operand type \\
\hline
\texttt{VMAX(X,Y)} &
return largest array component &real&real array\\
......@@ -563,7 +545,7 @@ simplify their repeated use in statements and expressions.
\label{tab:constant}
\begin{tabular}{|l|c|c|c|}
\hline
\tabhead{\textit{OPAL} name & Mathematical symbol & Value & Unit}
\tabhead \textit{OPAL} name & Mathematical symbol & Value & Unit \\
\hline
\texttt{PI} & $\pi$ & 3.1415926535898 & 1 \\
\texttt{TWOPI} & $2 \pi$ & 6.2831853071796 & 1 \\
......@@ -650,35 +632,6 @@ indicated when errors are generated.
Such an expression is known as a \textbf{deferred expression}.
Its value cannot occur as an operand in another expression.
\ifthenelse{\boolean{ShowMap}}{
\noindent Example:
\begin{verbatim}
ERROR:EALIGN,CLASS=QUADRUPOLE,DX=SIGMA*GAUSS();
\end{verbatim}
All elements in range are assigned independent random
displacements sampled from a Gaussian distribution
with standard deviation \texttt{SIGMA}.
The quantity \texttt{ERROR->DX} must not occur as an operand
in another expression.
\subsection{Table References}
\label{sec:acell}
Values can be extracted from a table with the syntax
\begin{verbatim}
table-name "@" place "->" column-name
\end{verbatim}
Here \texttt{table-name} denotes a table see~Chapter~\ref{tables},
\texttt{place} denotes a table row see~Section~\ref{aplace},
and \texttt{column-name} denotes the name of a column in the table.
\noindent Example:
\begin{verbatim}
TWISS@#E->BETX
\end{verbatim}
denotes the horizontal beta function at the end of table
\texttt{TWISS}.
}{}
\section{Element Selection}
\index{Selection Of Elements}
\index{Element!Selection}
......@@ -873,27 +826,6 @@ The two occurrences of \verb'.*' each stand for an arbitrary
number (including zero) of any character,
and the occurrence \verb'\.' stands for a literal period.
\ifthenelse{\boolean{ShowMap}}{
\section{Token List}
\label{sec:toklist}
\index{Token List}
In some special commands \texttt{LIST} see~Section~\ref{list} an attribute
cannot be parsed immediately, since some information may not yet be
available during parsing.
Such an attribute is entered as a ``token list'', and it is parsed
again when the information becomes available.
Token lists can occur in token list arrays see~Section~\ref{tokarray}.
This is not yet available in:
\texttt{DOPAL-t} and \texttt{DOPAL-cycl}.
\noindent Example:
\begin{verbatim}
LIST,COLUMN={X:12:6,Y:12:6};
\end{verbatim}
where \texttt{X:12:6} and \texttt{Y:12:6} are two token lists,
and \texttt{\{X:12:6,Y:12:6\}} is a token list array.
}{}
\section{Arrays}
\label{sec:anarray}
\index{Real!Array}
......@@ -986,7 +918,7 @@ array-expr ::= array-term |
\label{tab:compfun}
\begin{tabular}{|l|p{0.5\textwidth}|l|l|}
\hline
\tabhead{Function & Meaning & result type & argument type}
\tabhead Function & Meaning & result type & argument type \\
\hline
\texttt{TRUNC(X)} &
truncate \texttt{X} towards zero (discard fractional part) &
......@@ -1112,5 +1044,3 @@ Token list arrays are always lists of single token lists.
\end{verbatim}
\index{Command!Format|)}
\input{footer}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment