MythTV  master
ParseText.h
Go to the documentation of this file.
1 /* ParseText.h
2 
3  Copyright (C) David C. J. Matthews 2004 dm at prolingua.co.uk
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  as published by the Free Software Foundation; either version 2
8  of the License, or (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18  Or, point your browser to http://www.gnu.org/copyleft/gpl.html
19 
20 */
21 
22 
23 #if !defined(PARSETEXT_H)
24 #define PARSETEXT_H
25 
26 class MHGroup;
27 
28 #include "ParseNode.h"
29 
30 class MHParseText: public MHParseBase
31 {
32  public:
33  MHParseText(QByteArray &program)
34  : m_String((unsigned char *)malloc(100)),
35  m_data(program) {}
36  virtual ~MHParseText();
37 
38  // Parse the text and return a pointer to the parse tree
39  MHParseNode *Parse() override; // MHParseBase
40 
41  private:
42  void GetNextChar();
43  void NextSym();
45  void Error(const char *str);
46 
47  int m_lineCount {1};
48 
53 
54  int m_ch {0};
55  int m_nTag {0};
56  int m_nInt {0};
57  bool m_fBool {false};
58  unsigned char *m_String {nullptr};
59  int m_nStringLength {0};
60 
61  unsigned int m_p {0}; // Count of bytes read
62  QByteArray m_data;
63 };
64 
65 #endif
unsigned int m_p
Definition: ParseText.h:61
ParseTextType m_nType
Definition: ParseText.h:52
MHParseNode * Parse() override
Definition: ParseText.cpp:1112
MHParseText(QByteArray &program)
Definition: ParseText.h:33
int m_nInt
Definition: ParseText.h:56
int m_lineCount
Definition: ParseText.h:47
void GetNextChar()
Definition: ParseText.cpp:51
void Error(const char *str)
Definition: ParseText.cpp:366
virtual ~MHParseText()
Definition: ParseText.cpp:45
MHParseNode * DoParse()
Definition: ParseText.cpp:843
QByteArray m_data
Definition: ParseText.h:62
void NextSym()
Definition: ParseText.cpp:372
Definition: Groups.h:45
unsigned char * m_String
Definition: ParseText.h:58
int m_nStringLength
Definition: ParseText.h:59
int m_nTag
Definition: ParseText.h:55
bool m_fBool
Definition: ParseText.h:57