%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% heparse.sty
% ArabTeX
% Modifications for Hebrew mode
% 10.07.1994
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (c) Klaus Lagally
%     Institut fuer Informatik
%     Universitaet Stuttgart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% dynamic definitions for Hebrew
{\catcode `\ =9 \catcode `\^^M=9 \catcode `\^^I=9
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef \def@hebvoc {% define vowel parsing routines for Hebrew
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%% short vowels

\def \sv@a ##1{% short a: patach
\test@meteg ##1\add@fatha \put@syl \next }

\def \sv@e ##1{% short e: segol
\test@meteg ##1\add@zwarakay \put@syl \next }

\def \sv@i ##1{% short i: chireq breve
\test@meteg ##1\add@kasra \put@syl \next }

\def \sv@o ##1{% short o: qames-chatuph
\test@meteg ##1\add@ammad \put@syl \next }

\def \sv@u ##1{% short u: qibbus
\test@meteg ##1\add@damma \put@syl \next }

%%%%%%%%%%%%%%%%%%%%%%%%%% long vowels, defective writing

\def \sv@A ##1{% long a: qames breve
\test@meteg ##1\add@fathaspec \put@syl \next }

\sv@def \a@a {\sv@A }% qames

\sv@def \a@i {\sv@i }% chireq breve

\sv@def \a@j {\sv@shewa }% explicit shewa 

\sv@def \a@o {\sv@cholem }% short o: cholem breve

\sv@def \a@u {\sv@u }% qibbus

%%%%%%%%%%%%%%%%%%%%%%%%%% special vowels

\sv@def \a@A {\sv@chatef@patach }

\sv@def \a@E {\sv@sere }% long e: sere breve

\sv@def \a@I {\sv@chatef@segol }

\sv@def \a@O {\sv@chatef@qames }

%%%%%%%%%%%%%%%%%%%%%%%%%% long vowels, plene

\def \sv@Y ##1{% long a: qames longum
\test@meteg ##1\add@fathaspec \put@syl \put@con a\put@syl \next }

\def \sv@E ##1{% long e: sere longum
\test@meteg ##1\add@kasraspec \put@syl \put@con y\put@syl \next }

\def \sv@I ##1{% long i: chireq longum
\test@meteg ##1\add@kasra \put@syl \put@con y\put@syl \next }

\def \sv@O ##1{% long o: cholem longum
\put@syl \put@con w\test@meteg ##1\add@hamza \put@syl \next }	% rdot

\def \sv@U ##1{% long u: sureq
\put@syl \put@con w\test@meteg ##1\add@shadda \put@syl \next }	% sureq

%%%%%%%%%%%%%%%%%%%%%%%%%% hamza handling

\def \syl@hamza ##1{% non-initial hamza, context #1'
\put@con a\syl@voctest }

\let \syl@hamzabeg \syl@hamza

\def \syl@test@voc ##1{% vowel or shewa ?
\ifch@lem \ch@lemfalse \add@hamza \fi		% rdot
\xpa \ifx \csname sv@\string ##1\endcsname \relax 
	\def \next {\syl@shewa ##1}% non-vowel follows
\else \def \next {\syl@voc ##1}% test for vowel
\fi \next }

\def \add@wasla {\ifv@c \last@voc \c@wasla \fi }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}% end of dynamic definitions for Hebrew
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% static definitions for Hebrew
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newif \ifp@tach	\newif \ifch@lem

\def \test@meteg #1{\def \next {\syl@con #1}% 
\ifx #1|\def \next {\syl@con }\add@madda \else	% meteg 
\ifx #1\a@A\def \next {\syl@con }\p@tachtrue
\fi\fi }

\def \sv@sere #1{% long e: sere breve
\test@meteg #1\add@kasraspec \put@syl \next }
						
\def \sv@cholem #1{% short o: cholem breve
\def \next {\syl@con #1}% 
\ifx #1|\def \next {\syl@con }\add@madda 	% meteg 
\fi 
\ifx #1\a@s \ch@lemtrue \else
\ifx #1a\ch@lemtrue \else
\ifx #1A\ch@lemtrue \else
\if \the\last@con \a@s \else
\ifx #1x\else        
	\add@wasla				% ldot
\fi\fi\fi\fi\fi \put@syl \next }

\def \sv@chatef@patach #1{% 
\test@meteg #1\add@fathatan \put@syl \next }	% chatef patach

\def \sv@chatef@segol #1{% 
\test@meteg #1\add@kasratan \put@syl \next }	% chatef segol

\def \sv@chatef@qames #1{% 
\test@meteg #1\add@dammatan \put@syl \next }	% chatef qames 

\def \syl@shewa #1{% put shewa if appropriate
\ifp@tach \add@fatha \p@tachfalse \else
\if \the\last@con B\else
\ifx #1<\add@shewa \else 
\ifcat #1<\add@shewa \else 
\add@sukun 					% shewa
\fi\fi\fi\fi \put@syl \syl@con #1}

\def \add@shewa {% shewa on final kaf
\if \the\last@con k\last@voc \c@sukun \else		
\if \the\last@con R\last@voc \c@sukun 
\fi\fi }

\def \sv@shewa {% put shewa unconditionally
\ifv@c \last@voc \c@sukun \fi \put@syl \syl@con }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endinput



