de.dante.extex.interpreter.primitives.math
Class AbstractTeXMathCode

java.lang.Object
  extended byde.dante.extex.interpreter.type.AbstractCode
      extended byde.dante.extex.interpreter.primitives.math.AbstractMathCode
          extended byde.dante.extex.interpreter.primitives.math.AbstractTeXMathCode
All Implemented Interfaces:
Code, Localizable, java.io.Serializable
Direct Known Subclasses:
Mathaccent, Mathchar, TeXMathcharCode

public abstract class AbstractTeXMathCode
extends AbstractMathCode

This is the base class for all math primitives using the TeX encoding. It tries to ensure that the primitive is invoked in math mode only.

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

Field Summary
 
Fields inherited from class de.dante.extex.interpreter.type.AbstractCode
serialVersionUID
 
Constructor Summary
AbstractTeXMathCode(java.lang.String name)
          Creates a new object.
 
Method Summary
static long mathCodeToLong(MathCode mc)
          Convert a MathCode to a number using the TeX encoding.
static MathCode parseMathCode(Context context, TokenSource source, Typesetter typesetter, java.lang.String primitive)
          Parse Math code according to TeX rules and extensions.
 
Methods inherited from class de.dante.extex.interpreter.primitives.math.AbstractMathCode
getListMaker
 
Methods inherited from class de.dante.extex.interpreter.type.AbstractCode
enableLocalization, execute, 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

AbstractTeXMathCode

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

Parameters:
name - the name for tracing and debugging
Method Detail

mathCodeToLong

public static long mathCodeToLong(MathCode mc)
                           throws InterpreterException
Convert a MathCode to a number using the TeX encoding.

Parameters:
mc - the math code
Returns:
a TeX-encoded math code
Throws:
InterpreterException - in case of an error

parseMathCode

public static MathCode parseMathCode(Context context,
                                     TokenSource source,
                                     Typesetter typesetter,
                                     java.lang.String primitive)
                              throws InterpreterException
Parse Math code according to TeX rules and extensions.

Parameters:
context - the interpreter context
source - the source for new tokens
typesetter - the typesetter
primitive - the name of the invoking primitive
Returns:
the MathCode
Throws:
InterpreterException - in case of an error