KDevelop API Documentation

Token.cpp

Go to the documentation of this file.
00001 /* ANTLR Translator Generator
00002  * Project led by Terence Parr at http://www.jGuru.com
00003  * Software rights: http://www.antlr.org/RIGHTS.html
00004  *
00005  * $Id: Token.cpp,v 1.3 2003/12/26 22:56:34 harald Exp $
00006  */
00007 
00008 #include "antlr/Token.hpp"
00009 #include "antlr/String.hpp"
00010 
00011 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
00012 namespace antlr {
00013 #endif
00014 
00015 // The below initialization ICED AIX Visualage CC
00016 //ANTLR_API RefToken Token::badToken(new Token(Token::INVALID_TYPE, "<no text>"));
00017 // this seemed to work
00018 ANTLR_API RefToken Token::badToken = RefToken(new Token(Token::INVALID_TYPE, "<no text>"));
00019 
00020 Token::Token() : type(INVALID_TYPE)
00021 {
00022 }
00023 
00024 Token::Token(int t) : type(t)
00025 {
00026 }
00027 
00028 Token::Token(int t, const ANTLR_USE_NAMESPACE(std)string& txt)
00029     : type(t)
00030 {
00031     type=t;
00032     setText(txt);
00033 }
00034 
00035 int Token::getColumn() const
00036 {
00037     return 0;
00038 }
00039 
00040 int Token::getLine() const
00041 {
00042     return 0;
00043 }
00044 
00045 ANTLR_USE_NAMESPACE(std)string Token::getText() const
00046 {
00047     return "<no text>";
00048 }
00049 
00050 int Token::getType() const
00051 {
00052     return type;
00053 }
00054 
00055 void Token::setColumn(int /*c*/)
00056 {}
00057 
00058 void Token::setLine(int /*l*/)
00059 {}
00060 
00061 void Token::setText(const ANTLR_USE_NAMESPACE(std)string& /*t*/)
00062 {}
00063 
00064 void Token::setType(int t)
00065 {
00066     type=t;
00067 }
00068 
00069 ANTLR_USE_NAMESPACE(std)string Token::toString() const
00070 {
00071     return "[\""+getText()+"\",<"+type+">]";
00072 }
00073 
00074 Token::~Token()
00075 {}
00076 
00077 ANTLR_API RefToken nullToken;
00078 
00079 #ifndef NO_STATIC_CONSTS
00080 const int Token::MIN_USER_TYPE;
00081 const int Token::NULL_TREE_LOOKAHEAD;
00082 const int Token::INVALID_TYPE;
00083 const int Token::EOF_TYPE;
00084 const int Token::SKIP;
00085 #endif
00086 
00087 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
00088 }
00089 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:50 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003