InputToken.h revision 87f34658dec9097d987d254a990ea7f311bfc95f
1//===- InputToken.h -------------------------------------------------------===// 2// 3// The MCLinker Project 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9#ifndef MCLD_SCRIPT_INPUTTOKEN_H 10#define MCLD_SCRIPT_INPUTTOKEN_H 11#ifdef ENABLE_UNITTEST 12#include <gtest.h> 13#endif 14 15#include <mcld/Script/StrToken.h> 16 17namespace mcld 18{ 19 20/** \class InputToken 21 * \brief This class defines the interfaces to a file/namespec token. 22 */ 23 24class InputToken : public StrToken 25{ 26public: 27 enum Type { 28 Unknown, 29 File, 30 NameSpec 31 }; 32 33protected: 34 InputToken(); 35 InputToken(Type pType, const std::string& pName, bool pAsNeeded); 36 37public: 38 virtual ~InputToken(); 39 40 Type type() const { return m_Type; } 41 42 bool asNeeded() const { return m_bAsNeeded; } 43 44 static bool classof(const StrToken* pToken) 45 { 46 return pToken->kind() == StrToken::Input; 47 } 48 49private: 50 Type m_Type; 51 bool m_bAsNeeded; 52}; 53 54} // namepsace of mcld 55 56#endif 57