X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTableGen%2FTGLexer.h;h=d1bd70d2eca427caf9778ab51118bbf171d0cdde;hb=0a230e0d985625a3909cb78fd867a3abaf434565;hp=84d328b12d9764d894cc8b626e49d60e36db32c0;hpb=7c788888872233748da10a8177a9a1eb176c1bc8;p=oota-llvm.git diff --git a/lib/TableGen/TGLexer.h b/lib/TableGen/TGLexer.h index 84d328b12d9..d1bd70d2eca 100644 --- a/lib/TableGen/TGLexer.h +++ b/lib/TableGen/TGLexer.h @@ -15,9 +15,10 @@ #define TGLEXER_H #include "llvm/Support/DataTypes.h" -#include -#include +#include "llvm/Support/SMLoc.h" #include +#include +#include namespace llvm { class MemoryBuffer; @@ -39,13 +40,14 @@ namespace tgtok { colon, semi, // : ; comma, period, // , . equal, question, // = ? - + paste, // # + // Keywords. - Bit, Bits, Class, Code, Dag, Def, Defm, Field, In, Int, Let, List, + Bit, Bits, Class, Code, Dag, Def, Foreach, Defm, Field, In, Int, Let, List, MultiClass, String, // !keywords. - XConcat, XSRA, XSRL, XSHL, XStrConcat, XCast, XSubst, + XConcat, XADD, XSRA, XSRL, XSHL, XStrConcat, XCast, XSubst, XForEach, XHead, XTail, XEmpty, XIf, XEq, // Integer value. @@ -72,9 +74,13 @@ class TGLexer { /// CurBuffer - This is the current buffer index we're lexing from as managed /// by the SourceMgr object. int CurBuffer; + +public: + typedef std::map DependenciesMapTy; +private: /// Dependencies - This is the list of all included files. - std::vector Dependencies; - + DependenciesMapTy Dependencies; + public: TGLexer(SourceMgr &SrcMgr); ~TGLexer() {} @@ -83,7 +89,7 @@ public: return CurCode = LexToken(); } - const std::vector &getDependencies() const { + const DependenciesMapTy &getDependencies() const { return Dependencies; } @@ -109,6 +115,7 @@ private: tgtok::TokKind ReturnError(const char *Loc, const Twine &Msg); int getNextChar(); + int peekNextChar(int Index); void SkipBCPLComment(); bool SkipCComment(); tgtok::TokKind LexIdentifier();