8#include "InlineInfixToPostfix.h"
15#include "IException.h"
46 if ( representation.isEmpty() )
return (
false);
95 QString msg =
"The token '" + token
96 +
"' is not recognized as an operator, function or variable.";
137 return (
m_variables.contains(token, Qt::CaseInsensitive));
188 if (token.isEmpty())
return (
false);
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
InfixOperator and InfixFunction are helper classes for InfixToPostfix.
InfixOperator and InfixFunction are helper classes for InfixToPostfix.
Converter for math equations.
virtual InfixOperator * findOperator(QString representation)
This method will return a pointer to the operator represented by 'representation.
virtual bool isKnownSymbol(QString representation)
This method will return true if it believes the argument represents a valid function or operator.
bool isScalar(const QString &scalar)
Determines whether the given token represents a scalar value (i.e.
virtual InfixOperator * findOperator(QString element)
This method will first search the recognized list of operators and functions for the given token.
void initialize()
Adds several infix operators and functions to the operator list that are not already recognized by th...
bool isVariable(const QString &str)
Determines whether the given token is a variable and, if so, appends it to the list of variables.
InlineInfixToPostfix()
Constructs an InlineInfixToPostfix object.
virtual ~InlineInfixToPostfix()
Destroys the InlineInfixToPostfix object.
virtual bool isKnownSymbol(QString representation)
This method attempts to verify that the given argument is recognized as a valid function,...
bool exists(const QString &str)
Determines whether the given string exists as a recognized variable.
QStringList m_variables
The list of variables (represented as strings).
This is free and unencumbered software released into the public domain.
double toDouble(const QString &string)
Global function to convert from a string to a double.