]> git.saurik.com Git - apple/security.git/blob - Security/libsecurity_codesigning/antlr2/src/CommonToken.cpp
Security-57031.40.6.tar.gz
[apple/security.git] / Security / libsecurity_codesigning / antlr2 / src / CommonToken.cpp
1 /* ANTLR Translator Generator
2 * Project led by Terence Parr at http://www.jGuru.com
3 * Software rights: http://www.antlr.org/license.html
4 *
5 * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/src/CommonToken.cpp#2 $
6 */
7
8 #include "antlr/CommonToken.hpp"
9 #include "antlr/String.hpp"
10
11 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
12 namespace antlr {
13 #endif
14
15 CommonToken::CommonToken() : Token(), line(1), col(1), text("")
16 {}
17
18 CommonToken::CommonToken(int t, const ANTLR_USE_NAMESPACE(std)string& txt)
19 : Token(t)
20 , line(1)
21 , col(1)
22 , text(txt)
23 {}
24
25 CommonToken::CommonToken(const ANTLR_USE_NAMESPACE(std)string& s)
26 : Token()
27 , line(1)
28 , col(1)
29 , text(s)
30 {}
31
32 ANTLR_USE_NAMESPACE(std)string CommonToken::toString() const
33 {
34 return "[\""+getText()+"\",<"+getType()+">,line="+getLine()+",column="+getColumn()+"]";
35 }
36
37 RefToken CommonToken::factory()
38 {
39 return RefToken(new CommonToken);
40 }
41
42 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
43 }
44 #endif
45