Lines Matching refs:Lex
378 switch (Lex.getCode()) { in ParseObjectName()
413 if (Lex.getCode() != tgtok::Id) { in ParseClassID()
418 Record *Result = Records.getClass(Lex.getCurStrVal()); in ParseClassID()
420 TokError("Couldn't find class '" + Lex.getCurStrVal() + "'"); in ParseClassID()
422 Lex.Lex(); in ParseClassID()
432 if (Lex.getCode() != tgtok::Id) { in ParseMultiClassID()
437 MultiClass *Result = MultiClasses[Lex.getCurStrVal()].get(); in ParseMultiClassID()
439 TokError("Couldn't find multiclass '" + Lex.getCurStrVal() + "'"); in ParseMultiClassID()
441 Lex.Lex(); in ParseMultiClassID()
454 Result.RefRange.Start = Lex.getLoc(); in ParseSubClassReference()
465 if (Lex.getCode() != tgtok::less) { in ParseSubClassReference()
466 Result.RefRange.End = Lex.getLoc(); in ParseSubClassReference()
469 Lex.Lex(); // Eat the '<' in ParseSubClassReference()
471 if (Lex.getCode() == tgtok::greater) { in ParseSubClassReference()
483 if (Lex.getCode() != tgtok::greater) { in ParseSubClassReference()
488 Lex.Lex(); in ParseSubClassReference()
489 Result.RefRange.End = Lex.getLoc(); in ParseSubClassReference()
504 Result.RefRange.Start = Lex.getLoc(); in ParseSubMultiClassReference()
510 if (Lex.getCode() != tgtok::less) { in ParseSubMultiClassReference()
511 Result.RefRange.End = Lex.getLoc(); in ParseSubMultiClassReference()
514 Lex.Lex(); // Eat the '<' in ParseSubMultiClassReference()
516 if (Lex.getCode() == tgtok::greater) { in ParseSubMultiClassReference()
528 if (Lex.getCode() != tgtok::greater) { in ParseSubMultiClassReference()
533 Lex.Lex(); in ParseSubMultiClassReference()
534 Result.RefRange.End = Lex.getLoc(); in ParseSubMultiClassReference()
544 if (Lex.getCode() != tgtok::IntVal) { in ParseRangePiece()
548 int64_t Start = Lex.getCurIntVal(); in ParseRangePiece()
554 switch (Lex.Lex()) { // eat first character. in ParseRangePiece()
559 if (Lex.Lex() != tgtok::IntVal) { in ParseRangePiece()
563 End = Lex.getCurIntVal(); in ParseRangePiece()
566 End = -Lex.getCurIntVal(); in ParseRangePiece()
571 Lex.Lex(); in ParseRangePiece()
593 while (Lex.getCode() == tgtok::comma) { in ParseRangeList()
594 Lex.Lex(); // Eat the comma. in ParseRangeList()
607 if (Lex.getCode() != tgtok::less) in ParseOptionalRangeList()
610 SMLoc StartLoc = Lex.getLoc(); in ParseOptionalRangeList()
611 Lex.Lex(); // eat the '<' in ParseOptionalRangeList()
617 if (Lex.getCode() != tgtok::greater) { in ParseOptionalRangeList()
621 Lex.Lex(); // eat the '>'. in ParseOptionalRangeList()
629 if (Lex.getCode() != tgtok::l_brace) in ParseOptionalBitList()
632 SMLoc StartLoc = Lex.getLoc(); in ParseOptionalBitList()
633 Lex.Lex(); // eat the '{' in ParseOptionalBitList()
639 if (Lex.getCode() != tgtok::r_brace) { in ParseOptionalBitList()
643 Lex.Lex(); // eat the '}'. in ParseOptionalBitList()
660 switch (Lex.getCode()) { in ParseType()
662 case tgtok::String: Lex.Lex(); return StringRecTy::get(); in ParseType()
663 case tgtok::Code: Lex.Lex(); return CodeRecTy::get(); in ParseType()
664 case tgtok::Bit: Lex.Lex(); return BitRecTy::get(); in ParseType()
665 case tgtok::Int: Lex.Lex(); return IntRecTy::get(); in ParseType()
666 case tgtok::Dag: Lex.Lex(); return DagRecTy::get(); in ParseType()
671 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
675 if (Lex.Lex() != tgtok::IntVal) { // Eat '<' in ParseType()
679 uint64_t Val = Lex.getCurIntVal(); in ParseType()
680 if (Lex.Lex() != tgtok::greater) { // Eat count. in ParseType()
684 Lex.Lex(); // Eat '>' in ParseType()
688 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
692 Lex.Lex(); // Eat '<' in ParseType()
696 if (Lex.getCode() != tgtok::greater) { in ParseType()
700 Lex.Lex(); // Eat '>' in ParseType()
765 switch (Lex.getCode()) { in ParseOperation()
776 switch (Lex.getCode()) { in ParseOperation()
779 Lex.Lex(); // eat the operation in ParseOperation()
791 Lex.Lex(); // eat the operation in ParseOperation()
795 Lex.Lex(); // eat the operation in ParseOperation()
799 Lex.Lex(); // eat the operation in ParseOperation()
804 if (Lex.getCode() != tgtok::l_paren) { in ParseOperation()
808 Lex.Lex(); // eat the '(' in ParseOperation()
863 if (Lex.getCode() != tgtok::r_paren) { in ParseOperation()
867 Lex.Lex(); // eat the ')' in ParseOperation()
880 tgtok::TokKind OpTok = Lex.getCode(); in ParseOperation()
881 SMLoc OpLoc = Lex.getLoc(); in ParseOperation()
882 Lex.Lex(); // eat the operation in ParseOperation()
906 if (Lex.getCode() != tgtok::l_paren) { in ParseOperation()
910 Lex.Lex(); // eat the '(' in ParseOperation()
917 while (Lex.getCode() == tgtok::comma) { in ParseOperation()
918 Lex.Lex(); // eat the ',' in ParseOperation()
924 if (Lex.getCode() != tgtok::r_paren) { in ParseOperation()
928 Lex.Lex(); // eat the ')' in ParseOperation()
968 tgtok::TokKind LexCode = Lex.getCode(); in ParseOperation()
969 Lex.Lex(); // eat the operation in ParseOperation()
982 if (Lex.getCode() != tgtok::l_paren) { in ParseOperation()
986 Lex.Lex(); // eat the '(' in ParseOperation()
991 if (Lex.getCode() != tgtok::comma) { in ParseOperation()
995 Lex.Lex(); // eat the ',' in ParseOperation()
1001 if (Lex.getCode() != tgtok::comma) { in ParseOperation()
1005 Lex.Lex(); // eat the ',' in ParseOperation()
1011 if (Lex.getCode() != tgtok::r_paren) { in ParseOperation()
1015 Lex.Lex(); // eat the ')' in ParseOperation()
1091 if (Lex.getCode() != tgtok::less) { in ParseOperatorType()
1095 Lex.Lex(); // eat the < in ParseOperatorType()
1104 if (Lex.getCode() != tgtok::greater) { in ParseOperatorType()
1108 Lex.Lex(); // eat the > in ParseOperatorType()
1136 switch (Lex.getCode()) { in ParseSimpleValue()
1141 Lex.Lex(); // Skip '#'. in ParseSimpleValue()
1143 case tgtok::IntVal: R = IntInit::get(Lex.getCurIntVal()); Lex.Lex(); break; in ParseSimpleValue()
1145 auto BinaryVal = Lex.getCurBinaryIntVal(); in ParseSimpleValue()
1150 Lex.Lex(); in ParseSimpleValue()
1154 std::string Val = Lex.getCurStrVal(); in ParseSimpleValue()
1155 Lex.Lex(); in ParseSimpleValue()
1158 while (Lex.getCode() == tgtok::StrVal) { in ParseSimpleValue()
1159 Val += Lex.getCurStrVal(); in ParseSimpleValue()
1160 Lex.Lex(); in ParseSimpleValue()
1167 R = CodeInit::get(Lex.getCurStrVal()); in ParseSimpleValue()
1168 Lex.Lex(); in ParseSimpleValue()
1172 Lex.Lex(); in ParseSimpleValue()
1175 SMLoc NameLoc = Lex.getLoc(); in ParseSimpleValue()
1176 std::string Name = Lex.getCurStrVal(); in ParseSimpleValue()
1177 if (Lex.Lex() != tgtok::less) // consume the Id. in ParseSimpleValue()
1181 if (Lex.Lex() == tgtok::greater) { in ParseSimpleValue()
1198 if (Lex.getCode() != tgtok::greater) { in ParseSimpleValue()
1202 Lex.Lex(); // eat the '>' in ParseSimpleValue()
1203 SMLoc EndLoc = Lex.getLoc(); in ParseSimpleValue()
1252 SMLoc BraceLoc = Lex.getLoc(); in ParseSimpleValue()
1253 Lex.Lex(); // eat the '{' in ParseSimpleValue()
1256 if (Lex.getCode() != tgtok::r_brace) { in ParseSimpleValue()
1260 if (Lex.getCode() != tgtok::r_brace) { in ParseSimpleValue()
1264 Lex.Lex(); // eat the '}' in ParseSimpleValue()
1303 Lex.Lex(); // eat the '[' in ParseSimpleValue()
1319 if (Lex.getCode() != tgtok::r_square) { in ParseSimpleValue()
1324 if (Lex.getCode() != tgtok::r_square) { in ParseSimpleValue()
1328 Lex.Lex(); // eat the ']' in ParseSimpleValue()
1331 if (Lex.getCode() == tgtok::less) { in ParseSimpleValue()
1333 Lex.Lex(); // eat the '<' in ParseSimpleValue()
1341 if (Lex.getCode() != tgtok::greater) { in ParseSimpleValue()
1345 Lex.Lex(); // eat the '>' in ParseSimpleValue()
1398 Lex.Lex(); // eat the '(' in ParseSimpleValue()
1399 if (Lex.getCode() != tgtok::Id && Lex.getCode() != tgtok::XCast) { in ParseSimpleValue()
1409 if (Lex.getCode() == tgtok::colon) { in ParseSimpleValue()
1410 if (Lex.Lex() != tgtok::VarName) { // eat the ':' in ParseSimpleValue()
1414 OperatorName = Lex.getCurStrVal(); in ParseSimpleValue()
1415 Lex.Lex(); // eat the VarName. in ParseSimpleValue()
1419 if (Lex.getCode() != tgtok::r_paren) { in ParseSimpleValue()
1424 if (Lex.getCode() != tgtok::r_paren) { in ParseSimpleValue()
1428 Lex.Lex(); // eat the ')' in ParseSimpleValue()
1469 switch (Lex.getCode()) { in ParseValue()
1476 SMLoc CurlyLoc = Lex.getLoc(); in ParseValue()
1477 Lex.Lex(); // eat the '{' in ParseValue()
1490 if (Lex.getCode() != tgtok::r_brace) { in ParseValue()
1494 Lex.Lex(); in ParseValue()
1498 SMLoc SquareLoc = Lex.getLoc(); in ParseValue()
1499 Lex.Lex(); // eat the '[' in ParseValue()
1510 if (Lex.getCode() != tgtok::r_square) { in ParseValue()
1514 Lex.Lex(); in ParseValue()
1518 if (Lex.Lex() != tgtok::Id) { // eat the . in ParseValue()
1522 if (!Result->getFieldType(Lex.getCurStrVal())) { in ParseValue()
1523 TokError("Cannot access field '" + Lex.getCurStrVal() + "' of value '" + in ParseValue()
1527 Result = FieldInit::get(Result, Lex.getCurStrVal()); in ParseValue()
1528 Lex.Lex(); // eat field name in ParseValue()
1532 SMLoc PasteLoc = Lex.getLoc(); in ParseValue()
1549 Lex.Lex(); // Eat the '#'. in ParseValue()
1550 switch (Lex.getCode()) { in ParseValue()
1596 if (Lex.getCode() == tgtok::VarName) { in ParseDagArgList()
1598 Result.emplace_back(UnsetInit::get(), Lex.getCurStrVal()); in ParseDagArgList()
1599 Lex.Lex(); in ParseDagArgList()
1608 if (Lex.getCode() == tgtok::colon) { in ParseDagArgList()
1609 if (Lex.Lex() != tgtok::VarName) { // eat the ':' in ParseDagArgList()
1613 VarName = Lex.getCurStrVal(); in ParseDagArgList()
1614 Lex.Lex(); // eat the VarName. in ParseDagArgList()
1619 if (Lex.getCode() != tgtok::comma) break; in ParseDagArgList()
1620 Lex.Lex(); // eat the ',' in ParseDagArgList()
1656 while (Lex.getCode() == tgtok::comma) { in ParseValueList()
1657 Lex.Lex(); // Eat the comma in ParseValueList()
1691 bool HasField = Lex.getCode() == tgtok::Field; in ParseDeclaration()
1692 if (HasField) Lex.Lex(); in ParseDeclaration()
1697 if (Lex.getCode() != tgtok::Id) { in ParseDeclaration()
1702 SMLoc IdLoc = Lex.getLoc(); in ParseDeclaration()
1703 Init *DeclName = StringInit::get(Lex.getCurStrVal()); in ParseDeclaration()
1704 Lex.Lex(); in ParseDeclaration()
1721 if (Lex.getCode() == tgtok::equal) { in ParseDeclaration()
1722 Lex.Lex(); in ParseDeclaration()
1723 SMLoc ValLoc = Lex.getLoc(); in ParseDeclaration()
1745 if (Lex.getCode() != tgtok::Id) { in ParseForeachDeclaration()
1750 Init *DeclName = StringInit::get(Lex.getCurStrVal()); in ParseForeachDeclaration()
1751 Lex.Lex(); in ParseForeachDeclaration()
1754 if (Lex.getCode() != tgtok::equal) { in ParseForeachDeclaration()
1758 Lex.Lex(); // Eat the '=' in ParseForeachDeclaration()
1763 switch (Lex.getCode()) { in ParseForeachDeclaration()
1789 Lex.Lex(); // eat the '{' in ParseForeachDeclaration()
1791 if (Lex.getCode() != tgtok::r_brace) { in ParseForeachDeclaration()
1795 Lex.Lex(); in ParseForeachDeclaration()
1823 assert(Lex.getCode() == tgtok::less && "Not a template arg list!"); in ParseTemplateArgList()
1824 Lex.Lex(); // eat the '<' in ParseTemplateArgList()
1835 while (Lex.getCode() == tgtok::comma) { in ParseTemplateArgList()
1836 Lex.Lex(); // eat the ',' in ParseTemplateArgList()
1845 if (Lex.getCode() != tgtok::greater) in ParseTemplateArgList()
1847 Lex.Lex(); // eat the '>'. in ParseTemplateArgList()
1857 if (Lex.getCode() != tgtok::Let) { in ParseBodyItem()
1861 if (Lex.getCode() != tgtok::semi) in ParseBodyItem()
1863 Lex.Lex(); in ParseBodyItem()
1868 if (Lex.Lex() != tgtok::Id) in ParseBodyItem()
1871 SMLoc IdLoc = Lex.getLoc(); in ParseBodyItem()
1872 std::string FieldName = Lex.getCurStrVal(); in ParseBodyItem()
1873 Lex.Lex(); // eat the field name. in ParseBodyItem()
1880 if (Lex.getCode() != tgtok::equal) in ParseBodyItem()
1882 Lex.Lex(); // eat the '='. in ParseBodyItem()
1893 if (Lex.getCode() != tgtok::semi) in ParseBodyItem()
1895 Lex.Lex(); in ParseBodyItem()
1909 if (Lex.getCode() == tgtok::semi) { in ParseBody()
1910 Lex.Lex(); in ParseBody()
1914 if (Lex.getCode() != tgtok::l_brace) in ParseBody()
1917 Lex.Lex(); in ParseBody()
1919 while (Lex.getCode() != tgtok::r_brace) in ParseBody()
1924 Lex.Lex(); in ParseBody()
1949 if (Lex.getCode() == tgtok::colon) { in ParseObjectBody()
1950 Lex.Lex(); in ParseObjectBody()
1962 if (Lex.getCode() != tgtok::comma) break; in ParseObjectBody()
1963 Lex.Lex(); // eat ','. in ParseObjectBody()
1980 SMLoc DefLoc = Lex.getLoc(); in ParseDef()
1981 assert(Lex.getCode() == tgtok::Def && "Unknown tok"); in ParseDef()
1982 Lex.Lex(); // Eat the 'def' token. in ParseDef()
2056 assert(Lex.getCode() == tgtok::Foreach && "Unknown tok"); in ParseForeach()
2057 Lex.Lex(); // Eat the 'for' token. in ParseForeach()
2066 if (Lex.getCode() != tgtok::In) in ParseForeach()
2068 Lex.Lex(); // Eat the in in ParseForeach()
2073 if (Lex.getCode() != tgtok::l_brace) { in ParseForeach()
2078 SMLoc BraceLoc = Lex.getLoc(); in ParseForeach()
2080 Lex.Lex(); // eat the '{'. in ParseForeach()
2086 if (Lex.getCode() != tgtok::r_brace) { in ParseForeach()
2090 Lex.Lex(); // Eat the } in ParseForeach()
2104 assert(Lex.getCode() == tgtok::Class && "Unexpected token!"); in ParseClass()
2105 Lex.Lex(); in ParseClass()
2107 if (Lex.getCode() != tgtok::Id) in ParseClass()
2110 Record *CurRec = Records.getClass(Lex.getCurStrVal()); in ParseClass()
2121 llvm::make_unique<Record>(Lex.getCurStrVal(), Lex.getLoc(), Records); in ParseClass()
2125 Lex.Lex(); // eat the name. in ParseClass()
2128 if (Lex.getCode() == tgtok::less) in ParseClass()
2146 if (Lex.getCode() != tgtok::Id) { in ParseLetList()
2150 std::string Name = Lex.getCurStrVal(); in ParseLetList()
2151 SMLoc NameLoc = Lex.getLoc(); in ParseLetList()
2152 Lex.Lex(); // Eat the identifier. in ParseLetList()
2160 if (Lex.getCode() != tgtok::equal) { in ParseLetList()
2164 Lex.Lex(); // eat the '='. in ParseLetList()
2172 if (Lex.getCode() != tgtok::comma) in ParseLetList()
2174 Lex.Lex(); // eat the comma. in ParseLetList()
2185 assert(Lex.getCode() == tgtok::Let && "Unexpected token"); in ParseTopLevelLet()
2186 Lex.Lex(); in ParseTopLevelLet()
2193 if (Lex.getCode() != tgtok::In) in ParseTopLevelLet()
2195 Lex.Lex(); in ParseTopLevelLet()
2198 if (Lex.getCode() != tgtok::l_brace) { in ParseTopLevelLet()
2203 SMLoc BraceLoc = Lex.getLoc(); in ParseTopLevelLet()
2205 Lex.Lex(); // eat the '{'. in ParseTopLevelLet()
2211 if (Lex.getCode() != tgtok::r_brace) { in ParseTopLevelLet()
2215 Lex.Lex(); in ParseTopLevelLet()
2234 assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token"); in ParseMultiClass()
2235 Lex.Lex(); // Eat the multiclass token. in ParseMultiClass()
2237 if (Lex.getCode() != tgtok::Id) in ParseMultiClass()
2239 std::string Name = Lex.getCurStrVal(); in ParseMultiClass()
2243 llvm::make_unique<MultiClass>(Name, Lex.getLoc(),Records))); in ParseMultiClass()
2249 Lex.Lex(); // Eat the identifier. in ParseMultiClass()
2252 if (Lex.getCode() == tgtok::less) in ParseMultiClass()
2259 if (Lex.getCode() == tgtok::colon) { in ParseMultiClass()
2262 Lex.Lex(); in ParseMultiClass()
2275 if (Lex.getCode() != tgtok::comma) break; in ParseMultiClass()
2276 Lex.Lex(); // eat ','. in ParseMultiClass()
2281 if (Lex.getCode() != tgtok::l_brace) { in ParseMultiClass()
2284 if (Lex.getCode() != tgtok::semi) in ParseMultiClass()
2286 Lex.Lex(); // eat the ';'. in ParseMultiClass()
2288 if (Lex.Lex() == tgtok::r_brace) // eat the '{'. in ParseMultiClass()
2291 while (Lex.getCode() != tgtok::r_brace) { in ParseMultiClass()
2292 switch (Lex.getCode()) { in ParseMultiClass()
2304 Lex.Lex(); // eat the '}'. in ParseMultiClass()
2387 Lex.getLoc(), TArgs, TemplateVals, in InstantiateMulticlassDef()
2498 assert(Lex.getCode() == tgtok::Defm && "Unexpected token!"); in ParseDefm()
2499 SMLoc DefmLoc = Lex.getLoc(); in ParseDefm()
2502 if (Lex.Lex() == tgtok::Id) { // eat the defm. in ParseDefm()
2506 SMLoc DefmPrefixEndLoc = Lex.getLoc(); in ParseDefm()
2507 if (Lex.getCode() != tgtok::colon) in ParseDefm()
2517 Lex.Lex(); in ParseDefm()
2519 SMLoc SubClassLoc = Lex.getLoc(); in ParseDefm()
2570 if (Lex.getCode() != tgtok::comma) break; in ParseDefm()
2571 Lex.Lex(); // eat ','. in ParseDefm()
2573 if (Lex.getCode() != tgtok::Id) in ParseDefm()
2576 SubClassLoc = Lex.getLoc(); in ParseDefm()
2580 InheritFromClass = (Records.getClass(Lex.getCurStrVal()) != nullptr); in ParseDefm()
2607 if (Lex.getCode() != tgtok::comma) break; in ParseDefm()
2608 Lex.Lex(); // eat ','. in ParseDefm()
2620 if (Lex.getCode() != tgtok::semi) in ParseDefm()
2622 Lex.Lex(); in ParseDefm()
2635 switch (Lex.getCode()) { in ParseObject()
2650 while (isObjectStart(Lex.getCode())) { in ParseObjectList()
2658 Lex.Lex(); // Prime the lexer. in ParseFile()
2662 if (Lex.getCode() == tgtok::Eof) in ParseFile()