org.extex.unit.base
Class Relax

java.lang.Object
  extended by org.extex.interpreter.type.AbstractCode
      extended by org.extex.unit.base.Relax
All Implemented Interfaces:
java.io.Serializable, Code

public class Relax
extends AbstractCode

This class provides an implementation for the primitive \relax.

The Primitive \relax

This primitive simply does nothing. It acts as a no-op for the TeX macro language. \relax is not even expandable. in certain circumstances it might be treated as if it where expandable and the expansion is empty.

\relax sometimes acts as terminating token. For instance when a number is parsed \relax terminates the parsing even if the following token is a digit.

Syntax

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

Examples

    \relax  
    \the\count123\relax456  

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

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
Relax(CodeToken token)
          Creates a new object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          All instances of this class are treated as equal.
 void execute(Flags prefix, Context context, TokenSource source, Typesetter typesetter)
          This method takes the first token and executes it. The result is placed on the stack. This operation might have side effects. To execute a token it might be necessary to consume further tokens.
 int hashCode()
          All instances of this class are treated as equal.
 
Methods inherited from class org.extex.interpreter.type.AbstractCode
getLocalizer, getName, getToken, isIf, isOuter, readResolve, toString, toText, toText
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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

Relax

public Relax(CodeToken token)
Creates a new object.

Parameters:
token - the initial token for the primitive
Method Detail

execute

public void execute(Flags prefix,
                    Context context,
                    TokenSource source,
                    Typesetter typesetter)
             throws HelpingException,
                    TypesetterException
This method takes the first token and executes it. The result is placed on the stack. This operation might have side effects. To execute a token it might be necessary to consume further tokens.

Specified by:
execute in interface Code
Overrides:
execute in class AbstractCode
Parameters:
prefix - the prefix controlling the execution
context - the interpreter context
source - the token source
typesetter - the typesetter
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter
See Also:
Code.execute( org.extex.interpreter.Flags, org.extex.interpreter.context.Context, org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)

equals

public boolean equals(java.lang.Object obj)
All instances of this class are treated as equal. This is needed for the comparison (\ifx) of tokens defined via \csname.

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
All instances of this class are treated as equal. Thus all receive the same hash code.

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()