JSci.maths.symbolic
Class ExpressionParser

java.lang.Object
  extended by JSci.maths.symbolic.ExpressionParser
All Implemented Interfaces:
ExpressionParserConstants

public class ExpressionParser
extends java.lang.Object
implements ExpressionParserConstants

This class has some static methods to create an Expression from a string or a text stream.


Nested Class Summary
(package private) static class ExpressionParser.JJCalls
           
 
Field Summary
(package private) static SimpleCharStream jj_input_stream
           
static Token jj_nt
           
static boolean lookingAhead
           
static Token token
           
static ExpressionParserTokenManager token_source
           
 
Fields inherited from interface JSci.maths.symbolic.ExpressionParserConstants
DEFAULT, DIGIT, DNUM, EOF, IDENTIFIER, INUM, IUNIT, LETTER, ONEARGFUNCTION, PI, tokenImage
 
Constructor Summary
ExpressionParser(ExpressionParserTokenManager tm)
           
ExpressionParser(java.io.InputStream stream)
           
ExpressionParser(java.io.Reader stream)
           
 
Method Summary
static void disable_tracing()
           
static void enable_tracing()
           
static Expression expressionP0()
           
static Expression[] expressionP0l()
           
static Expression expressionP1()
           
static Expression[] expressionP1l()
           
static Expression expressionP2()
           
static Expression expressionP3()
           
static Expression expressionP4()
           
static ParseException generateParseException()
           
static Token getNextToken()
           
static Token getToken(int index)
           
static Expression Input()
           
static Expression parse(java.io.InputStream is)
          Create an Expression reading a text from a stream.
static Expression parse(java.io.InputStream is, java.util.Map vars)
          Create an Expression reading a text from a stream.
static Expression parse(java.lang.String s)
          Create an Expression from a String like "x+y*sin(z)".
static Expression parse(java.lang.String s, java.util.Map vars)
          Create an Expression from a String like "x+y*sin(z)".
 void ReInit(ExpressionParserTokenManager tm)
           
static void ReInit(java.io.InputStream stream)
           
static void ReInit(java.io.Reader stream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public static ExpressionParserTokenManager token_source

jj_input_stream

static SimpleCharStream jj_input_stream

token

public static Token token

jj_nt

public static Token jj_nt

lookingAhead

public static boolean lookingAhead
Constructor Detail

ExpressionParser

public ExpressionParser(java.io.InputStream stream)

ExpressionParser

public ExpressionParser(java.io.Reader stream)

ExpressionParser

public ExpressionParser(ExpressionParserTokenManager tm)
Method Detail

parse

public static Expression parse(java.io.InputStream is,
                               java.util.Map vars)
                        throws ParseException
Create an Expression reading a text from a stream. The text can be something like "x+y*sin(z)".

Parameters:
is - a stream
vars - a Map name / variable; it can contain some of the variable names.
Returns:
the Expression
Throws:
ParseException

parse

public static Expression parse(java.lang.String s,
                               java.util.Map vars)
                        throws ParseException
Create an Expression from a String like "x+y*sin(z)".

Parameters:
s - a string
vars - a Map name / variable; it can contain some of the variable names.
Returns:
the Expression
Throws:
ParseException

parse

public static Expression parse(java.lang.String s)
                        throws ParseException
Create an Expression from a String like "x+y*sin(z)". Variables are not accessible.

Parameters:
s - a string
Returns:
the Expression
Throws:
ParseException

parse

public static Expression parse(java.io.InputStream is)
                        throws ParseException
Create an Expression reading a text from a stream. The text can be something like "x+y*sin(z)". Variables are not accessible.

Parameters:
is - a stream
Returns:
the Expression
Throws:
ParseException

Input

public static final Expression Input()
                              throws ParseException
Throws:
ParseException

expressionP0

public static final Expression expressionP0()
                                     throws ParseException
Throws:
ParseException

expressionP0l

public static final Expression[] expressionP0l()
                                        throws ParseException
Throws:
ParseException

expressionP1

public static final Expression expressionP1()
                                     throws ParseException
Throws:
ParseException

expressionP1l

public static final Expression[] expressionP1l()
                                        throws ParseException
Throws:
ParseException

expressionP2

public static final Expression expressionP2()
                                     throws ParseException
Throws:
ParseException

expressionP3

public static final Expression expressionP3()
                                     throws ParseException
Throws:
ParseException

expressionP4

public static final Expression expressionP4()
                                     throws ParseException
Throws:
ParseException

ReInit

public static void ReInit(java.io.InputStream stream)

ReInit

public static void ReInit(java.io.Reader stream)

ReInit

public void ReInit(ExpressionParserTokenManager tm)

getNextToken

public static final Token getNextToken()

getToken

public static final Token getToken(int index)

generateParseException

public static ParseException generateParseException()

enable_tracing

public static final void enable_tracing()

disable_tracing

public static final void disable_tracing()