Lines Matching refs:Lex

395   switch (Lex.getCode()) {
430 if (Lex.getCode() != tgtok::Id) {
435 Record *Result = Records.getClass(Lex.getCurStrVal());
437 TokError("Couldn't find class '" + Lex.getCurStrVal() + "'");
439 Lex.Lex();
449 if (Lex.getCode() != tgtok::Id) {
454 MultiClass *Result = MultiClasses[Lex.getCurStrVal()];
456 TokError("Couldn't find multiclass '" + Lex.getCurStrVal() + "'");
458 Lex.Lex();
471 Result.RefRange.Start = Lex.getLoc();
482 if (Lex.getCode() != tgtok::less) {
483 Result.RefRange.End = Lex.getLoc();
486 Lex.Lex(); // Eat the '<'
488 if (Lex.getCode() == tgtok::greater) {
500 if (Lex.getCode() != tgtok::greater) {
505 Lex.Lex();
506 Result.RefRange.End = Lex.getLoc();
521 Result.RefRange.Start = Lex.getLoc();
527 if (Lex.getCode() != tgtok::less) {
528 Result.RefRange.End = Lex.getLoc();
531 Lex.Lex(); // Eat the '<'
533 if (Lex.getCode() == tgtok::greater) {
545 if (Lex.getCode() != tgtok::greater) {
550 Lex.Lex();
551 Result.RefRange.End = Lex.getLoc();
561 if (Lex.getCode() != tgtok::IntVal) {
565 int64_t Start = Lex.getCurIntVal();
571 switch (Lex.Lex()) { // eat first character.
576 if (Lex.Lex() != tgtok::IntVal) {
580 End = Lex.getCurIntVal();
583 End = -Lex.getCurIntVal();
588 Lex.Lex();
611 while (Lex.getCode() == tgtok::comma) {
612 Lex.Lex(); // Eat the comma.
625 if (Lex.getCode() != tgtok::less)
628 SMLoc StartLoc = Lex.getLoc();
629 Lex.Lex(); // eat the '<'
635 if (Lex.getCode() != tgtok::greater) {
639 Lex.Lex(); // eat the '>'.
647 if (Lex.getCode() != tgtok::l_brace)
650 SMLoc StartLoc = Lex.getLoc();
651 Lex.Lex(); // eat the '{'
657 if (Lex.getCode() != tgtok::r_brace) {
661 Lex.Lex(); // eat the '}'.
678 switch (Lex.getCode()) {
680 case tgtok::String: Lex.Lex(); return StringRecTy::get();
681 case tgtok::Code: Lex.Lex(); return StringRecTy::get();
682 case tgtok::Bit: Lex.Lex(); return BitRecTy::get();
683 case tgtok::Int: Lex.Lex(); return IntRecTy::get();
684 case tgtok::Dag: Lex.Lex(); return DagRecTy::get();
689 if (Lex.Lex() != tgtok::less) { // Eat 'bits'
693 if (Lex.Lex() != tgtok::IntVal) { // Eat '<'
697 uint64_t Val = Lex.getCurIntVal();
698 if (Lex.Lex() != tgtok::greater) { // Eat count.
702 Lex.Lex(); // Eat '>'
706 if (Lex.Lex() != tgtok::less) { // Eat 'bits'
710 Lex.Lex(); // Eat '<'
714 if (Lex.getCode() != tgtok::greater) {
718 Lex.Lex(); // Eat '>'
733 assert(Lex.getCode() == tgtok::Id && "Expected ID in ParseIDValue");
734 std::string Name = Lex.getCurStrVal();
735 SMLoc Loc = Lex.getLoc();
736 Lex.Lex();
801 switch (Lex.getCode()) {
812 switch (Lex.getCode()) {
815 Lex.Lex(); // eat the operation
827 Lex.Lex(); // eat the operation
831 Lex.Lex(); // eat the operation
835 Lex.Lex(); // eat the operation
840 if (Lex.getCode() != tgtok::l_paren) {
844 Lex.Lex(); // eat the '('
907 if (Lex.getCode() != tgtok::r_paren) {
911 Lex.Lex(); // eat the ')'
922 tgtok::TokKind OpTok = Lex.getCode();
923 SMLoc OpLoc = Lex.getLoc();
924 Lex.Lex(); // eat the operation
943 if (Lex.getCode() != tgtok::l_paren) {
947 Lex.Lex(); // eat the '('
954 while (Lex.getCode() == tgtok::comma) {
955 Lex.Lex(); // eat the ','
961 if (Lex.getCode() != tgtok::r_paren) {
965 Lex.Lex(); // eat the ')'
992 tgtok::TokKind LexCode = Lex.getCode();
993 Lex.Lex(); // eat the operation
1006 if (Lex.getCode() != tgtok::l_paren) {
1010 Lex.Lex(); // eat the '('
1015 if (Lex.getCode() != tgtok::comma) {
1019 Lex.Lex(); // eat the ','
1024 if (Lex.getCode() != tgtok::comma) {
1028 Lex.Lex(); // eat the ','
1033 if (Lex.getCode() != tgtok::r_paren) {
1037 Lex.Lex(); // eat the ')'
1113 if (Lex.getCode() != tgtok::less) {
1117 Lex.Lex(); // eat the <
1126 if (Lex.getCode() != tgtok::greater) {
1130 Lex.Lex(); // eat the >
1157 switch (Lex.getCode()) {
1162 Lex.Lex(); // Skip '#'.
1164 case tgtok::IntVal: R = IntInit::get(Lex.getCurIntVal()); Lex.Lex(); break;
1166 std::string Val = Lex.getCurStrVal();
1167 Lex.Lex();
1170 while (Lex.getCode() == tgtok::StrVal) {
1171 Val += Lex.getCurStrVal();
1172 Lex.Lex();
1179 R = StringInit::get(Lex.getCurStrVal());
1180 Lex.Lex();
1184 Lex.Lex();
1187 SMLoc NameLoc = Lex.getLoc();
1188 std::string Name = Lex.getCurStrVal();
1189 if (Lex.Lex() != tgtok::less) // consume the Id.
1193 if (Lex.Lex() == tgtok::greater) {
1210 if (Lex.getCode() != tgtok::greater) {
1214 Lex.Lex(); // eat the '>'
1215 SMLoc EndLoc = Lex.getLoc();
1237 SMLoc BraceLoc = Lex.getLoc();
1238 Lex.Lex(); // eat the '{'
1241 if (Lex.getCode() != tgtok::r_brace) {
1245 if (Lex.getCode() != tgtok::r_brace) {
1249 Lex.Lex(); // eat the '}'
1265 Lex.Lex(); // eat the '['
1284 if (Lex.getCode() != tgtok::r_square) {
1289 if (Lex.getCode() != tgtok::r_square) {
1293 Lex.Lex(); // eat the ']'
1296 if (Lex.getCode() == tgtok::less) {
1298 Lex.Lex(); // eat the '<'
1306 if (Lex.getCode() != tgtok::greater) {
1310 Lex.Lex(); // eat the '>'
1365 Lex.Lex(); // eat the '('
1366 if (Lex.getCode() != tgtok::Id && Lex.getCode() != tgtok::XCast) {
1376 if (Lex.getCode() == tgtok::colon) {
1377 if (Lex.Lex() != tgtok::VarName) { // eat the ':'
1381 OperatorName = Lex.getCurStrVal();
1382 Lex.Lex(); // eat the VarName.
1386 if (Lex.getCode() != tgtok::r_paren) {
1391 if (Lex.getCode() != tgtok::r_paren) {
1395 Lex.Lex(); // eat the ')'
1434 switch (Lex.getCode()) {
1441 SMLoc CurlyLoc = Lex.getLoc();
1442 Lex.Lex(); // eat the '{'
1455 if (Lex.getCode() != tgtok::r_brace) {
1459 Lex.Lex();
1463 SMLoc SquareLoc = Lex.getLoc();
1464 Lex.Lex(); // eat the '['
1475 if (Lex.getCode() != tgtok::r_square) {
1479 Lex.Lex();
1483 if (Lex.Lex() != tgtok::Id) { // eat the .
1487 if (!Result->getFieldType(Lex.getCurStrVal())) {
1488 TokError("Cannot access field '" + Lex.getCurStrVal() + "' of value '" +
1492 Result = FieldInit::get(Result, Lex.getCurStrVal());
1493 Lex.Lex(); // eat field name
1497 SMLoc PasteLoc = Lex.getLoc();
1514 Lex.Lex(); // Eat the '#'.
1515 switch (Lex.getCode()) {
1561 if (Lex.getCode() == tgtok::VarName) {
1563 Result.push_back(std::make_pair(UnsetInit::get(), Lex.getCurStrVal()));
1564 Lex.Lex();
1573 if (Lex.getCode() == tgtok::colon) {
1574 if (Lex.Lex() != tgtok::VarName) { // eat the ':'
1578 VarName = Lex.getCurStrVal();
1579 Lex.Lex(); // eat the VarName.
1584 if (Lex.getCode() != tgtok::comma) break;
1585 Lex.Lex(); // eat the ','
1621 while (Lex.getCode() == tgtok::comma) {
1622 Lex.Lex(); // Eat the comma
1656 bool HasField = Lex.getCode() == tgtok::Field;
1657 if (HasField) Lex.Lex();
1662 if (Lex.getCode() != tgtok::Id) {
1667 SMLoc IdLoc = Lex.getLoc();
1668 Init *DeclName = StringInit::get(Lex.getCurStrVal());
1669 Lex.Lex();
1687 if (Lex.getCode() == tgtok::equal) {
1688 Lex.Lex();
1689 SMLoc ValLoc = Lex.getLoc();
1708 if (Lex.getCode() != tgtok::Id) {
1713 Init *DeclName = StringInit::get(Lex.getCurStrVal());
1714 Lex.Lex();
1717 if (Lex.getCode() != tgtok::equal) {
1721 Lex.Lex(); // Eat the '='
1726 switch (Lex.getCode()) {
1752 Lex.Lex(); // eat the '{'
1754 if (Lex.getCode() != tgtok::r_brace) {
1758 Lex.Lex();
1786 assert(Lex.getCode() == tgtok::less && "Not a template arg list!");
1787 Lex.Lex(); // eat the '<'
1798 while (Lex.getCode() == tgtok::comma) {
1799 Lex.Lex(); // eat the ','
1808 if (Lex.getCode() != tgtok::greater)
1810 Lex.Lex(); // eat the '>'.
1820 if (Lex.getCode() != tgtok::Let) {
1824 if (Lex.getCode() != tgtok::semi)
1826 Lex.Lex();
1831 if (Lex.Lex() != tgtok::Id)
1834 SMLoc IdLoc = Lex.getLoc();
1835 std::string FieldName = Lex.getCurStrVal();
1836 Lex.Lex(); // eat the field name.
1843 if (Lex.getCode() != tgtok::equal)
1845 Lex.Lex(); // eat the '='.
1856 if (Lex.getCode() != tgtok::semi)
1858 Lex.Lex();
1872 if (Lex.getCode() == tgtok::semi) {
1873 Lex.Lex();
1877 if (Lex.getCode() != tgtok::l_brace)
1880 Lex.Lex();
1882 while (Lex.getCode() != tgtok::r_brace)
1887 Lex.Lex();
1913 if (Lex.getCode() == tgtok::colon) {
1914 Lex.Lex();
1926 if (Lex.getCode() != tgtok::comma) break;
1927 Lex.Lex(); // eat ','.
1944 SMLoc DefLoc = Lex.getLoc();
1945 assert(Lex.getCode() == tgtok::Def && "Unknown tok");
1946 Lex.Lex(); // Eat the 'def' token.
2019 assert(Lex.getCode() == tgtok::Foreach && "Unknown tok");
2020 Lex.Lex(); // Eat the 'for' token.
2029 if (Lex.getCode() != tgtok::In)
2031 Lex.Lex(); // Eat the in
2036 if (Lex.getCode() != tgtok::l_brace) {
2042 SMLoc BraceLoc = Lex.getLoc();
2044 Lex.Lex(); // eat the '{'.
2050 if (Lex.getCode() != tgtok::r_brace) {
2054 Lex.Lex(); // Eat the }
2068 assert(Lex.getCode() == tgtok::Class && "Unexpected token!");
2069 Lex.Lex();
2071 if (Lex.getCode() != tgtok::Id)
2074 Record *CurRec = Records.getClass(Lex.getCurStrVal());
2084 CurRec = new Record(Lex.getCurStrVal(), Lex.getLoc(), Records);
2087 Lex.Lex(); // eat the name.
2090 if (Lex.getCode() == tgtok::less)
2108 if (Lex.getCode() != tgtok::Id) {
2112 std::string Name = Lex.getCurStrVal();
2113 SMLoc NameLoc = Lex.getLoc();
2114 Lex.Lex(); // Eat the identifier.
2122 if (Lex.getCode() != tgtok::equal) {
2126 Lex.Lex(); // eat the '='.
2134 if (Lex.getCode() != tgtok::comma)
2136 Lex.Lex(); // eat the comma.
2147 assert(Lex.getCode() == tgtok::Let && "Unexpected token");
2148 Lex.Lex();
2155 if (Lex.getCode() != tgtok::In)
2157 Lex.Lex();
2160 if (Lex.getCode() != tgtok::l_brace) {
2165 SMLoc BraceLoc = Lex.getLoc();
2167 Lex.Lex(); // eat the '{'.
2173 if (Lex.getCode() != tgtok::r_brace) {
2177 Lex.Lex();
2196 assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token");
2197 Lex.Lex(); // Eat the multiclass token.
2199 if (Lex.getCode() != tgtok::Id)
2201 std::string Name = Lex.getCurStrVal();
2207 Lex.getLoc(), Records);
2208 Lex.Lex(); // Eat the identifier.
2211 if (Lex.getCode() == tgtok::less)
2218 if (Lex.getCode() == tgtok::colon) {
2221 Lex.Lex();
2234 if (Lex.getCode() != tgtok::comma) break;
2235 Lex.Lex(); // eat ','.
2240 if (Lex.getCode() != tgtok::l_brace) {
2243 else if (Lex.getCode() != tgtok::semi)
2246 Lex.Lex(); // eat the ';'.
2248 if (Lex.Lex() == tgtok::r_brace) // eat the '{'.
2251 while (Lex.getCode() != tgtok::r_brace) {
2252 switch (Lex.getCode()) {
2264 Lex.Lex(); // eat the '}'.
2435 assert(Lex.getCode() == tgtok::Defm && "Unexpected token!");
2436 SMLoc DefmLoc = Lex.getLoc();
2439 if (Lex.Lex() == tgtok::Id) { // eat the defm.
2443 SMLoc DefmPrefixEndLoc = Lex.getLoc();
2444 if (Lex.getCode() != tgtok::colon)
2454 Lex.Lex();
2456 SMLoc SubClassLoc = Lex.getLoc();
2496 if (Lex.getCode() != tgtok::comma) break;
2497 Lex.Lex(); // eat ','.
2499 SubClassLoc = Lex.getLoc();
2503 InheritFromClass = (Records.getClass(Lex.getCurStrVal()) != 0);
2532 if (Lex.getCode() != tgtok::comma) break;
2533 Lex.Lex(); // eat ','.
2545 if (Lex.getCode() != tgtok::semi)
2547 Lex.Lex();
2560 switch (Lex.getCode()) {
2575 while (isObjectStart(Lex.getCode())) {
2583 Lex.Lex(); // Prime the lexer.
2587 if (Lex.getCode() == tgtok::Eof)