42 #include "private/qdeclarativejsengine_p.h" 44 #include "private/qdeclarativejsglobal_p.h" 45 #include "private/qdeclarativejsnodepool_p.h" 55 {
return qHash(
id.asString()); }
88 : m_fileName(fileName), m_engine(engine)
105 if ((c >=
'0') && (c <=
'9'))
107 else if ((c >=
'a') && (c <=
'z'))
109 else if ((c >=
'A') && (c <=
'Z'))
123 }
else if (buf[0] ==
'-') {
128 if (((size-i) >= 2) && (buf[i] ==
'0')) {
129 if (((buf[i+1] ==
'x') || (buf[i+1] ==
'X'))
131 if ((radix != 0) && (radix != 16))
141 }
else if (radix == 0) {
146 for ( ; i < size; ++i) {
148 if ((d == -1) || (d >= radix))
159 double multiplier = 1;
160 for (--i ; i >= j; --i, multiplier *= radix)
161 result +=
toDigit(buf[i]) * multiplier;
175 : _lexer(0), _nodePool(0)
194 {
return id->asString(); }
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
static int flagFromChar(const QChar &)
#define it(className, varName)
void setNodePool(NodePool *nodePool)
The QByteArray class provides an array of bytes.
NameId * intern(const QChar *u, int s)
The QString class provides a Unicode character string.
The QHash class is a template class that provides a hash-table-based dictionary.
The QChar class provides a 16-bit Unicode character.
QString numberToString(double value)
Code * createCompiledCode(AST::Node *node, CompilationUnit &compilation)
void append(const T &t)
Inserts value at the end of the list.
static QString flagsToString(int flags)
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
NodePool * nodePool() const
QList< QDeclarativeJS::AST::SourceLocation > comments() const
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
const T & value() const
Returns the current item's value.
#define QT_QML_END_NAMESPACE
const_iterator constFind(const Key &key) const
Returns an iterator pointing to the item with the key in the hash.
void setLexer(Lexer *lexer)
NodePool(const QString &fileName, Engine *engine)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
#define QT_QML_BEGIN_NAMESPACE
Q_CORE_EXPORT double qSNaN()
Returns the bit pattern of a signalling NaN as a double.
const char * constData() const
Returns a pointer to the data stored in the byte array.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Q_CORE_EXPORT double qInf()
Returns the bit pattern for an infinite number as a double.
static int toDigit(char c)
void addComment(int pos, int len, int line, int col)
int size() const
Returns the number of bytes in this byte array.
uint qHash(const QDeclarativeJS::NameId &id)
int qstrcmp(const QByteArray &str1, const char *str2)
double integerFromString(const char *buf, int size, int radix)
QSet< NameId > literals() const
static QString fileName(const QString &fileUrl)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QList< QDeclarativeJS::AST::SourceLocation > _comments
static QString toString(NameId *id)