org.extex.unit.etex.register.count
Class Lastnodetype
java.lang.Object
org.extex.interpreter.type.AbstractCode
org.extex.unit.tex.register.count.AbstractReadonlyCount
org.extex.unit.etex.register.count.Lastnodetype
- All Implemented Interfaces:
- java.io.Serializable, CountConvertible, Code, Theable
public class Lastnodetype
- extends AbstractReadonlyCount
This class provides an implementation for the primitive
\lastnodetype.
The Primitive \lastnodetype
The primitive \lastnodetype inspects the last node in the
typesetter and returns a count value according to the node type found. The
following table shows the values returned:
| -1 | no node; i.e. the list is empty |
| 0 | char node |
| 1 | hlist node |
| 2 | vlist node |
| 3 | rule node |
| 4 | insertion node |
| 5 | mark node |
| 6 | adjust node |
| 7 | ligature node |
| 8 | discretionary node |
| 9 | whatsit node |
| 10 | math node |
| 11 | glue node |
| 12 | kern node |
| 13 | penalty node |
| 14 | unset node (not used in ExTeX) |
| 15 | math mode nodes |
Syntax
The formal description of this primitive is the following:
〈lastnodetype〉
→ \lastnodetype
Examples
\count42=\lastnodetype
Test\the\lastnodetype
- Version:
- $Revision: 4732 $
- Author:
- Gerd Neugebauer, Sebastian Waschik
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Lastnodetype
public Lastnodetype(CodeToken token)
- Creates a new object.
- Parameters:
token - the initial token for the primitive
convertCount
public long convertCount(Context context,
TokenSource source,
Typesetter typesetter)
throws HelpingException,
TypesetterException
- This method converts a register into a count. It might be necessary to
read further tokens to determine which value to use. For instance an
additional register number might be required. In this case the additional
arguments Context and TokenSource can be used.
- Parameters:
context - the interpreter contextsource - the source for new tokenstypesetter - the typesetter to use for conversion
- Returns:
- the converted value
- Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter- See Also:
CountConvertible.convertCount(
org.extex.interpreter.context.Context,
org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)