diff options
Diffstat (limited to 'contrib/llvm/lib/TableGen/TGLexer.h')
-rw-r--r-- | contrib/llvm/lib/TableGen/TGLexer.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/contrib/llvm/lib/TableGen/TGLexer.h b/contrib/llvm/lib/TableGen/TGLexer.h index b5b58161878b..2c80743e3a68 100644 --- a/contrib/llvm/lib/TableGen/TGLexer.h +++ b/contrib/llvm/lib/TableGen/TGLexer.h @@ -30,7 +30,7 @@ namespace tgtok { enum TokKind { // Markers Eof, Error, - + // Tokens with no info. minus, plus, // - + l_square, r_square, // [ ] @@ -44,11 +44,12 @@ namespace tgtok { // Keywords. Bit, Bits, Class, Code, Dag, Def, Foreach, Defm, Field, In, Int, Let, List, - MultiClass, String, + MultiClass, String, Defset, // !keywords. XConcat, XADD, XAND, XOR, XSRA, XSRL, XSHL, XListConcat, XStrConcat, XCast, - XSubst, XForEach, XHead, XTail, XEmpty, XIf, XEq, + XSubst, XForEach, XFoldl, XHead, XTail, XSize, XEmpty, XIf, XEq, XIsA, XDag, + XNe, XLe, XLt, XGe, XGt, // Integer value. IntVal, @@ -56,7 +57,7 @@ namespace tgtok { // Binary constant. Note that these are sized according to the number of // bits given. BinaryIntVal, - + // String valued tokens. Id, StrVal, VarName, CodeFragment }; @@ -65,7 +66,7 @@ namespace tgtok { /// TGLexer - TableGen Lexer class. class TGLexer { SourceMgr &SrcMgr; - + const char *CurPtr; StringRef CurBuf; @@ -95,11 +96,11 @@ public: const DependenciesMapTy &getDependencies() const { return Dependencies; } - + tgtok::TokKind getCode() const { return CurCode; } const std::string &getCurStrVal() const { - assert((CurCode == tgtok::Id || CurCode == tgtok::StrVal || + assert((CurCode == tgtok::Id || CurCode == tgtok::StrVal || CurCode == tgtok::VarName || CurCode == tgtok::CodeFragment) && "This token doesn't have a string value"); return CurStrVal; @@ -115,13 +116,13 @@ public: } SMLoc getLoc() const; - + private: /// LexToken - Read the next token and return its code. tgtok::TokKind LexToken(); - + tgtok::TokKind ReturnError(const char *Loc, const Twine &Msg); - + int getNextChar(); int peekNextChar(int Index); void SkipBCPLComment(); @@ -134,7 +135,7 @@ private: tgtok::TokKind LexBracket(); tgtok::TokKind LexExclaim(); }; - + } // end namespace llvm #endif |