JSci.maths.symbolic
Class ExpressionParser
java.lang.Object
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.
Fields inherited from interface JSci.maths.symbolic.ExpressionParserConstants |
DEFAULT, DIGIT, DNUM, EOF, IDENTIFIER, INUM, IUNIT, LETTER, ONEARGFUNCTION, PI, tokenImage |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
ExpressionParser
public ExpressionParser(java.io.InputStream stream)
ExpressionParser
public ExpressionParser(java.io.Reader stream)
ExpressionParser
public ExpressionParser(ExpressionParserTokenManager tm)
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 streamvars
- 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 stringvars
- 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()