some rules on syntax

This commit is contained in:
Alain Emilia Anna Zscheile 2024-07-18 15:54:18 +02:00
parent 2a1b1a2ba9
commit 0efe793c3e

View file

@ -19,6 +19,21 @@
\begin{document}
\maketitle
\section{Syntax}
\subsection{Lexing}
Comments start with \verb,(*, and end with \verb,*),. They can be nested.
Strings start with \verb,", and end with \verb,",. They can contain evaluatable expressions in \verb,{, \verb,}, brackets.
Thus strings get split into multiple tokens (\texttt{<string\_start> <string>$^?$ <tokens...> <string>$^?$ <string\_end>}).
For these two features, the lexer contains stack handling. Whitespace separated tokens.
\begin{tabular}{cc}
Token & rule \\
Integer & \texttt{[1-9][0-9]$^+$|0x[0-9a-fA-F]$^+$} \\
Identifier & Unicode-XID (\texttt{<XID\_start><XID\_continue>$^*$}) \\
\end{tabular}
\section{Types}
\[