de.dante.extex.interpreter.primitives.conditional
Class Fi

java.lang.Object
  extended byde.dante.extex.interpreter.type.AbstractCode
      extended byde.dante.extex.interpreter.primitives.conditional.Fi
All Implemented Interfaces:
Code, ExpandableCode, Localizable, java.io.Serializable

public class Fi
extends AbstractCode
implements ExpandableCode

This class provides an implementation for the primitive \fi.

The Primitive \fi

This primitive indicates the end of an conditional. As such it can not appear alone but only in combination with a preceding \if*.

Syntax

The formal description of this primitive is the following:
    ⟨fi⟩
     → \fi  

Examples

    \fi  

Version:
$Revision: 1.21 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
Fi(java.lang.String name)
          Creates a new object.
 
Method Summary
 void execute(Flags prefix, Context context, TokenSource source, Typesetter typesetter)
          Executes the primitive.
 void expand(Flags prefix, Context context, TokenSource source, Typesetter typesetter)
          Expands the primitive.
 
Methods inherited from class de.dante.extex.interpreter.type.AbstractCode
enableLocalization, getLocalizer, getName, isIf, 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

serialVersionUID

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

See Also:
Constant Field Values
Constructor Detail

Fi

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

Parameters:
name - the name for debugging
Method Detail

execute

public void execute(Flags prefix,
                    Context context,
                    TokenSource source,
                    Typesetter typesetter)
             throws InterpreterException
Executes the primitive.

This primitive can only be seen when a conditional has been opened before for which the else branch is expanded. Thus only the conditional stack has to be updated. If the conditional stack is already empty then an exception is raised.

Specified by:
execute in interface Code
Overrides:
execute in class AbstractCode
Throws:
InterpreterException
See Also:
Code.execute( de.dante.extex.interpreter.Flags, de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.TokenSource, de.dante.extex.typesetter.Typesetter)

expand

public void expand(Flags prefix,
                   Context context,
                   TokenSource source,
                   Typesetter typesetter)
            throws InterpreterException
Expands the primitive.

This primitive can only be seen when a conditional has been opened before for which the else branch is expanded. Thus only the conditional stack has to be updated. If the conditional stack is already empty then an exception is raised.

Specified by:
expand in interface ExpandableCode
Parameters:
prefix - the prefix flags controlling the expansion
context - the interpreter context
source - the token source
typesetter - the typesetter
Throws:
InterpreterException - in case of an error
See Also:
ExpandableCode.expand( de.dante.extex.interpreter.Flags, de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.TokenSource, de.dante.extex.typesetter.Typesetter)