% LAST EDIT: Wed Sep  4 18:11:19 1996 by Peter Pepper (basti!pepper) 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% A LaTeX2e style for TeXing programs
%
% by P. Pepper
%
% (Note: This package is almost completely written in TeX!)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{opal2x}[1996/03/19 TU Berlin program package (v 0.1)]
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                  %
% Options
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\newif\if@AmsWanted
\newif\if@SuppressSymbols
%
\DeclareOption{ams}{\PassOptionsToPackage{ams}{symbols}}
\DeclareOption{suppress}{\PassOptionsToPackage{suppress}{symbols}}
\ProcessOptions
\relax
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Load other packages
%
\RequirePackage{basicprog}
\RequirePackage{symbols}
\RequirePackage{scanner}
%
%     +-------------------------------------------------------+
%     | Used variables from "basicprog.sty":                  |
%     |     \@TeXCmnt                                         |
%     |     \@CmntSymb                                        |
%     |                                                       |
%     | Redefined variables from "basicprog.sty":             |
%     |     \@Cmnt                                            |
%     |                                                       |
%     +-------------------------------------------------------+
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                  %
% Options (none available)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                             %
%     +-------------------------------------------------------+
%     | Interface: The following macros from "basicprog.sty"  |
%     |            are redefined                              |
%     |                                                       |
%     |            \KeyWord                                   |
%     |            \@CommentSymb                              |
%     |            \@Comment                                  |
%     |                                                       |
%     +-------------------------------------------------------+
%                                                             %
\def\KeyWord#1{\textsc{\lowercase{#1}}}%    % default         %
\def\@CommentSymb{\texttt{--}}%                               %
\def\@Comment#1{\textit{#1}}%                                 %
%                                                             %
%     +-------------------------------------------------------+
%     | Interface: The following macros from "scanner.sty"    |
%     |            are redefined                              |
%     |                                                       |
%     |            \DigitFont                                 |
%     |            \IdentifierFont                            |
%     |                                                       |
%     +-------------------------------------------------------+
%                                                             %
\DigitFont{tt}%         %
\IdentifierFont{tt}%    %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%  Miscellaneous
%
\DefLanguage{Opal}                                 %
%                                                  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% The main environments: "opal" and "embeddedopal"
%% ---------------------
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                  %
\newenvironment{opal}{%                            % LaTeX!
   \bgroup%                                        %
   \Opal@NormalSymbols%                            %
   \OpalPrelude%                                   %
   \begin{program}%                                %
   }{%                                             %
   \end{program}%                                  %
   \egroup%                                        %
   }%                                              %
%                                                  %
\def\@EmbeddedProgramPrelude{%                     %
   \Opal@NormalSymbols%                            %
   }%                                              %
\def\OpalPrelude{\relax}%                          %
%                                                  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Special symbols
%%                
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                  %
\def\Opal@NormalSymbols{%                          %
  \catcode`\_=12%                                  %
  \catcode`\^=12%                                  %
  \catcode`\#=12%                                  %
  \catcode`\&=12%                                  %
  \catcode`\%=12%                                  %
  \catcode`\@=11%                                  %
  \@DefNormSymb%                                   %
  \def\Backslash{\texttt{\@Backslash}}             %
}%                                                 %
{
  \catcode`\#=12
  \catcode`\&=12
  \catcode`\%=12
  \gdef\@DefNormSymb{
    \SetSymbol{#}{\mathop{\@TxtIde{\@Hashmark}}}
    \SetSymbol{&}{\mathbin{\@TxtIde{\@Ampersand}}}
    \SetSymbol{%}{\mathbin{\@TxtIde{\@Percent}}}
    \SetSymbol{@}{\@TxtIde{\@At}}
    }
}
%                                                  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% OPAL keywords and special symbols
%%                
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\SetSymbol{--}{\UaCmnt}
\SetSymbol{==}{~==~}
%
\TopKeyWord{EXTERNAL}
\TopKeyWord{IMPLEMENTATION}
\TopKeyWord{INTERFACE}
\TopKeyWord{INTERNAL}
\TopKeyWord{MODULE}
\TopKeyWord{SIGNATURE}
\TopKeyWord{SPECIFICATION}
\TopKeyWord{STRUCTURE}
\TopKeyWord{THEORY}
%
\MainKeyWord{ASSERT}
\MainKeyWord{AXM}
\MainKeyWord{DATA}
\MainKeyWord{DEF}
\MainKeyWord{FUN}
\MainKeyWord{IMPORT}
\MainKeyWord{INHERIT}
\MainKeyWord{LAW}
\MainKeyWord{PRED}
\MainKeyWord{REALIZES}
\MainKeyWord{REQUIRE}
\MainKeyWord{SORT}
\MainKeyWord{SPC}
\MainKeyWord{SPEC}
\MainKeyWord{THM}
\MainKeyWord{TYPE}
%
\FollowKeyWord[1em]{COMPLETELY}
\FollowKeyWord{ONLY}
%
\BeginKeyWord{LET}
%
\IfLikeKeyWord{IF}
\IfLikeKeyWord[1em]{OTHERWISE}
%                                                   %
\ThenLikeKeyWord{THEN}
\ThenLikeKeyWord{PRE}
\ThenLikeKeyWord{POST}
%
\ElseLikeKeyWord{ELSE}
%
\EndKeyWord{FI}
%
\PlainKeyWord{ALL}
\PlainKeyWord{AND}
\PlainKeyWord{ANDIF}
\PlainKeyWord{ANY}
\PlainKeyWord{AS}
\PlainKeyWord{DERIVE}
\PlainKeyWord{DFD}
\PlainKeyWord{DISCRIMINATORS}
\PlainKeyWord{EX}
\PlainKeyWord{FIX}
\PlainKeyWord{IMPLIES}
\PlainKeyWord{IN}
\PlainKeyWord{INJECTIONS}
\PlainKeyWord{LAZY}
\PlainKeyWord{NOT}
\PlainKeyWord{LEFTASSOC}
\PlainKeyWord{OR}
\PlainKeyWord{ORIF}
\PlainKeyWord{PRIORITY}
\PlainKeyWord{PROPERTIES}
\PlainKeyWord{RIGHTASSOC}
\PlainKeyWord{SELECTORS}
\PlainKeyWord{THE}
\PlainKeyWord{UNIQ}
\PlainKeyWord{WHERE}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Finally: Set special symbols
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%\SetAllSymbols
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End of file `opal2x.sty'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
