de.dante.extex.interpreter.primitives.file
Class Write

java.lang.Object
  extended byde.dante.extex.interpreter.type.AbstractCode
      extended byde.dante.extex.interpreter.primitives.file.Write
All Implemented Interfaces:
Code, Configurable, Localizable, LogEnabled, java.io.Serializable, TokensWriter

public class Write
extends AbstractCode
implements TokensWriter, LogEnabled, Configurable

This class provides an implementation for the primitive \write.

The Primitive \write

TODO missing documentation

Syntax

The formal description of this primitive is the following:
    ⟨write⟩
      → ⟨modifier⟩ \write ⟨outfile name⟩ ...

    ⟨modifier⟩
      →
       |  \immediate ⟨modifier⟩  

Examples

 \immediate\openout3= abc.def
 \write3{Hi there!}
 \closeout3 

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

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
Write(java.lang.String name)
          Creates a new object.
 
Method Summary
 void configure(Configuration config)
          Configure an object according to a given Configuration.
 void enableLogging(java.util.logging.Logger theLogger)
          Setter for the logger.
 void execute(Flags prefix, Context context, TokenSource source, Typesetter typesetter)
          This method takes the first token and executes it.
 void write(java.lang.String key, Tokens toks, Context context)
          Write some tokens to a write register.
 
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

Write

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

Parameters:
name - the name for debugging
Method Detail

configure

public void configure(Configuration config)
               throws ConfigurationException
Description copied from interface: Configurable
Configure an object according to a given Configuration.

Specified by:
configure in interface Configurable
Parameters:
config - the configuration object to consider
Throws:
ConfigurationException - in case that something went wrong
See Also:
Configurable.configure( de.dante.util.framework.configuration.Configuration)

enableLogging

public void enableLogging(java.util.logging.Logger theLogger)
Description copied from interface: LogEnabled
Setter for the logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
theLogger - the logger to use
See Also:
LogEnabled.enableLogging( java.util.logging.Logger)

execute

public 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)

write

public void write(java.lang.String key,
                  Tokens toks,
                  Context context)
           throws InterpreterException
Write some tokens to a write register.

Specified by:
write in interface TokensWriter
Parameters:
key - the name (number) of the write register
toks - the tokens to write
context - the processing context
Throws:
InterpreterException - in case of an error