org.extex.unit.omega.math
Class AbstractOmegaMathCode

java.lang.Object
  extended by org.extex.interpreter.type.AbstractCode
      extended by org.extex.unit.tex.math.AbstractMathCode
          extended by org.extex.unit.omega.math.AbstractOmegaMathCode
All Implemented Interfaces:
java.io.Serializable, Code
Direct Known Subclasses:
Omathaccent, Omathchar, OmegaMathcharCode

public abstract class AbstractOmegaMathCode
extends AbstractMathCode

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

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

Field Summary
 
Fields inherited from class org.extex.unit.tex.math.AbstractMathCode
serialVersionUID
 
Constructor Summary
AbstractOmegaMathCode(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
 

Constructor Detail

AbstractOmegaMathCode

public AbstractOmegaMathCode(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