mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
27 lines
1.1 KiB
TeX
27 lines
1.1 KiB
TeX
% !TEX TS-program = pdflatex
|
|
% !TeX spellcheck = en_US
|
|
% !TEX root = lama-spec.tex
|
|
\FloatBarrier
|
|
|
|
\begin{figure}[t]
|
|
\[
|
|
\begin{array}{rcl}
|
|
\defterm{compilationUnit} & : & \nonterm{import}^\star\s\nonterm{scopeExpression}\\
|
|
\defterm{import} & : & \term{import}\s\token{UIDENT}\s\term{;}
|
|
\end{array}
|
|
\]
|
|
\caption{Compilation unit concrete syntax}
|
|
\label{compilation_unit}
|
|
\end{figure}
|
|
|
|
\section{Compilation Units}
|
|
\label{sec:compilation_units}
|
|
|
|
Compilation unit is a minimal structure recognized by the parser. An application can contain multiple units, compiled separately.
|
|
In order to use other units they have to be imported. In particular, the standard library is comprised of a number of precompiled units,
|
|
which can be imported by an end-user application.
|
|
|
|
The concrete syntax for compilation unit is shown in Fig.~\ref{compilation_unit}. Besides optional imports a unit must contain
|
|
a \nonterm{scopeExpression}, which may contain some definitions and computations. Note, a unit can not be empty. The computations described in
|
|
a unit are performed at the unit initialization time (see Chapter~\ref{sec:driver}).
|
|
|