org.extex.unit.tex.math
Class AbstractTeXMathCode
java.lang.Object
org.extex.interpreter.type.AbstractCode
org.extex.unit.tex.math.AbstractMathCode
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
serialVersionUID
protected static final long serialVersionUID
- The constant serialVersionUID contains the id for
serialization.
- See Also:
- Constant Field Values
AbstractTeXMathCode
public AbstractTeXMathCode(CodeToken token)
- Creates a new object.
- Parameters:
token
- the initial token for the primitive
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 contextsource
- the source for new tokenstypesetter
- the typesetterprimitive
- 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