mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
131 lines
3.5 KiB
TeX
131 lines
3.5 KiB
TeX
\documentclass{book}
|
|
|
|
\usepackage{amssymb, amsmath}
|
|
\usepackage{alltt}
|
|
\usepackage{pslatex}
|
|
\usepackage{epigraph}
|
|
\usepackage{verbatim}
|
|
\usepackage{latexsym}
|
|
\usepackage{array}
|
|
\usepackage{comment}
|
|
\usepackage{makeidx}
|
|
\usepackage{listings}
|
|
\usepackage{indentfirst}
|
|
\usepackage{verbatim}
|
|
\usepackage{color}
|
|
\usepackage{url}
|
|
\usepackage{xspace}
|
|
\usepackage{hyperref}
|
|
\usepackage{stmaryrd}
|
|
\usepackage{amsmath, amsthm, amssymb}
|
|
\usepackage{graphicx}
|
|
\usepackage{euscript}
|
|
\usepackage{mathtools}
|
|
\usepackage{mathrsfs}
|
|
\usepackage{multirow,bigdelim}
|
|
\usepackage{subcaption}
|
|
\usepackage{placeins}
|
|
\usepackage{xspace}
|
|
\usepackage{ostap}
|
|
\usepackage{bm}
|
|
|
|
\makeatletter
|
|
|
|
\makeatother
|
|
|
|
\definecolor{shadecolor}{gray}{1.00}
|
|
\definecolor{darkgray}{gray}{0.30}
|
|
|
|
\def\transarrow{\xrightarrow}
|
|
\newcommand{\setarrow}[1]{\def\transarrow{#1}}
|
|
|
|
\def\padding{\phantom{X}}
|
|
\newcommand{\setpadding}[1]{\def\padding{#1}}
|
|
|
|
\def\subarrow{}
|
|
\newcommand{\setsubarrow}[1]{\def\subarrow{#1}}
|
|
|
|
\newcommand{\trule}[2]{\frac{#1}{#2}}
|
|
\newcommand{\crule}[3]{\frac{#1}{#2},\;{#3}}
|
|
\newcommand{\withenv}[2]{{#1}\vdash{#2}}
|
|
\newcommand{\trans}[3]{{#1}\transarrow{\padding{\textstyle #2}\padding}\subarrow{#3}}
|
|
\newcommand{\ctrans}[4]{{#1}\transarrow{\padding#2\padding}\subarrow{#3},\;{#4}}
|
|
\newcommand{\llang}[1]{\mbox{\lstinline[mathescape]|#1|}}
|
|
\newcommand{\pair}[2]{\inbr{{#1}\mid{#2}}}
|
|
\newcommand{\inbr}[1]{\left<{#1}\right>}
|
|
\newcommand{\highlight}[1]{\color{red}{#1}}
|
|
\newcommand{\ruleno}[1]{\eqno[\scriptsize\textsc{#1}]}
|
|
\newcommand{\rulename}[1]{\textsc{#1}}
|
|
\newcommand{\inmath}[1]{\mbox{$#1$}}
|
|
\newcommand{\lfp}[1]{fix_{#1}}
|
|
\newcommand{\gfp}[1]{Fix_{#1}}
|
|
\newcommand{\vsep}{\vspace{-2mm}}
|
|
\newcommand{\supp}[1]{\scriptsize{#1}}
|
|
\newcommand{\sembr}[1]{\llbracket{#1}\rrbracket}
|
|
\newcommand{\cd}[1]{\texttt{#1}}
|
|
\newcommand{\free}[1]{\boxed{#1}}
|
|
\newcommand{\binds}{\;\mapsto\;}
|
|
\newcommand{\dbi}[1]{\mbox{\bf{#1}}}
|
|
\newcommand{\sv}[1]{\mbox{\textbf{#1}}}
|
|
\newcommand{\bnd}[2]{{#1}\mkern-9mu\binds\mkern-9mu{#2}}
|
|
\newtheorem{lemma}{Lemma}
|
|
\newtheorem{theorem}{Theorem}
|
|
\newcommand{\meta}[1]{{\mathcal{#1}}}
|
|
\renewcommand{\emptyset}{\varnothing}
|
|
\newcommand{\dom}[1]{\mathtt{dom}\;{#1}}
|
|
\newcommand{\primi}[2]{\mathbf{#1}\;{#2}}
|
|
\newcommand{\lama}{$\lambda\mbox{\textsc{Algol}}$\xspace}
|
|
%\newcommand{\sial}{S\textit{\lower -.5ex\hbox{I}\kern -.1667em\lower .5ex\hbox {A}}\kern -.125emL\@\xspace}
|
|
\definecolor{light-gray}{gray}{0.90}
|
|
\newcommand{\graybox}[1]{\colorbox{light-gray}{#1}}
|
|
|
|
\newcommand{\defterm}[1]{\textit{#1}}
|
|
\newcommand{\nonterm}[1]{\textit{#1}}
|
|
\newcommand{\term}[1]{\graybox{#1}}
|
|
\newcommand{\token}[1]{\textsc{#1}}
|
|
\newcommand{\alt}{\s\mid\s}
|
|
\newcommand{\s}{\:\:}
|
|
|
|
\lstdefinelanguage{alm}{
|
|
keywords={skip,if,then,else,elif,fi,while,do,od,repeat,until,for,fun,local,public,return,import,length,
|
|
string,case,of,esac,when,boxed,unboxed,string,sexp,array,infix,infixl,infixr,at,before,after,true,false},
|
|
sensitive=true,
|
|
basicstyle=\small,
|
|
%commentstyle=\scriptsize\rmfamily,
|
|
keywordstyle=\ttfamily\bfseries,
|
|
identifierstyle=\ttfamily,
|
|
basewidth={0.5em,0.5em},
|
|
columns=fixed,
|
|
fontadjust=true,
|
|
literate={->}{{$\to$}}3,
|
|
morecomment=[s][\ttfamily]{(*}{*)},
|
|
morecomment=[l][\ttfamily]{--}
|
|
}
|
|
|
|
\lstset{
|
|
mathescape=true,
|
|
basicstyle=\small,
|
|
identifierstyle=\ttfamily,
|
|
keywordstyle=\bfseries,
|
|
commentstyle=\scriptsize\rmfamily,
|
|
basewidth={0.5em,0.5em},
|
|
fontadjust=true,
|
|
escapechar=!,
|
|
language=alm
|
|
}
|
|
|
|
\sloppy
|
|
|
|
\title{\lama Language Definition}
|
|
|
|
\author{Dmitry Boulytchev}
|
|
|
|
\begin{document}
|
|
|
|
\maketitle
|
|
|
|
\input{01.introduction}
|
|
\input{02.abstract_syntax_and_semantics}
|
|
\input{03.concrete_syntax}
|
|
|
|
\end{document}
|