de.dante.extex.interpreter.primitives.conditional
Class Ifx
java.lang.Object
de.dante.extex.interpreter.type.AbstractCode
de.dante.extex.interpreter.primitives.conditional.AbstractIf
de.dante.extex.interpreter.primitives.conditional.Ifx
- All Implemented Interfaces:
- Code, ExpandableCode, Localizable, java.io.Serializable
- public class Ifx
- extends AbstractIf
This class provides an implementation for the primitive \ifx
.
The Primitive \ifx
The primitive \ifx compares the following two tokens. If the
following tokens are no macros then the comparison succeeds if they agree
in category code and character.
If the argument tokens are control sequences or active characters then the
assigned values are compared. If the arguments are bound to macros then
the comparison succeeds if the status of outer and long are
the same, the patterns are the same and the body texts are equivalent
TODO missing documentation
Syntax
The formal description of this primitive is the following:
〈ifx〉
→ \ifx 〈token1〉 〈token2〉; 〈true text〉 \fi
| \ifx 〈token1〉 〈token2〉 〈true text〉 \else 〈false text〉 \fi
Examples
\ifx\a\x ok \fi
- Version:
- $Revision: 1.28 $
- Author:
- Gerd Neugebauer
- See Also:
- Serialized Form
Field Summary |
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
Constructor Summary |
Ifx(java.lang.String name)
Creates a new object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
serialVersionUID
protected static final long serialVersionUID
- The constant serialVersionUID contains the id for serialization.
- See Also:
- Constant Field Values
Ifx
public Ifx(java.lang.String name)
- Creates a new object.
- Parameters:
name
- the name for debugging
conditional
protected boolean conditional(Context context,
TokenSource source,
Typesetter typesetter)
throws InterpreterException
- Description copied from class:
AbstractIf
- This method computes the boolean value of the conditional.
If the result is
true
then the then branch is expanded and
the else branch is skipped. Otherwise the then branch is skipped and the
else branch is expanded.
- Specified by:
conditional
in class AbstractIf
- Parameters:
context
- the interpreter contextsource
- the source for new tokenstypesetter
- the typesetter
- Returns:
- the boolean value
- Throws:
InterpreterException
- in case of en error- See Also:
AbstractIf.conditional(
de.dante.extex.interpreter.context.Context,
de.dante.extex.interpreter.TokenSource,
de.dante.extex.typesetter.Typesetter)