de.dante.extex.interpreter.type.dimen.parser
Class LengthParser

java.lang.Object
  extended byde.dante.extex.interpreter.type.dimen.parser.LengthParser

public final class LengthParser
extends java.lang.Object

This class provides some static methods to parse an expression and return its value.

Version:
$Revision: 1.2 $
Author:
Gerd Neugebauer

Method Summary
static void evalTerm(Accumulator accumulator, Context context, TokenSource source, Typesetter typesetter)
          Evaluate a terminal.
static Dimen parse(Context context, TokenSource source, Typesetter typesetter)
          Creates a new object from a token stream.
static void register(java.lang.String name, Function function)
           
static void register(java.lang.String name, Function0 function)
           
static void register(java.lang.String name, Function1 function)
           
static void register(java.lang.String name, de.dante.extex.interpreter.type.dimen.parser.Function2 function)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

evalTerm

public static void evalTerm(Accumulator accumulator,
                            Context context,
                            TokenSource source,
                            Typesetter typesetter)
                     throws InterpreterException
Evaluate a terminal.

Parameters:
accumulator - the accumulator to receive the result
context - the interpreter context
source - the source for new tokens
typesetter - the typesetter
Throws:
InterpreterException - in case of an error

parse

public static Dimen parse(Context context,
                          TokenSource source,
                          Typesetter typesetter)
                   throws InterpreterException
Creates a new object from a token stream.

Parameters:
context - the interpreter context
source - the source for next tokens
typesetter - the typesetter
Returns:
a new instance with the value acquired
Throws:
InterpreterException - in case of an error

register

public static void register(java.lang.String name,
                            Function function)

register

public static void register(java.lang.String name,
                            Function0 function)

register

public static void register(java.lang.String name,
                            Function1 function)

register

public static void register(java.lang.String name,
                            de.dante.extex.interpreter.type.dimen.parser.Function2 function)