Analitza
#include <expression.h>
Public Types | |
typedef void(* | CustomObjectDestructor )(const QVariant &) |
Static Public Member Functions | |
static void | computeDepth (Object *o) |
static Expression | constructCustomObject (const QVariant &custom, Analitza::Expression::CustomObjectDestructor d) |
static Expression | constructList (const QList< Expression > &exps) |
static Expression | constructString (const QString &str) |
static bool | isCompleteExpression (const QString &exp, bool justempty=false) |
static bool | isMathML (const QString &s) |
static enum Object::ObjectType | whatType (const QString &tag) |
Detailed Description
Represents a mathematical expression.
Expression let to convert it to string, MathML and make some little queries to it, without calculating anything.
Definition at line 45 of file expression.h.
Member Typedef Documentation
Definition at line 48 of file expression.h.
Constructor & Destructor Documentation
Analitza::Expression::Expression | ( | ) |
Constructs an empty Expression.
Analitza::Expression::Expression | ( | const Expression & | e | ) |
Copy constructor, copies the whole object to the constructed one.
Analitza::Expression::Expression | ( | const Cn & | e | ) |
Creates an expression from a value.
|
explicit |
|
explicit |
Constructor.
Parses an expression and creates the object.
- Parameters
-
exp expression to be assigned mathml format of the expression
Analitza::Expression::~Expression | ( | ) |
Destructor.
Member Function Documentation
void Analitza::Expression::addError | ( | const QString & | error | ) |
Adds a new error error
to the expression, to be reported afterwards.
QStringList Analitza::Expression::bvarList | ( | ) | const |
- Returns
- Lists the global bounded variables in the expression
void Analitza::Expression::clear | ( | ) |
Invalidates the data of the expression.
QStringList Analitza::Expression::comments | ( | ) | const |
|
static |
|
static |
creates an expression filled with just a custom object
|
static |
- Returns
- an expression containing a list of every expression passed on
exps
on the form: list { exps[0], exps[1], ... }
|
static |
creates an expression filled with just a string
QVariant Analitza::Expression::customObjectValue | ( | ) | const |
In case it contains a custom object it returns its value.
Expression Analitza::Expression::declarationValue | ( | ) | const |
- Returns
- the value of the declaration. If it's not a declaration then an expression it's returned.
Expression Analitza::Expression::elementAt | ( | int | position | ) | const |
Returns the element at position
in a vector.
Expression Analitza::Expression::equationToFunction | ( | ) | const |
- Returns
- the expression that evaluates the current equation to equal 0
QStringList Analitza::Expression::error | ( | ) | const |
Returns the list of errors that had experienced while building the expression.
|
static |
- Returns
- if a non-mathml expression is fully introduced (e.g. has closed all parentheses).
- Parameters
-
justempty tells if it's an expression with just spaces and comments
bool Analitza::Expression::isCorrect | ( | ) | const |
Returns whether this is a correct expression.
bool Analitza::Expression::isCustomObject | ( | ) | const |
- Returns
- true if the expression is a custom object, false otherwise.
bool Analitza::Expression::isDeclaration | ( | ) | const |
- Returns
- whether it's a declaration
bool Analitza::Expression::isEquation | ( | ) | const |
- Returns
- whether it's an equation
bool Analitza::Expression::isLambda | ( | ) | const |
Returns whether it is a lambda-expression.
bool Analitza::Expression::isList | ( | ) | const |
Returns whether it is a list expression.
|
inlinestatic |
- Returns
- whether
s
is MathML or not. Very simple.
Definition at line 241 of file expression.h.
bool Analitza::Expression::isReal | ( | ) | const |
- Returns
- true if the expression is a value, false otherwise.
bool Analitza::Expression::isString | ( | ) | const |
Returns whether it is a string expression (a list of chars).
bool Analitza::Expression::isVector | ( | ) | const |
Returns whether it is a vector expression.
Expression Analitza::Expression::lambdaBody | ( | ) | const |
Returns the expression of the lambda body (without resolving the dependencies)
QString Analitza::Expression::name | ( | ) | const |
- Returns
- the name of the expression. If it's not a declaration then an empty string it's returned.
bool Analitza::Expression::operator!= | ( | const Expression & | e | ) | const |
Expression Analitza::Expression::operator= | ( | const Expression & | e | ) |
Copy assignment.
Copies the e
expression here.
bool Analitza::Expression::operator== | ( | const Expression & | e | ) | const |
Returns whether the e
is equal.
- Returns
- a list of the parameters in case this expression represents a lambda construction.
void Analitza::Expression::renameArgument | ( | int | depth, |
const QString & | newName | ||
) |
renames the depth
-th variable into newName
void Analitza::Expression::setElementAt | ( | int | position, |
const Analitza::Expression & | exp | ||
) |
sets an expression value value
to a position
bool Analitza::Expression::setMathML | ( | const QString & | exp | ) |
Sets an expression exp
which is in MathML format.
Returns whether it was correctly assigned or not.
bool Analitza::Expression::setText | ( | const QString & | exp | ) |
Sets an expression exp
which is not in MathML format.
Returns whether it was correctly assigned or not.
void Analitza::Expression::setTree | ( | Object * | o | ) |
QString Analitza::Expression::stringValue | ( | ) | const |
- Returns
- the contained string value
QList<Expression> Analitza::Expression::toExpressionList | ( | ) | const |
In case it was a vector or list, it returns a list of each expression on the vector.
QString Analitza::Expression::toHtml | ( | ) | const |
Exports the expression to HTML.
QString Analitza::Expression::toMathML | ( | ) | const |
Converts the expression to MathML.
QString Analitza::Expression::toMathMLPresentation | ( | ) | const |
Converts the expression to MathML Presentation Markup.
Cn Analitza::Expression::toReal | ( | ) | const |
- Returns
- Value representation of the expression.
QString Analitza::Expression::toString | ( | ) | const |
Converts the expression to a string expression.
const Object* Analitza::Expression::tree | ( | ) | const |
Returns the tree associated to this object.
Object* Analitza::Expression::tree | ( | ) |
Returns the tree associated to this object.
|
static |
Converts a tag
to an object type.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:11:37 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.