1
/****************************************************************************
3
** Copyright (C) 2004-2005 Trolltech AS. All rights reserved.
4
** Copyright (C) 2001-2004 Roberto Raggi
6
** This file is part of the porting application of the Qt Toolkit.
8
** This file may be distributed under the terms of the Q Public License
9
** as defined by Trolltech AS of Norway and appearing in the file
10
** LICENSE.QPL included in the packaging of this file.
12
** This file may be distributed and/or modified under the terms of the
13
** GNU General Public License version 2 as published by the Free Software
14
** Foundation and appearing in the file LICENSE.GPL included in the
15
** packaging of this file.
17
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
18
** information about Qt Commercial License Agreements.
19
** See http://www.trolltech.com/qpl/ for QPL licensing information.
20
** See http://www.trolltech.com/gpl/ for GPL licensing information.
22
** Contact info@trolltech.com if any conditions of this licensing are
25
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28
****************************************************************************/
35
#include "tokenengine.h"
42
typedef void (Tokenizer::*scan_fun_ptr)(int *kind);
43
QVector<TokenEngine::Token> tokenize(QByteArray text);
45
bool nextToken(TokenEngine::Token &tok);
47
void scanChar(int *kind);
48
void scanUnicodeChar(int *kind);
49
void scanNewline(int *kind);
50
void scanWhiteSpaces(int *kind);
51
void scanCharLiteral(int *kind);
52
void scanStringLiteral(int *kind);
53
void scanNumberLiteral(int *kind);
54
void scanIdentifier(int *kind);
55
void scanComment(int *kind);
56
void scanPreprocessor(int *kind);
57
void scanOperator(int *kind);
59
void setupScanTable();
61
static bool s_initialized;
62
static scan_fun_ptr s_scan_table[];
63
static int s_attr_table[];
68
QVector<TokenEngine::Token> m_tokens;