ru.sstu.math.ep
Class Parser

java.lang.Object
  extended by ru.sstu.math.ep.Parser

public class Parser
extends Object

Parser class parses string as mathematical expression, builds tree and creates Expression.

Since:
Math 1.0
Author:
Denis A. Murashev

Nested Class Summary
static class Parser.EmptyExpressionException
          Cannot compile empty string.
static class Parser.NoBracketException
          Closing bracket expected.
static class Parser.UnexpectedBracketException
          Unexpected closing bracket.
 
Constructor Summary
Parser()
           
 
Method Summary
 Expression compile(String expression)
          Compiles string into expression.
 Expression compile(String expression, Iterable<String> variables)
          Compiles expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser()
Method Detail

compile

public Expression compile(String expression)
                   throws org.apache.commons.math.MathException
Compiles string into expression.

Parameters:
expression - expression
Returns:
compiled expression
Throws:
org.apache.commons.math.MathException - if cannot compile expression

compile

public Expression compile(String expression,
                          Iterable<String> variables)
                   throws org.apache.commons.math.MathException
Compiles expression.

Parameters:
expression - expression
variables - variables
Returns:
compiled expression
Throws:
org.apache.commons.math.MathException - if cannot compile expression


Copyright © 2011 TFI branch of Engels Instutute of Technology. All Rights Reserved.