org.extex.scanner.type.token
Interface TokenVisitor<RET_TYPE,ARG_TYPE>

Type Parameters:
RET_TYPE - the return type
ARG_TYPE - the argument type
All Known Implementing Classes:
Max, Moritz, StringSource

public interface TokenVisitor<RET_TYPE,ARG_TYPE>

This interface describes the capabilities for a visitor class on the token types. This interface is used to implement the visitor pattern.

Version:
$Revision$
Author:
Gerd Neugebauer

Method Summary
 RET_TYPE visitActive(ActiveCharacterToken token, ARG_TYPE arg)
          This visit method is invoked on an active token.
 RET_TYPE visitCr(CrToken token, ARG_TYPE arg)
          This visit method is invoked on a cr token.
 RET_TYPE visitEscape(ControlSequenceToken token, ARG_TYPE arg)
          This visit method is invoked on an escape token.
 RET_TYPE visitLeftBrace(LeftBraceToken token, ARG_TYPE arg)
          This visit method is invoked on a left brace token.
 RET_TYPE visitLetter(LetterToken token, ARG_TYPE arg)
          This visit method is invoked on a letter token.
 RET_TYPE visitMacroParam(MacroParamToken token, ARG_TYPE arg)
          This visit method is invoked on a macro parameter token.
 RET_TYPE visitMathShift(MathShiftToken token, ARG_TYPE arg)
          This visit method is invoked on a math shift token.
 RET_TYPE visitOther(OtherToken token, ARG_TYPE arg)
          This visit method is invoked on an other token.
 RET_TYPE visitRightBrace(RightBraceToken token, ARG_TYPE arg)
          This visit method is invoked on a right brace token.
 RET_TYPE visitSpace(SpaceToken token, ARG_TYPE arg)
          This visit method is invoked on a space token.
 RET_TYPE visitSubMark(SubMarkToken token, ARG_TYPE arg)
          This visit method is invoked on a sub mark token.
 RET_TYPE visitSupMark(SupMarkToken token, ARG_TYPE arg)
          This visit method is invoked on a sup mark token.
 RET_TYPE visitTabMark(TabMarkToken token, ARG_TYPE arg)
          This visit method is invoked on a tab mark token.
 

Method Detail

visitActive

RET_TYPE visitActive(ActiveCharacterToken token,
                     ARG_TYPE arg)
                     throws java.lang.Exception
This visit method is invoked on an active token. In TeX this is e.g. ~.

Parameters:
token - the active token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitCr

RET_TYPE visitCr(CrToken token,
                 ARG_TYPE arg)
                 throws java.lang.Exception
This visit method is invoked on a cr token.

Parameters:
token - the cr token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitEscape

RET_TYPE visitEscape(ControlSequenceToken token,
                     ARG_TYPE arg)
                     throws java.lang.Exception
This visit method is invoked on an escape token. In TeX this normally means a control sequence.

Parameters:
token - the control sequence token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitLeftBrace

RET_TYPE visitLeftBrace(LeftBraceToken token,
                        ARG_TYPE arg)
                        throws java.lang.Exception
This visit method is invoked on a left brace token.

Parameters:
token - the left brace token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitLetter

RET_TYPE visitLetter(LetterToken token,
                     ARG_TYPE arg)
                     throws java.lang.Exception
This visit method is invoked on a letter token.

Parameters:
token - the letter token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitMacroParam

RET_TYPE visitMacroParam(MacroParamToken token,
                         ARG_TYPE arg)
                         throws java.lang.Exception
This visit method is invoked on a macro parameter token. In TeX this normally is a #.

Parameters:
token - the macro param token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitMathShift

RET_TYPE visitMathShift(MathShiftToken token,
                        ARG_TYPE arg)
                        throws java.lang.Exception
This visit method is invoked on a math shift token. In TeX this normally is a $.

Parameters:
token - the math shift token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitOther

RET_TYPE visitOther(OtherToken token,
                    ARG_TYPE arg)
                    throws java.lang.Exception
This visit method is invoked on an other token.

Parameters:
token - the other token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitRightBrace

RET_TYPE visitRightBrace(RightBraceToken token,
                         ARG_TYPE arg)
                         throws java.lang.Exception
This visit method is invoked on a right brace token.

Parameters:
token - the right brace token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitSpace

RET_TYPE visitSpace(SpaceToken token,
                    ARG_TYPE arg)
                    throws java.lang.Exception
This visit method is invoked on a space token.

Parameters:
token - the space token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitSubMark

RET_TYPE visitSubMark(SubMarkToken token,
                      ARG_TYPE arg)
                      throws java.lang.Exception
This visit method is invoked on a sub mark token. In TeX this normally is a _.

Parameters:
token - the sub mark token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitSupMark

RET_TYPE visitSupMark(SupMarkToken token,
                      ARG_TYPE arg)
                      throws java.lang.Exception
This visit method is invoked on a sup mark token. In TeX this normally is a ^.

Parameters:
token - the sup mark token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error

visitTabMark

RET_TYPE visitTabMark(TabMarkToken token,
                      ARG_TYPE arg)
                      throws java.lang.Exception
This visit method is invoked on a tab mark token. In TeX this normally is a &.

Parameters:
token - the tab mark token to visit
arg - the first argument to pass
Returns:
some value
Throws:
java.lang.Exception - in case of an error