KVIrc  4.9.2
DeveloperAPIs
KviKvsParserMacros.h
Go to the documentation of this file.
1 #ifndef _KVI_KVS_PARSER_MACROS_H_
2 #define _KVI_KVS_PARSER_MACROS_H_
3 //=============================================================================
4 //
5 // File : KviKvsParserMacros.h
6 // Creation date : Sun 5 Ocr 2003 20.25 CEST by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2003-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #define KVSP_skipChar m_ptr++
28 #define KVSP_skipNChars(n) m_ptr += n
29 #define KVSP_backChar m_ptr--
30 #define KVSP_backNChars(n) m_ptr -= n
31 
32 #define KVSP_curCharUnicode (m_ptr->unicode())
33 #define KVSP_curCharPointer m_ptr
34 
35 #define KVSP_curCharIsLetter (m_ptr->isLetter())
36 #define KVSP_curCharIsNumber (m_ptr->isNumber())
37 #define KVSP_curCharIsLetterOrNumber (m_ptr->isLetterOrNumber())
38 #define KVSP_curCharIsFunctionStart (m_ptr->isLetterOrNumber() || (m_ptr->unicode() == '(') || (m_ptr->unicode() == '{') || (m_ptr->unicode() == '$') || (m_ptr->unicode() == '#'))
39 #define KVSP_curCharIsEndOfCommand ((m_ptr->unicode() == ';') || (m_ptr->unicode() == 0) || (m_ptr->unicode() == '\n') || (m_ptr->unicode() == '\r'))
40 #define KVSP_curCharIsEndOfBuffer (m_ptr->unicode() == 0)
41 
42 #define KVSP_setCurCharPointer(_ptr) m_ptr = _ptr
43 
44 #define KVSP_ASSERT(_x) \
45  if(!(_x)) \
46  qDebug("WARNING : ASSERT FAILED: (%s) IS false AT %s:%d", #_x, __FILE__, __LINE__);
47 
48 #endif