Class EDU.emporia.mathtools.Parser
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.emporia.mathtools.Parser

Object
   |
   +----EDU.emporia.mathtools.Parser

public class Parser
extends Object
Parses strings representing mathematical formulas with variables. The following operators, in descending order of precedence, are defined: ^ associates right-to-left; other operators associate left-to-right.

These functions are defined: abs, acos, asin, atan, ceil, cos, exp, floor, log, round, sin, sqrt, tan. Each requires one argument enclosed in parentheses.

Whitespace outside identifiers is ignored.

The syntax-error messages aren't very informative, unfortunately. IWBNI it indicated where in the input string the parse failed, but that'd be kind of a pain since our scanner is a StreamTokenizer. A hook for that info should've been built into StreamTokenizer.

Examples: