Home | History | Annotate | Download | only in TableGen

Lines Matching refs:tgtok

43 /// location.  This is defined to always return tgtok::Error.
44 tgtok::TokKind TGLexer::ReturnError(const char *Loc, const Twine &Msg) {
46 return tgtok::Error;
90 tgtok::TokKind TGLexer::LexToken() {
103 case EOF: return tgtok::Eof;
104 case ':': return tgtok::colon;
105 case ';': return tgtok::semi;
106 case '.': return tgtok::period;
107 case ',': return tgtok::comma;
108 case '<': return tgtok::less;
109 case '>': return tgtok::greater;
110 case ']': return tgtok::r_square;
111 case '{': return tgtok::l_brace;
112 case '}': return tgtok::r_brace;
113 case '(': return tgtok::l_paren;
114 case ')': return tgtok::r_paren;
115 case '=': return tgtok::equal;
116 case '?': return tgtok::question;
117 case '#': return tgtok::paste;
133 return tgtok::Error;
185 tgtok::TokKind TGLexer::LexString() {
234 return tgtok::StrVal;
237 tgtok::TokKind TGLexer::LexVarName() {
248 return tgtok::VarName;
251 tgtok::TokKind TGLexer::LexIdentifier() {
263 if (LexInclude()) return tgtok::Error;
267 tgtok::TokKind Kind = StringSwitch<tgtok::TokKind>(Str)
268 .Case("int", tgtok::Int)
269 .Case("bit", tgtok::Bit)
270 .Case("bits", tgtok::Bits)
271 .Case("string", tgtok::String)
272 .Case("list", tgtok::List)
273 .Case("code", tgtok::Code)
274 .Case("dag", tgtok::Dag)
275 .Case("class", tgtok::Class)
276 .Case("def", tgtok::Def)
277 .Case("foreach", tgtok::Foreach)
278 .Case("defm", tgtok::Defm)
279 .Case("defset", tgtok::Defset)
280 .Case("multiclass", tgtok::MultiClass)
281 .Case("field", tgtok::Field)
282 .Case("let", tgtok::Let)
283 .Case("in", tgtok::In)
284 .Default(tgtok::Id);
286 if (Kind == tgtok::Id)
295 tgtok::TokKind Tok = LexToken();
296 if (Tok == tgtok::Error) return true;
297 if (Tok != tgtok::StrVal) {
380 tgtok::TokKind TGLexer::LexNumber() {
404 return tgtok::IntVal;
415 return tgtok::BinaryIntVal;
422 return tgtok::minus;
424 return tgtok::plus;
430 return tgtok::IntVal;
435 tgtok::TokKind TGLexer::LexBracket() {
437 return tgtok::l_square;
450 return tgtok::CodeFragment;
458 tgtok::TokKind TGLexer::LexExclaim() {
467 tgtok::TokKind Kind =
468 StringSwitch<tgtok::TokKind>(StringRef(Start, CurPtr - Start))
469 .Case("eq", tgtok::XEq)
470 .Case("ne", tgtok::XNe)
471 .Case("le", tgtok::XLe)
472 .Case("lt", tgtok::XLt)
473 .Case("ge", tgtok::XGe)
474 .Case("gt", tgtok::XGt)
475 .Case("if", tgtok::XIf)
476 .Case("isa", tgtok::XIsA)
477 .Case("head", tgtok::XHead)
478 .Case("tail", tgtok::XTail)
479 .Case("size", tgtok::XSize)
480 .Case("con", tgtok::XConcat)
481 .Case("dag", tgtok::XDag)
482 .Case("add", tgtok::XADD)
483 .Case("and", tgtok::XAND)
484 .Case("or", tgtok::XOR)
485 .Case("shl", tgtok::XSHL)
486 .Case("sra", tgtok::XSRA)
487 .Case("srl", tgtok::XSRL)
488 .Case("cast", tgtok::XCast)
489 .Case("empty", tgtok::XEmpty)
490 .Case("subst", tgtok::XSubst)
491 .Case("foldl", tgtok::XFoldl)
492 .Case("foreach", tgtok::XForEach)
493 .Case("listconcat", tgtok::XListConcat)
494 .Case("strconcat", tgtok::XStrConcat)
495 .Default(tgtok::Error);
497 return Kind != tgtok::Error ? Kind : ReturnError(Start-1, "Unknown operator");