20#ifndef KSPREAD_FORMULA
21#define KSPREAD_FORMULA
24#include <tqvaluevector.h>
86 static const Token null;
103 TQString
text()
const {
return m_text; }
105 int pos()
const {
return m_pos; };
222 Tokens(): TQValueVector<Token>(), m_valid(
true) {};
223 bool valid()
const {
return m_valid; }
224 void setValid(
bool v ){ m_valid = v; }
261 Sheet*
sheet()
const;
307 Tokens scan(
const TQString& expr, TDELocale* locale = 0 )
const;
309 TQString dump()
const;
For every cell in the spread sheet there is a Cell object.
TQString description() const
Returns a short description of the token.
long asInteger() const
Returns integer value for an integer token.
bool isOperator() const
Returns true if token is an operator token.
double asFloat() const
Returns floating-point value for a floating-point token.
TQString sheetName() const
Returns sheet name in a cell reference token.
bool asBoolean() const
Returns boolean value for an boolean token.
bool isRange() const
Returns true if token is a range reference token.
@ InvalidOp
invalid operator
@ Ampersand
& (string concat)
@ Semicolon
; (argument separator)
bool isString() const
Returns true if token is a string token.
bool isInteger() const
Returns true if token is a integer token.
TQString text() const
Returns text associated with the token.
Type type() const
Returns type of the token.
bool isIdentifier() const
Returns true if token is an identifier.
bool isNumber() const
Returns true if token is either integer or floating-point token.
bool isCell() const
Returns true if token is a cell reference token.
bool isBoolean() const
Returns true if token is a boolean token.
TQString asString() const
Returns string value for a string token.
@ Identifier
function name or named area
@ Cell
$A$1, F4, Sheet2!B5, 'Sales Forecast'!Sum
@ Boolean
True, False (also i18n-ized)
@ Float
3.141592, 1e10, 5.9e-7
@ String
"KOffice", "The quick brown fox..."
Op asOperator() const
Returns operator value for an operator token.
bool isFloat() const
Returns true if token is a floating-point token.
Class Tokens represents array of tokens.
Provides a wrapper for cell value.
bool isIdentifier(TQChar ch)
helper function: return true for valid identifier character
Token::Op matchOperator(const TQString &text)
helper function: return operator of given token text e.g.
TQTextStream & operator<<(TQTextStream &ts, Formula formula)
Dumps the formula, should be used only to assist debugging.