1 //===- ScriptLexer.h --------------------------------------------*- C++ -*-===//
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLD_ELF_SCRIPT_LEXER_H
11 #define LLD_ELF_SCRIPT_LEXER_H
13 #include "lld/Common/LLVM.h"
14 #include "llvm/ADT/StringRef.h"
15 #include "llvm/Support/MemoryBuffer.h"
24 explicit ScriptLexer(MemoryBufferRef MB);
26 void setError(const Twine &Msg);
27 void tokenize(MemoryBufferRef MB);
28 static StringRef skipSpace(StringRef S);
33 bool consume(StringRef Tok);
34 void expect(StringRef Expect);
35 bool consumeLabel(StringRef Tok);
36 std::string getCurrentLocation();
38 std::vector<MemoryBufferRef> MBs;
39 std::vector<StringRef> Tokens;
44 void maybeSplitExpr();
46 size_t getLineNumber();
47 size_t getColumnNumber();
49 MemoryBufferRef getCurrentMB();