1 //===- TGLexer.h - Lexer for TableGen Files ---------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Chris Lattner and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This class represents the Lexer for tablegen files.
12 //===----------------------------------------------------------------------===//
29 /// IncludeRec / IncludeStack - This captures the current set of include
30 /// directives we are nested within.
35 IncludeRec(MemoryBuffer *buffer, const char *curPtr, unsigned lineNo)
36 : Buffer(buffer), CurPtr(curPtr), LineNo(lineNo) {}
38 std::vector<IncludeRec> IncludeStack;
40 // IncludeDirectories - This is the list of directories we should search for
42 std::vector<std::string> IncludeDirectories;
46 TGLexer(MemoryBuffer *StartBuf);
49 void setIncludeDirs(const std::vector<std::string> &Dirs) {
50 IncludeDirectories = Dirs;
55 const std::string getError() const { return TheError; }
58 void PrintIncludeStack(std::ostream &OS);
61 void SkipBCPLComment();
72 } // end namespace llvm