Class Ifcsname

  extended byde.dante.extex.interpreter.type.AbstractCode
      extended byde.dante.extex.interpreter.primitives.conditional.AbstractIf
          extended byde.dante.extex.interpreter.primitives.conditional.Ifcsname
All Implemented Interfaces:
Code, ExpandableCode, Localizable,

public class Ifcsname
extends AbstractIf

This class provides an implementation for the primitive \ifcsname.

The Primitive \ifcsname

The primitive \ifcsname checks if a certain control sequence is defined. For this purpose it collects tokens in the same way as \csname does until \endcsname is encountered. It does not define the control sequence if it is not defined.


The formal description of this primitive is the following:
      → \ifcsname ... \endcsname ⟨true text⟩ \fi
       |  \ifcsname ... \endcsname ⟨true text⟩ \else ⟨false text⟩ \fi  


     \ifcsname def\endcsname ok\fi  

$Revision: 1.4 $
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
Constructor Summary
Ifcsname(java.lang.String name)
          Creates a new object.
Method Summary
protected  boolean conditional(Context context, TokenSource source, Typesetter typesetter)
          This method computes the boolean value of the conditional.
Methods inherited from class de.dante.extex.interpreter.primitives.conditional.AbstractIf
execute, expand, getMyLocalizer, isIf, skipToElseOrFi
Methods inherited from class de.dante.extex.interpreter.type.AbstractCode
enableLocalization, getLocalizer, getName, isOuter, printable, printableControlSequence, readResolve, setName, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values
Constructor Detail


public Ifcsname(java.lang.String name)
Creates a new object.

name - the name for debugging
Method Detail


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
context - the interpreter context
source - the source for new tokens
typesetter - the typesetter
the boolean value
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)