OpenMD 3.1
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
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$
6 */
7
8#include "antlr/CommonToken.hpp"
9#include "antlr/String.hpp"
10
11#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
12namespace antlr {
13#endif
14
15CommonToken::CommonToken() : Token(), line(1), col(1), text("")
16{}
17
18CommonToken::CommonToken(int t, const ANTLR_USE_NAMESPACE(std)string& txt)
19: Token(t)
20, line(1)
21, col(1)
22, text(txt)
23{}
24
25CommonToken::CommonToken(const ANTLR_USE_NAMESPACE(std)string& s)
26: Token()
27, line(1)
28, col(1)
29, text(s)
30{}
31
32ANTLR_USE_NAMESPACE(std)string CommonToken::toString() const
33{
34 return "[\""+getText()+"\",<"+getType()+">,line="+getLine()+",column="+getColumn()+"]";
35}
36
37RefToken CommonToken::factory()
38{
39 return RefToken(new CommonToken);
40}
41
42#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
43}
44#endif
45