jv.thirdParty.expr

## Class Parser

- java.lang.Object
- - jv.thirdParty.expr.Parser

-     public class Parser
      extends java.lang.Object

  Parses strings representing mathematical formulas with variables. The following operators, in descending order of precedence, are defined:
  - ^ (raise to a power such as 17^2 or sin(x)^2)
  - * /
  - Unary minus (-x)
  - + -
  ^ associates right-to-left; other operators associate left-to-right.

  These functions are defined: abs, acos(==arccos), asin(==arcsin), atan(==arctan), acot(==arccot), ceil, floor, exp, log(==ln), round, sign, sqrt, sin, cos, tan, cot, sinh, cosh, tanh, coth, asinh(==arcsinh), acosh(==arccosh), atanh(==arctanh), acoth(==arccoth). Lowercase and uppercase writing is ignored.

  Each function requires one argument enclosed in parentheses. Whitespaces outside identifiers are 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:

  - 42
  - 2-3
  - cos(x^2) + sin(x^2)
  - sqrt(y)^3

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Parser()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Expr` | `parse(java.lang.String input)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Parser

          public Parser()

  - ### Method Detail

    - #### parse

          public static Expr parse(java.lang.String input)
                            throws Syntax_error

      Throws:
        `Syntax_error`

"

The software JavaView? is copyright protected. All Rights Reserved.
"