ANTLR Support Libraries 2.7.1+
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Friends
Macros
Pages
antlr
CommonToken.hpp
Go to the documentation of this file.
1
#ifndef INC_CommonToken_hpp__
2
#define INC_CommonToken_hpp__
3
4
/* ANTLR Translator Generator
5
* Project led by Terence Parr at http://www.jGuru.com
6
* Software rights: http://www.antlr.org/license.html
7
*
8
* $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/CommonToken.hpp#2 $
9
*/
10
11
#include <
antlr/config.hpp
>
12
#include <
antlr/Token.hpp
>
13
#include <string>
14
15
#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
16
namespace
antlr {
17
#endif
18
19
class
ANTLR_API
CommonToken
:
public
Token
{
20
public
:
21
CommonToken
();
22
CommonToken
(
int
t,
const
ANTLR_USE_NAMESPACE
(std)
string
& txt);
23
CommonToken
(
const
ANTLR_USE_NAMESPACE
(std)
string
& s);
24
26
virtual
ANTLR_USE_NAMESPACE
(std)string getText()
const
27
{
28
return
text;
29
}
30
32
virtual
void
setText(
const
ANTLR_USE_NAMESPACE
(std)
string
& s)
33
{
34
text = s;
35
}
36
41
virtual
int
getLine()
const
42
{
43
return
line;
44
}
49
virtual
int
getColumn()
const
50
{
51
return
col;
52
}
53
55
virtual
void
setLine(
int
l)
56
{
57
line = l;
58
}
60
virtual
void
setColumn(
int
c)
61
{
62
col = c;
63
}
64
65
virtual
ANTLR_USE_NAMESPACE
(std)string toString() const;
66
static
RefToken
factory();
67
68
protected:
69
// most tokens will want line and text information
70
int
line;
71
int
col;
72
ANTLR_USE_NAMESPACE
(std)
string
text;
73
74
private:
75
CommonToken
(const
CommonToken
&);
76
const CommonToken& operator=(const CommonToken&);
77
};
78
79
#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
80
}
81
#endif
82
83
#endif //INC_CommonToken_hpp__
Generated by
1.8.1.1