%!TEX root = manual.tex
%

\usepackage{times}
%-------------------------
% the following magic makes the tt font in math mode be the same as the
% normal tt font (i.e., Courier)
%
\SetMathAlphabet{\mathtt}{normal}{OT1}{pcr}{n}{n}
\SetMathAlphabet{\mathtt}{bold}{OT1}{pcr}{bx}{n}
%-------------------------

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{hyperref}

\newcommand{\asdl}{\textbf{ASDL}}
\newcommand{\asdlgen}{\texttt{asdlGen}}

\newcommand{\chapref}[1]{\hyperref[#1]{Chapter~\ref{#1}}}
\newcommand{\secref}[1]{\hyperref[#1]{Section~\ref{#1}}}

\usepackage{color}
\definecolor{Red}{rgb}{0.9,0.0,0.0}
\definecolor{DarkBlue}{rgb}{0.0,0.0,0.75}
\definecolor{Purple}{rgb}{0.5,0.0,0.4}
\definecolor{DarkGreen}{rgb}{0.0,0.5,0.0}
\newcommand{\cdColor}{DarkBlue}
\newcommand{\kwColor}{Purple}
\newcommand{\dirColor}{Purple}
\newcommand{\strColor}{DarkGreen}
\newcommand{\comColor}{Red}

\usepackage{listings}

\lstdefinelanguage{SML}{%
  morekeywords={%
    abstype, and, andalso, as, case, datatype, do, else, end, eqtype, exception,%
    fn, fun, functor, handle, if, in, include, infix, infixr, let, local, nonfix,%
    of, op, open, orelse, raise, rec, sharing, sig, signature, struct, structure,%
    then, type, val, where, while, with, withtype%
  },%
  otherkeywords={[,],\{,\},\,,:,...,_,|,=,=>,->,\#,:>},
  sensitive,%
  alsoletter={_},
  morecomment=[n]{(*}{*)},%
  morestring=[d]",%
}[keywords,comments,strings]%

\lstdefinelanguage{ASDL}{%
  morekeywords={alias,attributes,imports,module,primitive,view},%
  otherkeywords={[,],\{,\},\,,:,<=,\%\%,?,*,!,|},
  sensitive,%
  alsoletter={_},
  morecomment=[l]{--},%
}[keywords,comments]%

\lstset{
  basicstyle=\footnotesize\ttfamily\color{\cdColor},
  keywordstyle=\color{\kwColor}\bfseries,
  commentstyle=\color{\comColor}\itshape,
  showstringspaces=false,
  language=ASDL
}

\usepackage{syntax}
\makeatletter
\renewcommand{\ulitleft}{\normalfont\ttfamily\color{\kwColor}\bfseries\syn@ttspace\frenchspacing}
\renewcommand{\ulitright}{}
\makeatother
