squiggle/spec/src/syntax.tex
2022-03-28 14:13:07 -04:00

45 lines
2.0 KiB
TeX

\documentclass[../main.tex]{subfiles}
\begin{document}
\section{Syntax}\label{section:syntax}
At a high level, we will first be slightly dishonest because the different types of distributions make the story more intricate. Details about assignment and arithmetic on floats will follow eventually, but I want to sketch out a theory of combining distributions, first.
\subsection{THE FOLLOWING IS HERE FOR TEMPLATE SO I DON'T FORGET HOW TO BNF IN LATEX. }
In regex notation, we provide the following means of describing literals as well as the specification of the constants T and F.
\begin{center}
\begin{tabular}{c c c}
\texttt{var} & ::= & [a-z][a-zA-Z0-9]* \\
\texttt{int} & ::= & "-"? [0-9]+ \\
\texttt{byte} & ::= & "0x" [0-9a-fA-F] \\
\texttt{bytestring} & ::= & "0x" [0-9a-fA-F]+ \\
\texttt{text} & ::= & <too tough to get latex to compile it lol> \\
\texttt{bool} & ::= & [TF] \\
\texttt{unit} & ::= & [()]
\end{tabular}
\end{center}
\label{tab:atomsregex}
\begin{grammar}
<builtin> ::=
"AddInteger" \alt "SubtractInteger" \alt "MultiplyInteger"
\alt "DivideInteger" \alt "QuotientInteger" \alt "RemainderInteger"
\alt "ModInteger" \alt "EqualsInteger" \alt "LessThanInteger"
\alt "LessThanEqualsInteger" \alt "AppendByteString"
\alt "ConsByteString" \alt "SliceByteString" \alt "LengthByteString"
\alt "IndexByteString" \alt "EqualsByteString" \alt "LessThanByteString"
\alt "LessThanEqualsByteString" \alt "Sha2_256" \alt "Sha3_256" \alt "Blake2b_256"
\alt "VerifySignature" \alt "AppendString" \alt "EqualsString"
\alt "EncodeUtf8" \alt "DecodeUtf8" \alt "IfThenElse" \alt "ChooseUnit"
\alt "MkCons" \alt "HeadList" \alt "TailList" \alt "NullList"
\alt "ChooseData" \alt "ConstrData" \alt "MapData" \alt "ListData"
\alt "IData" \alt "BData" \alt "UnConstrData" \alt "UnMapData"
\alt "EqualsData" \alt "MkPairData" \alt "MkNilData" \alt "MkNilPairData"
\end{grammar}
\end{document}