Add missing newlines at EOF (for clang++).
[oota-llvm.git] / utils / TableGen / TGLexer.h
index 59e9fa0ef5ffd8f949f999e0089c254bb4b69f77..679020880dd3712b9fd87636382940d5b922e3b4 100644 (file)
 #ifndef TGLEXER_H
 #define TGLEXER_H
 
-#include "llvm/Support/DataTypes.h"
+#include "llvm/System/DataTypes.h"
 #include <vector>
 #include <string>
-#include <iosfwd>
 #include <cassert>
 
 namespace llvm {
 class MemoryBuffer;
-class TGSourceMgr;
+class SourceMgr;
+class SMLoc;
   
 namespace tgtok {
   enum TokKind {
@@ -44,8 +44,9 @@ namespace tgtok {
     MultiClass, String,
     
     // !keywords.
-    XConcat, XSRA, XSRL, XSHL, XStrConcat,
-    
+    XConcat, XSRA, XSRL, XSHL, XStrConcat, XNameConcat, XCast, XSubst,
+    XForEach, XCar, XCdr, XNull, XIf,
+
     // Integer value.
     IntVal,
     
@@ -56,7 +57,7 @@ namespace tgtok {
 
 /// TGLexer - TableGen Lexer class.
 class TGLexer {
-  TGSourceMgr &SrcMgr;
+  SourceMgr &SrcMgr;
   
   const char *CurPtr;
   const MemoryBuffer *CurBuf;
@@ -71,17 +72,10 @@ class TGLexer {
   /// by the SourceMgr object.
   int CurBuffer;
   
-  // IncludeDirectories - This is the list of directories we should search for
-  // include files in.
-  std::vector<std::string> IncludeDirectories;
 public:
-  TGLexer(TGSourceMgr &SrcMgr);
+  TGLexer(SourceMgr &SrcMgr);
   ~TGLexer() {}
   
-  void setIncludeDirs(const std::vector<std::string> &Dirs) {
-    IncludeDirectories = Dirs;
-  }
-  
   tgtok::TokKind Lex() {
     return CurCode = LexToken();
   }
@@ -99,10 +93,10 @@ public:
     return CurIntVal;
   }
 
-  typedef const char* LocTy;
-  LocTy getLoc() const { return TokStart; }
+  SMLoc getLoc() const;
 
-  void PrintError(LocTy Loc, const std::string &Msg) const;
+  void PrintError(const char *Loc, const std::string &Msg) const;
+  void PrintError(SMLoc Loc, const std::string &Msg) const;
   
 private:
   /// LexToken - Read the next token and return its code.