|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.interpreter.type.AbstractCode
org.extex.unit.base.conditional.AbstractIf
org.extex.unit.tex.conditional.Ifx
public class Ifx
This class provides an implementation for the primitive
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
\ifx.
The Primitive \ifx
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
| Field Summary | |
|---|---|
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
| Constructor Summary | |
|---|---|
Ifx(CodeToken token)
Creates a new object. |
|
| Method Summary | |
|---|---|
boolean |
conditional(Context context,
TokenSource source,
Typesetter typesetter)
This method computes the boolean value of the conditional. |
| Methods inherited from class org.extex.unit.base.conditional.AbstractIf |
|---|
execute, expand, getMyLocalizer, isIf, skipToElseOrFi |
| Methods inherited from class org.extex.interpreter.type.AbstractCode |
|---|
getLocalizer, getName, getToken, isOuter, readResolve, toString, toText, toText |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final long serialVersionUID
| Constructor Detail |
|---|
public Ifx(CodeToken token)
token - the initial token for the primitive| Method Detail |
|---|
public boolean conditional(Context context,
TokenSource source,
Typesetter typesetter)
throws HelpingException
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.
conditional in class AbstractIfcontext - the interpreter contextsource - the source for new tokenstypesetter - the typesetter
HelpingException - in case of an errorAbstractIf.conditional(
org.extex.interpreter.context.Context,
org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||