parseArithmetic

Parses a ParseTree as a arithmetic expression @param T arithmetic type. By default is float. @param grammarName Name of the arithmetic grammar. Must be "ArithmeticNoVar" or "Arithmetic". By default is "ArithmeticNoVar" @param ParseTree p ParseTree generated by ArithmeticNoVar @param variable Associative array with variable values @return The result of the arithmetic expresion. If the ParseTree is invalid or contains unexpected nodes, then will return NaN if T is a float or 0 if T is a integral

  1. T parseArithmetic(ParseTree p, T[string] variables)
    T
    parseArithmetic
    (
    T = float
    string grammarName = "ArithmeticNoVar"
    )
    (,
    const ref T[string] variables
    )
    if (
    __traits(isArithmetic, T) &&
    (
    grammarName == "ArithmeticNoVar" ||
    grammarName == "Arithmetic"
    )
    )
  2. T parseArithmetic(ParseTree p)

Meta