%%%%%%%%%%%%%%%%%%%%%%%%%%% asmo449.sty %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% asmo449.sty
% Scanner for ASMO 449 Code (ISO 9036)
% to install it, include it as a LaTeX style option "asmo449"
% with Plain TeX, say "\input asmo449.sty"
% to activate it, say "\setcode {asmo449}" or "\setcode {iso9036}"
% 10.07.94
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (c) Klaus Lagally
%     Institut fuer Informatik
%     Universitaet Stuttgart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ifx \asmoatcode \undefined \else \expandafter \endinput
\fi % load only once

\chardef \asmoatcode = \catcode`\@  \catcode`\@ = 11

\version = {3.02}  		\datum = {10.07.94}
\message {\the\version }	\message {(\the\datum )}

\edef \arabtexconfig {\arabtexconfig 
asmo449.sty \the\version \space (\the\datum) }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% dynamic definitions for Arabic
{\catcode `\ =9 \catcode `\^^M=9 \catcode `\^^I=9
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef \setasmo@codes {% activate and change some codes
\globaldefs=1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \sc@A {Q|}  \def \sc@B {QA}  \def \sc@C {Qa}  \def \sc@D {Qw}
\def \sc@E {Qi}  \def \sc@F {Qy}  \def \sc@G {A}   \def \sc@H {b}
\def \sc@I {T}   \def \sc@J {t}   \def \sc@K {C}   \def \sc@L {G}
\def \sc@M {H}   \def \sc@N {X}   \def \sc@O {d}   \def \sc@P {F}
\def \sc@Q {r}   \def \sc@R {z}   \def \sc@S {s}   \def \sc@T {x}
\def \sc@U {S}   \def \sc@V {D}   \def \sc@W {V}   \def \sc@X {Z}
\def \sc@Y {P}   \def \sc@Z {R}
\def \sc@a {f}   \def \sc@b {q}   \def \sc@c {k}   \def \sc@d {l}
\def \sc@e {m}   \def \sc@f {n}   \def \sc@g {h}   \def \sc@h {w}
\def \sc@i {Y}   \def \sc@j {y}   \def \sc@k {"aN} \def \sc@l {"uN}
\def \sc@m {"iN} \def \sc@n {"a}  \def \sc@o {"u}  \def \sc@p {"i}
\def \sc@q {@}   \def \sc@r {""}  \def \sc@s {@}   \def \sc@t {@}
\def \sc@u {@}   \def \sc@v {@}   \def \sc@w {@}   \def \sc@x {@}
\def \sc@y {@}   \def \sc@z {@}	  \def \sc@@ {@}
\a@first = {"`}
\globaldefs=0 }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}% end of dynamic definitions for Arabic
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \asmo@beg #1#2{% start ASMO 449 scanner
  \def \next {\asmo@word #1#2}%
\ifx #1>\let \next \relax \else
\ifx #1G\def \next {\asmo@alif #2}\else
\ifx #1"\def \next {\asmo@lquote #2}\else
\ifcat \noexpand #1a\else
\ifx #2>\global \a@tokens ={#1}\def \next {\asmo@word #2}% x>
\fi\fi\fi\fi\fi \next }

\def \asmo@word #1#2{% transform input into internal notation
     \def \next {\asmo@word #2}%
\ifx #1>\let \next \relax \else
	\ifx #2q\def \next {\asmo@word #1}\else
	\ifx #2s\def \next {\asmo@word #1k}\else
	\ifx #2t\def \next {\asmo@word #1l}\else
	\ifx #2u\def \next {\asmo@word #1m}\else
	\ifx #2v\def \next {\asmo@word #1n}\else
	\ifx #2w\def \next {\asmo@word #1o}\else
	\ifx #2x\def \next {\asmo@word #1p}\else
	\ifx #1#2\def \next {\asmo@word -#2}\else
	\fi\fi\fi\fi\fi\fi\fi
\fi
\ifx #1`\def \next {\asmo@tatweel #2}\else
\ifx #1-\def \next {\asmo@minus #2}\else
\ifx #1"\def \next {\asmo@rquote #2}\else
\ifcat \noexpand #1a\edef \sc@char {\csname sc@#1\endcsname }%
   	\sc@put
\else \def \sc@char {#1}\sc@put
\fi\fi\fi\fi\fi \next }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \asmo@alif {% alif at the beginning of a word
\def \sc@char {a}\sc@put \asmo@word }

\def \asmo@minus {% hyphen between words
\def \sc@char {-}\sc@put \asmo@beg }

\def \asmo@lquote {% left quote
\def \sc@char {`}\sc@put \asmo@beg }

\def \asmo@tatweel {% code `
\def \sc@char {B}\sc@put \asmo@word }

\def \asmo@rquote {% right quote
\def \sc@char {'}\sc@put \asmo@word }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \a@asmo {asmo449}        \def \a@ASMO {ASMO449}
\def \iso@asmo {iso9036}      \let \asmo@setcode \setcode

\def \set@asmo {% substitute ASMO 449 scanner
\let \vocalize \relax   \let \fullvocalize \relax
\let \sc@beg \asmo@beg 	\let \sc@word \asmo@word  
\let \a@scan \a@@scan   \setasmo@codes	\novocalize   
\h@mzafalse  \iz@fetfalse
\message {input coding set to ASMO 449 (ISO 9036) conventions}}

\def \setcode #1{\def \next {#1}% switch input coding
\ifx \next \a@asmo \set@asmo \else
\ifx \next \a@ASMO \set@asmo \else
\ifx \next \iso@asmo \set@asmo \else
	\asmo@setcode {#1}
\fi\fi\fi }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\setcode {asmo449}

\message {scanner for code `ASMO449' installed.}

\catcode `\@ = \asmoatcode
\endinput
%%%%%%%%%%%%%%%%%%%%%%%% EOF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

