EquationOrExpression:
        Expression RightHandSides_opt

RightHandSides:
        RightHandSide
        RightHandSides RightHandSide

RightHandSide:
        Equality Expression
        
Equality: one of
        = <= >= <> < > ~

Expression:
        Minus_opt Term Terms_opt

Minus:
        -

Terms:
        PlusOrMinusTerm
        Terms PlusOrMinusTerm

PlusOrMinusTerm:
        PlusOrMinus Term

PlusOrMinus: one of
        + -

Term:
        UnsignedFactor Factors_opt

Factors:
        MultiplyOrDivideFactor
        Factors MultiplyOrDivideFactor

MultiplyOrDivideFactor:
        MultiplyOrDivide Factor

MultiplyOrDivide: one of
        * /

Factor:
        Minus_opt UnsignedFactor

UnsignedFactor:
        UnsignedExponent Exponents_opt

Exponents:
        PowerExponent
        Exponents PowerExponent

PowerExponent:
        Power Exponent

Power: one of
        ^ **

Exponent:
        Minus_opt UnsignedExponent

UnsignedExponent:
        PrimaryExpression Factorial_opt

Factorial:
        !

PrimaryExpression:
        Double
        BigInteger
        Variable
        Matrix
        Vector
        BracketedExpression

BigInteger:
        Digits

Digits:
        Digit
        Digits Digit

Double:
        NaN
        Infinity
        FloatingPointLiteral

FloatingPointLiteral:
        Digits Point Digits_opt ExponentPart_opt
        Point Digits ExponentPart_opt
        Digits ExponentPart

Point
        .

ExponentPart:
        ExponentIndicator SignedInteger

ExponentIndicator: one of
        e E

SignedInteger:
        Sign_opt Digits

Sign: one of
        + -

Variable:
        Operator
        Function
        Constant

BracketedExpression:
        ( Expression )

Matrix:
        { Vector CommasAndVectors_opt }

CommasAndVectors:
        CommaAndVector
        CommasAndVectors CommaAndVector

CommaAndVector:
        Comma Vector

Comma:
        ,

Vector:
        { Expression CommasAndExpressions_opt }

CommasAndExpressions:
        CommaAndExpression
        CommasAndExpressions CommaAndExpression

CommaAndExpression:
        Comma Expression

Operator:
        OperatorName ParameterList

OperatorName: one of
        d grad diverg curl jacobian laplacian del vector complex quaternion geometric matrix tensor tran trace det solve subst lim sum prod integral groebner div mod modpow modinv eulerphi primitiveroots

ParameterList:
        ( Expression CommasAndExpressions_opt )

Function:
        UsualFunction
        ImplicitRoot
        ImplicitFunction

UsualFunction:
        UsualFunctionName ParameterList

UsualFunctionName: one of
        sin cos tan asin acos atan log exp sqrt sinh cosh tanh asinh acosh atanh abs sgn conjugate

ImplicitRoot:
        root Subscript ParameterList

ImplicitFunction:
        Identifier Derivation_opt ParameterList

Derivation:
        PrimeCharacters
        SuperscriptList

PrimeCharacters:
        PrimeCharacter
        PrimeCharacters PrimeCharacter

PrimeCharacter:
        '

SuperscriptList:
        { Integer CommasAndIntegers_opt }

CommasAndIntegers:
        CommaAndInteger
        CommasAndIntegers CommaAndInteger

CommaAndInteger:
        Comma Integer

Integer:
        Digits

Constant:
        Identifier Prime_opt Subscripts_opt

Identifier:
        Letter LettersOrDigits_opt

LettersOrDigits:
        LetterOrDigit
        LettersOrDigits LetterOrDigit

Prime:
        PrimeCharacters
        Superscript

Superscript:
        { Integer }

Subscripts:
        Subscript
        Subscripts Subscript

Subscript:
        [ Expression ]