org.extex.unit.tex.math
Class AbstractTeXMathCode

java.lang.Object
  extended by org.extex.interpreter.type.AbstractCode
      extended by org.extex.unit.tex.math.AbstractMathCode
          extended by org.extex.unit.tex.math.AbstractTeXMathCode
All Implemented Interfaces:
java.io.Serializable, Code
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: 4770 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
AbstractTeXMathCode(CodeToken token)
          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, CodeToken primitive)
          Parse Math code according to TeX rules and extensions.
 
Methods inherited from class org.extex.unit.tex.math.AbstractMathCode
getListMaker
 
Methods inherited from class org.extex.interpreter.type.AbstractCode
execute, getLocalizer, getName, getToken, isIf, isOuter, readResolve, toString, toText, toText
 
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

AbstractTeXMathCode

public AbstractTeXMathCode(CodeToken token)
Creates a new object.

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

mathCodeToLong

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

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

parseMathCode

public static MathCode parseMathCode(Context context,
                                     TokenSource source,
                                     Typesetter typesetter,
                                     CodeToken primitive)
                              throws HelpingException,
                                     TypesetterException
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:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter