de.dante.extex.interpreter.primitives.conditional
Class Else
java.lang.Object
de.dante.extex.interpreter.type.AbstractCode
de.dante.extex.interpreter.primitives.conditional.Else
- All Implemented Interfaces:
- Code, Localizable, java.io.Serializable
- public class Else
- extends AbstractCode
This class provides an implementation for the primitive \else
.
The Primitive \else
The primitive \else can appear in the context of a conditional.
It terminates the preceding branch and starts the next one.
The primitive \else can not be used alone. It always comes in
conjunction with a conditional. A isolated \else leads immediately
to an error.
Syntax
The formal description of this primitive is the following:
〈else〉
→ \else
Examples
\ifnum 1<2\else no\fi
Note:
This primitive is not expandable!
- Version:
- $Revision: 1.26 $
- Author:
- Gerd Neugebauer
- See Also:
- Serialized Form
Field Summary |
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
Constructor Summary |
Else(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
Else
public Else(java.lang.String name)
- Creates a new object.
- Parameters:
name
- the name for debugging
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 then branch is expanded. Thus the else branch
has to be skipped. Additionally 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)