org.extex.base.parser
Class ConstantMudimenParser

java.lang.Object
  extended by org.extex.base.parser.ConstantMudimenParser
All Implemented Interfaces:
Parser<Mudimen>

public class ConstantMudimenParser
extends java.lang.Object
implements Parser<Mudimen>

This class provides a parser for math units (mu).

Version:
$Revision:4399 $
Author:
Gerd Neugebauer

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
ConstantMudimenParser()
           
 
Method Summary
 Mudimen parse(Context context, TokenSource source, Typesetter typesetter)
          Creates a new object and fills it from a token stream.
protected static long scanMu(Context context, TokenSource source, Typesetter typesetter)
          Scan a math unit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values
Constructor Detail

ConstantMudimenParser

public ConstantMudimenParser()
Method Detail

scanMu

protected static long scanMu(Context context,
                             TokenSource source,
                             Typesetter typesetter)
                      throws HelpingException,
                             TypesetterException
Scan a math unit.

Parameters:
context - the processor context
source - the source for new tokens
typesetter - the typesetter
Returns:
the number of scaled points for the mu
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter

parse

public Mudimen parse(Context context,
                     TokenSource source,
                     Typesetter typesetter)
              throws HelpingException,
                     TypesetterException
Creates a new object and fills it from a token stream. This method parses the following syntactic entity:
    ⟨mudimen⟩
      → ⟨float⟩ mu
       |  ⟨mudimen variable⟩
 
The value of ⟨mudimen⟩ is either a floating point number followed by the unit mu or a variable value resulting in a mudimen value.

Specified by:
parse in interface Parser<Mudimen>
Parameters:
context - the processor context
source - the source for new tokens
typesetter - the typesetter
Returns:
the new object
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter in case of an error in the typesetter
See Also:
Parser.parse( org.extex.interpreter.context.Context, org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)