Package edu.cmu.tetrad.calculator.parser
Class ExpressionParser
java.lang.Object
edu.cmu.tetrad.calculator.parser.ExpressionParser
Parses a string into a tree-like expression.
- Author:
- Tyler Gibson
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The type of restriction on parameters. -
Constructor Summary
ConstructorsConstructorDescriptionConstructrs a parser that has no allowable parameters.ExpressionParser
(Collection<String> parameters, ExpressionParser.RestrictionType type) Constructs the parser given a collection of allowable parameters. -
Method Summary
Modifier and TypeMethodDescriptionint
parseEquation
(String equation) Parses an equation of the form Variable = Expression.parseExpression
(String expression) Parses the given expression, or throws an exception if its not possible.
-
Constructor Details
-
ExpressionParser
public ExpressionParser()Constructrs a parser that has no allowable parameters. -
ExpressionParser
Constructs the parser given a collection of allowable parameters.
-
-
Method Details
-
parseExpression
Parses the given expression, or throws an exception if its not possible.- Throws:
ParseException
-
parseEquation
Parses an equation of the form Variable = Expression.- Throws:
ParseException
-
getNextOffset
public int getNextOffset() -
getParameters
-