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;
44 TGLexer(MemoryBuffer *StartBuf);
47 void setIncludeDirs(const std::vector<std::string> &Dirs) {
48 IncludeDirectories = Dirs;
53 void PrintError(const char *Loc, const std::string &Msg) const;
55 std::ostream &err() const;
56 void PrintIncludeStack(std::ostream &OS) const;
59 int ReturnError(const char *Loc, const std::string &Msg);
62 void SkipBCPLComment();
73 } // end namespace llvm