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

java.lang.Object
  extended byde.dante.extex.interpreter.type.AbstractCode
      extended byde.dante.extex.interpreter.primitives.file.AbstractFileCode
          extended byde.dante.extex.interpreter.primitives.file.Input
All Implemented Interfaces:
Code, Configurable, Localizable, java.io.Serializable
Direct Known Subclasses:
InputFile

public class Input
extends AbstractFileCode

This class provides an implementation for the primitive \input. It uses the standard encoding (see token register \fileencoding and extex.encoding.

The Primitive \input

The primitive \input takes as argument one file name and opens this file for reading. The following tokens are taken from this input stream. Thus the effect is as if the file contents where copied at the place of the primitive.

If the file can not be opened for reading then an error is raised.

The primitive also makes provisions that the information in \inputfilename and \inputlineno are set properly.

Syntax

The formal description of this primitive is the following:
    ⟨input⟩
       → \input ⟨file name⟩ 

Examples

The traditional version of the file name parsing allows the following syntax:

    \input file.name  
If the parsing is not configured to be strict then the following syntax is allowed as well:
    \input{file.name}  

Version:
$Revision: 1.30 $
Author:
Gerd Neugebauer, Michael Niedermair
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Fields inherited from class de.dante.extex.interpreter.primitives.file.AbstractFileCode
MAX_IN_FILE_NO, MAX_OUT_FILE_NO
 
Constructor Summary
Input(java.lang.String name)
          Creates a new object.
 
Method Summary
 void execute(Flags prefix, Context context, TokenSource source, Typesetter typesetter)
          Scan the file name and put the file onto the stack of tokenizer streams.
 
Methods inherited from class de.dante.extex.interpreter.primitives.file.AbstractFileCode
configure, getEncoding, scanFileName, scanInFileKey, scanOutFileKey
 
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

Input

public Input(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
Scan the file name and put the file onto the stack of tokenizer streams.

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)