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