next up previous
Next: Tokens Up: No Title Previous: Regular Expressions in JLex

JLex Example: Expressions


\begin{program}
{\vem package}~expression;
\\ {\vem import}~jaco.framework.parse...
 ...0.5em]\%eofval\{
\\ ~~~~~~{\vem return}~mkToken(EOF);
\\ \%eofval\}\end{program}


\begin{program}
\%\{
\\ ~~~~~~~~{\vem static}~String~representation({\vem int}~t...
 ... return}~(''$<$unknown$\gt$'');
\\ ~~~~~~~~~~~~~~~~\}
\\ ~~~~~~~~\}\end{program}


\begin{program}
~~~~~~~~{\vem protected}~{\vem int}~position()~\{~~~~~~~~
\\ ~~~...
 ...~Symbol(token,~position(),~rposition(),~obj);
\\ ~~~~~~~~\}
\\ \%\}\end{program}





Christoph Zenger
3/23/2000