1%%%%%%%%%%%%%%%%%%%%%%%%%%% gedalin.sty %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2% gedalin.sty
3% Scanner for Michael Gedalin's special Hebrew encoding
4% to activate it, say "\setcode {gedalin}"
5% presupposes the packages "arabtex.sty" and "hebtex.sty"
6% 10.09.2001
7%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8% (c) Klaus Lagally
9%     Institut fuer Informatik
10%     Universitaet Stuttgart
11%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12
13\ifx \gedatcode \undefined \else \xpa \endinput \fi
14
15\chardef \gedatcode = \catcode`\@  \catcode`\@ = 11
16
17\a@ident {gedalin.sty}
18{3.10 scanner for Michael Gedalin's Hebrew encoding} {10.09.2001}
19
20%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21% dynamic definitions for Hebrew
22{\catcode `\^ 7 \catcode `\ =9 \catcode `\^^M=9 \catcode `\^^I=9
23%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24\gdef \setged@codes {\seta@codes % activate and change some codes
25\globaldefs=1
26%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27%
28\def \sc@a {\n@xp\a@S}	\def \sc@b {n} 		\def \sc@c {b}
29\def \sc@d {g}		\def \sc@e {q}   	\def \sc@f {k}
30\def \sc@g {P}   	\def \sc@h {y}		\def \sc@i {\n@xp\a@N}
31\def \sc@j {X} 		\def \sc@k {l} 		\def \sc@l {\n@xp\a@K}
32\def \sc@m {S}   	\def \sc@n {m}   	\def \sc@o {\n@xp\a@M}
33\def \sc@p {p}		\def \sc@q {/}	 	\def \sc@r {r}
34\def \sc@s {d}   	\def \sc@t {Q}		\def \sc@u {w}
35\def \sc@v {h}   	\def \sc@w {,}   	\def \sc@x {s}
36\def \sc@y {C}   	\def \sc@z {z}
37%
38\a@digits = {0123456789}	\a@paren  = {()[]}	\a@first = {;,.}
39%\iffalse
40\tc@def \a@M {\act@cd \hc@mf }				% mem sofit
41\tc@def \a@N {\act@cd \hc@nf }				% nun sofit
42\tc@def \a@K {\act@cd \hc@kf }				% kaf sofit
43\tc@def \a@P {\act@cd \hc@ff }				% peh sofit
44\tc@def \a@Z {\act@cd \hc@sf }				% tsadeh sofit
45%\fi
46\globaldefs=0
47}
48%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49}% end of dynamic definitions for Hebrew
50%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51
52\def \ged@scan #1>{% modified scanner call: token sequence -> \a@tokens
53\iftest@scan \ifshow \else \lowercase {\a@verb #1>}\fi
54\tracingmacros = 1 \fi
55\global\def \a@rest {}\global\a@tokens = {}%
56\novocalize \sc@beg #1\@ \@@
57\iftest@scan \tracingmacros = 0 \xpa \a@verb \xpa (\the\a@tokens )>\fi }
58
59\def \ged@word #1#2{% transform input into internal notation
60\@ssimfalse \def \next {\ged@word #2}%
61\ifx #1\@ \let \next \relax \else
62\ifcat \nxp #1\relax \def \next {\ged@cs #1#2}\else	% control sequence
63	\ifx #1-\def \sc@char {B}\sc@put \else
64	\ifx #1/\def \sc@char {.}\sc@put \else
65	\ifx #1`\def \sc@char {;}\sc@put \else
66	\ifx #1w\def \sc@char {,}\sc@put \else
67	\ifx #1q\def \sc@char {/}\sc@put \else
68	\ifx #1|\def \sc@char {\nxp \a@U}\sc@put \else
69	\ifx #1;\def \sc@char {\nxp \a@P \nxp \a@U}\sc@put \else
70	\ifx #1,\def \sc@char {t\nxp \a@U}\sc@put \else
71	\ifx #1.\def \sc@char {\nxp \a@Z \nxp \a@U}\sc@put \else
72	\ifcat \noexpand #1-\def \sc@char {#1}\sc@put \else
73	\ifcat \noexpand #1a\edef \sc@char {\csname sc@#1\endcsname }\else
74		\def \sc@char {#1}%
75	\fi \sc@put
76\fi\fi\fi\fi\fi\fi
77\fi\fi\fi\fi\fi\fi \next }
78
79\def \g@d@cs #1#2{% test word end
80\def \sc@char {#1}\sc@put
81\ifx #2\@ \def \next {\sc@endscan #2}\else
82\ifcat -\nxp #2 \def \next {\ged@word #2}\else
83\def \next {\sc@back #2}\fi \fi \next }
84
85\def \ged@cs #1#2{% control sequence within a word; push back?
86\xpa \ifx #1\closegeresh \def \next {\g@d@cs {\nxp \lq }#2}\else
87\xpa \ifx #1\closequote \def \next {\g@d@cs {`}#2}\else
88	\def \next {\sc@back #1#2}%
89\fi\fi \next }
90
91%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92
93\def \ged@select {% select the new scanner
94%\heb@catcodes			% inside hebtex.sty; to make sure
95\let \sc@beg \ged@word 		\let \sc@word \ged@word
96\let \sc@back \sc@@back		\let \sc@endscan \sc@@endscan
97\setged@codes			\global\let \a@scan \ged@scan
98\let \h@put@end \h@put@mid
99\a@message {input encoding set to Michael Gedalin's Hebrew encoding}}
100
101\xpa \def \xpa \sc@table \xpa {\sc@table % add the encoding
102gedalin\ged@select }
103
104%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105
106\a@message {scanner for Michael Gedalin's Hebrew encoding installed.}
107\setcode{gedalin}
108
109\catcode `\@ = \gedatcode
110\endinput
111%%%%%%%%%%%%%%%%%%%%%%%% EOF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
112
113