ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/antlr/CommonToken.cpp
Revision: 2469
Committed: Fri Dec 2 15:38:03 2005 UTC (18 years, 7 months ago) by tim
File size: 902 byte(s)
Log Message:
End of the Link --> List
Return of the Oject-Oriented
replace yacc/lex parser with antlr parser

File Contents

# Content
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: CommonToken.cpp,v 1.1 2005-12-02 15:38:02 tim Exp $
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