rasdaman complete source
parseinfo.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 */
23 #ifndef _PARSEINFO_
24 #define _PARSEINFO_
25 
26 #ifndef CPPSTDLIB
27 #include <ospace/string.h> // STL<ToolKit>
28 #else
29 #include <string>
30 #endif
31 
32 /*************************************************************
33  *
34  *
35  * COMMENTS:
36  *
37  ************************************************************/
38 
39 
40 //@ManMemo: Module: {\bf qlparser}
41 
42 /*@Doc:
43 
44  This class holds some information about a token and its
45  location in the parse string. Additionally, it can keep
46  an error number which is used in the query tree to report
47  error with some context information within the query string.
48 
49 */
50 
51 class ParseInfo
52 {
53 public:
54 
56  ParseInfo();
57 
59  ParseInfo( unsigned long errorNo, const char* token, unsigned int lineNo, unsigned columnNo );
60 
62  ParseInfo( const ParseInfo& old);
63 
65  ParseInfo( const char* token, unsigned int lineNo, unsigned columnNo );
66 
67  //@Man: Read/Write methods
69  inline unsigned long getErrorNo() const;
72  inline const std::string& getToken() const;
74  inline unsigned int getLineNo() const;
76  inline unsigned int getColumnNo() const;
78  inline void setErrorNo( unsigned long errorNo );
80  inline void setToken( const std::string& text );
82  inline void setToken( const char* text );
84  inline void setLineNo( unsigned int lineNo );
86  inline void setColumnNo( unsigned int columnNo );
88 
89 
90  void printStatus( std::ostream& s= std::cout ) const;
91 
92  ParseInfo& operator=(const ParseInfo& old);
93 
94 private:
95  //@Man: Attributes
97  unsigned long errorNo;
100  unsigned int lineNo;
102  unsigned int columnNo;
104  std::string token;
106 
107 };
108 
109 #include "parseinfo.icc"
110 
111 #endif
void setLineNo(unsigned int lineNo)
ParseInfo & operator=(const ParseInfo &old)
Definition: parseinfo.hh:51
void setErrorNo(unsigned long errorNo)
unsigned long getErrorNo() const
const std::string & getToken() const
ParseInfo()
default constructor
void setToken(const std::string &text)
void setColumnNo(unsigned int columnNo)
unsigned int getColumnNo() const
unsigned int getLineNo() const
void printStatus(std::ostream &s=std::cout) const