Documentation of 'org.statcato.calculator.MathExpParserComplete' Java class
MathExpParserComplete
org.statcato.calculator

Class MathExpParserComplete



  • public class MathExpParserComplete
    extends java.lang.Object
    A parser for mathematical expressions using the recurive descent algorithm. Acceptable expressions are defined by the following grammar:

    E -> T { ("+" | "-") T}
    T -> F { ("*" | "/") F}
    F -> P {"^" F}
    P -> v | "(" E ")" | "-" T | func_name"(" E ")" | Cx | "'" L "'"
    L -> column_label

    where expressions enclosed by { } can appear zero or more times.

    Since:
    1.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getError()
      Returns error message from the scanner.
      CompUnit parse(java.lang.String exp, boolean isRadian)
      Parses the given expression.
      CompUnit S()
      Parses a statement.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MathExpParserComplete

        public MathExpParserComplete(Spreadsheet sp)
    • Method Detail

      • parse

        public CompUnit parse(java.lang.String exp,
                              boolean isRadian)
        Parses the given expression.
        Parameters:
        exp - expression in string
        isRadian - boolean value of whether radians are used
      • getError

        public java.lang.String getError()
        Returns error message from the scanner.
        Returns:
        error string
      • S

        public CompUnit S()
        Parses a statement. S->E
        Returns:
        the value of a statement

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.