de.dante.extex.interpreter.expression
Interface ETypeParser

All Known Implementing Classes:
TBooleanParser, TCountParser, TDoubleParser, TGlueParser

public interface ETypeParser

This interface describes a parser which can be registered in the evaluator.

Version:
$Revision: 1.1 $
Author:
Gerd Neugebauer

Method Summary
 EType convert(Code code, Context context, TokenSource source, Typesetter typesetter)
          Try to convert some code into a proper data type.
 EType parse(Context context, TokenSource source, Typesetter typesetter)
          Try to parse a proper value from the token source.
 void registered(Evaluator evaluator)
          Inform the parser that it has been registered in an evaluator.
 

Method Detail

convert

public EType convert(Code code,
                     Context context,
                     TokenSource source,
                     Typesetter typesetter)
              throws InterpreterException
Try to convert some code into a proper data type.

Parameters:
code - the code to convert
context - the interpreter context
source - the source for new tokens
typesetter - the typesetter
Returns:
the converted value or null if the conversion could not be performed
Throws:
InterpreterException - in case of an error

parse

public EType parse(Context context,
                   TokenSource source,
                   Typesetter typesetter)
            throws InterpreterException
Try to parse a proper value from the token source.

Parameters:
context - the interpreter context
source - the source for new tokens
typesetter - the typesetter
Returns:
the element inquired or null if none could be parsed
Throws:
InterpreterException - in case of an error

registered

public void registered(Evaluator evaluator)
Inform the parser that it has been registered in an evaluator. In this case the parser can register some functions in the evaluator.

Parameters:
evaluator - the evaluator where the parser has been registered