1//===- FileToken.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_FILETOKEN_H 10#define MCLD_SCRIPT_FILETOKEN_H 11 12#include <mcld/Script/InputToken.h> 13#include <mcld/Support/Allocators.h> 14#include <mcld/Config/Config.h> 15 16namespace mcld 17{ 18 19/** \class FileToken 20 * \brief This class defines the interfaces to a filename in INPUT/GROUP 21 * command. 22 */ 23 24class FileToken : public InputToken 25{ 26private: 27 friend class Chunk<FileToken, MCLD_SYMBOLS_PER_INPUT>; 28 FileToken(); 29 FileToken(const std::string& pName, bool pAsNeeded); 30 31public: 32 ~FileToken(); 33 34 static bool classof(const InputToken* pToken) 35 { 36 return pToken->type() == InputToken::File; 37 } 38 39 /* factory method */ 40 static FileToken* create(const std::string& pName, bool pAsNeeded); 41 static void destroy(FileToken*& pToken); 42 static void clear(); 43}; 44 45} // namepsace of mcld 46 47#endif 48