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 12 #include <mcld/Script/StrToken.h> 13 14 namespace mcld 15 { 16 17 /** \class InputToken 18 * \brief This class defines the interfaces to a file/namespec token. 19 */ 20 21 class InputToken : public StrToken 22 { 23 public: 24 enum Type { 25 Unknown, 26 File, 27 NameSpec 28 }; 29 30 protected: 31 InputToken(); 32 InputToken(Type pType, const std::string& pName, bool pAsNeeded); 33 34 public: 35 virtual ~InputToken(); 36 type()37 Type type() const { return m_Type; } 38 asNeeded()39 bool asNeeded() const { return m_bAsNeeded; } 40 classof(const StrToken * pToken)41 static bool classof(const StrToken* pToken) 42 { 43 return pToken->kind() == StrToken::Input; 44 } 45 46 private: 47 Type m_Type; 48 bool m_bAsNeeded; 49 }; 50 51 } // namepsace of mcld 52 53 #endif 54