Document expressions
This commit is contained in:
@@ -124,35 +124,3 @@ begin
|
||||
e := E.one
|
||||
end.
|
||||
\end{lstlisting}
|
||||
|
||||
\chapter{Type operations}
|
||||
|
||||
\chapter{Cast}
|
||||
|
||||
\begin{grammar}
|
||||
<cast> = `cast' `(' <expression> `:\@' <type> `)'.
|
||||
\end{grammar}
|
||||
|
||||
The type of an object can be reinterpreted with a cast expression: \\
|
||||
\verb|cast(object: Type)|.
|
||||
|
||||
\chapter{Traits}
|
||||
|
||||
\begin{grammar}
|
||||
<trait-identifier> = `#' <identifier>.
|
||||
|
||||
<trait> = <trait-identifier> `(' [<types>] `)'.
|
||||
\end{grammar}
|
||||
|
||||
Traits allow to query some information about the types, like their size or
|
||||
field offset or alignment. Calling a trait looks like a procedure call but
|
||||
traits names start with a \verb|#| and their arguments are type expressions and
|
||||
not value expressions.
|
||||
|
||||
Supported compiler traits:
|
||||
|
||||
\begin{itemize}
|
||||
\item \verb|#size(T)| queries type size.
|
||||
\item \verb|#align(T)| queries type alignment.
|
||||
\item \verb|#offset(T, F)| queries the offset of the field \verb|F| in the record \verb|T|.
|
||||
\end{itemize}
|
||||
|
||||
Reference in New Issue
Block a user