de.dante.extex.interpreter.type
Class AbstractAssignment

java.lang.Object
  extended byde.dante.extex.interpreter.type.AbstractCode
      extended byde.dante.extex.interpreter.type.AbstractAssignment
All Implemented Interfaces:
Code, Localizable, java.io.Serializable
Direct Known Subclasses:
AbstractColor, AbstractCount, AbstractDimen, AbstractMuskip, AbstractSkip, AbstractToks, Advance, Batchmode, BoolDef, CatcodePrimitive, Chardef, Colordef, Def, Delcode, Divide, Errorstopmode, Export, Fontdimen, FontPrimitive, HashToksDef, Hyphenchar, Integer, IntegerCode, Interactionmode, JavaDef, Lccode, Let, Mathchardef, MathcodePrimitive, Multiply, MuskipParameter, NamedBool, NamedFont, NamedHashToks, NamedPair, NamedReal, NamedTransform, Namespace, NativeDef, Nonstopmode, Odelcode, Omathchardef, OmathcodePrimitive, PairDef, Prevdepth, Read, Readline, RealDef, Scaled, ScaledCode, Scrollmode, Sfcode, Skewchar, TransformDef, Uccode

public abstract class AbstractAssignment
extends AbstractCode

This is the base class for assignments. The assignments are implemented like any Code with the exception that the method assign is used instead of the method execute.

This abstract class takes care of the treatment of the \afterassign token and the \globaldefs declaration.

The Count Parameter \globaldefs

The count register \globaldefs contains the indicator that an assignment should be performed globally. If its value is greater than zero then all assignments are global. Otherwise the grouping is honored. In this sense setting \globaldefs to a positive value implicitly prefixes all assignments with \global.

Syntax

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

Examples

    \globaldefs=1  

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

Field Summary
 
Fields inherited from class de.dante.extex.interpreter.type.AbstractCode
serialVersionUID
 
Constructor Summary
AbstractAssignment(java.lang.String name)
          Creates a new object.
 
Method Summary
abstract  void assign(Flags prefix, Context context, TokenSource source, Typesetter typesetter)
          The method assign is the core of the functionality of execute().
 void execute(Flags prefix, Context context, TokenSource source, Typesetter typesetter)
          This method takes the first token and executes it.
 
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
 

Constructor Detail

AbstractAssignment

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

Parameters:
name - the name for debugging
Method Detail

assign

public abstract void assign(Flags prefix,
                            Context context,
                            TokenSource source,
                            Typesetter typesetter)
                     throws InterpreterException
The method assign is the core of the functionality of execute(). This method is preferable to execute() since the execute() method provided in this class takes care of \afterassignment and \globaldefs as well.

Parameters:
prefix - the prefix controlling the execution
context - the interpreter context
source - the token source
typesetter - the typesetter
Throws:
InterpreterException - in case of an error

execute

public final void execute(Flags prefix,
                          Context context,
                          TokenSource source,
                          Typesetter typesetter)
                   throws InterpreterException
Description copied from interface: Code
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
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)