Lines Matching refs:Lex

398   switch (Lex.getCode()) {  in ParseObjectName()
433 if (Lex.getCode() != tgtok::Id) { in ParseClassID()
438 Record *Result = Records.getClass(Lex.getCurStrVal()); in ParseClassID()
440 TokError("Couldn't find class '" + Lex.getCurStrVal() + "'"); in ParseClassID()
442 Lex.Lex(); in ParseClassID()
452 if (Lex.getCode() != tgtok::Id) { in ParseMultiClassID()
457 MultiClass *Result = MultiClasses[Lex.getCurStrVal()].get(); in ParseMultiClassID()
459 TokError("Couldn't find multiclass '" + Lex.getCurStrVal() + "'"); in ParseMultiClassID()
461 Lex.Lex(); in ParseMultiClassID()
474 Result.RefRange.Start = Lex.getLoc(); in ParseSubClassReference()
485 if (Lex.getCode() != tgtok::less) { in ParseSubClassReference()
486 Result.RefRange.End = Lex.getLoc(); in ParseSubClassReference()
489 Lex.Lex(); // Eat the '<' in ParseSubClassReference()
491 if (Lex.getCode() == tgtok::greater) { in ParseSubClassReference()
503 if (Lex.getCode() != tgtok::greater) { in ParseSubClassReference()
508 Lex.Lex(); in ParseSubClassReference()
509 Result.RefRange.End = Lex.getLoc(); in ParseSubClassReference()
524 Result.RefRange.Start = Lex.getLoc(); in ParseSubMultiClassReference()
530 if (Lex.getCode() != tgtok::less) { in ParseSubMultiClassReference()
531 Result.RefRange.End = Lex.getLoc(); in ParseSubMultiClassReference()
534 Lex.Lex(); // Eat the '<' in ParseSubMultiClassReference()
536 if (Lex.getCode() == tgtok::greater) { in ParseSubMultiClassReference()
548 if (Lex.getCode() != tgtok::greater) { in ParseSubMultiClassReference()
553 Lex.Lex(); in ParseSubMultiClassReference()
554 Result.RefRange.End = Lex.getLoc(); in ParseSubMultiClassReference()
564 if (Lex.getCode() != tgtok::IntVal) { in ParseRangePiece()
568 int64_t Start = Lex.getCurIntVal(); in ParseRangePiece()
574 switch (Lex.Lex()) { // eat first character. in ParseRangePiece()
579 if (Lex.Lex() != tgtok::IntVal) { in ParseRangePiece()
583 End = Lex.getCurIntVal(); in ParseRangePiece()
586 End = -Lex.getCurIntVal(); in ParseRangePiece()
591 Lex.Lex(); in ParseRangePiece()
614 while (Lex.getCode() == tgtok::comma) { in ParseRangeList()
615 Lex.Lex(); // Eat the comma. in ParseRangeList()
628 if (Lex.getCode() != tgtok::less) in ParseOptionalRangeList()
631 SMLoc StartLoc = Lex.getLoc(); in ParseOptionalRangeList()
632 Lex.Lex(); // eat the '<' in ParseOptionalRangeList()
638 if (Lex.getCode() != tgtok::greater) { in ParseOptionalRangeList()
642 Lex.Lex(); // eat the '>'. in ParseOptionalRangeList()
650 if (Lex.getCode() != tgtok::l_brace) in ParseOptionalBitList()
653 SMLoc StartLoc = Lex.getLoc(); in ParseOptionalBitList()
654 Lex.Lex(); // eat the '{' in ParseOptionalBitList()
660 if (Lex.getCode() != tgtok::r_brace) { in ParseOptionalBitList()
664 Lex.Lex(); // eat the '}'. in ParseOptionalBitList()
681 switch (Lex.getCode()) { in ParseType()
683 case tgtok::String: Lex.Lex(); return StringRecTy::get(); in ParseType()
684 case tgtok::Code: Lex.Lex(); return StringRecTy::get(); in ParseType()
685 case tgtok::Bit: Lex.Lex(); return BitRecTy::get(); in ParseType()
686 case tgtok::Int: Lex.Lex(); return IntRecTy::get(); in ParseType()
687 case tgtok::Dag: Lex.Lex(); return DagRecTy::get(); in ParseType()
692 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
696 if (Lex.Lex() != tgtok::IntVal) { // Eat '<' in ParseType()
700 uint64_t Val = Lex.getCurIntVal(); in ParseType()
701 if (Lex.Lex() != tgtok::greater) { // Eat count. in ParseType()
705 Lex.Lex(); // Eat '>' in ParseType()
709 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
713 Lex.Lex(); // Eat '<' in ParseType()
717 if (Lex.getCode() != tgtok::greater) { in ParseType()
721 Lex.Lex(); // Eat '>' in ParseType()
788 switch (Lex.getCode()) { in ParseOperation()
799 switch (Lex.getCode()) { in ParseOperation()
802 Lex.Lex(); // eat the operation in ParseOperation()
814 Lex.Lex(); // eat the operation in ParseOperation()
818 Lex.Lex(); // eat the operation in ParseOperation()
822 Lex.Lex(); // eat the operation in ParseOperation()
827 if (Lex.getCode() != tgtok::l_paren) { in ParseOperation()
831 Lex.Lex(); // eat the '(' in ParseOperation()
894 if (Lex.getCode() != tgtok::r_paren) { in ParseOperation()
898 Lex.Lex(); // eat the ')' in ParseOperation()
911 tgtok::TokKind OpTok = Lex.getCode(); in ParseOperation()
912 SMLoc OpLoc = Lex.getLoc(); in ParseOperation()
913 Lex.Lex(); // eat the operation in ParseOperation()
937 if (Lex.getCode() != tgtok::l_paren) { in ParseOperation()
941 Lex.Lex(); // eat the '(' in ParseOperation()
948 while (Lex.getCode() == tgtok::comma) { in ParseOperation()
949 Lex.Lex(); // eat the ',' in ParseOperation()
955 if (Lex.getCode() != tgtok::r_paren) { in ParseOperation()
959 Lex.Lex(); // eat the ')' in ParseOperation()
999 tgtok::TokKind LexCode = Lex.getCode(); in ParseOperation()
1000 Lex.Lex(); // eat the operation in ParseOperation()
1013 if (Lex.getCode() != tgtok::l_paren) { in ParseOperation()
1017 Lex.Lex(); // eat the '(' in ParseOperation()
1022 if (Lex.getCode() != tgtok::comma) { in ParseOperation()
1026 Lex.Lex(); // eat the ',' in ParseOperation()
1032 if (Lex.getCode() != tgtok::comma) { in ParseOperation()
1036 Lex.Lex(); // eat the ',' in ParseOperation()
1042 if (Lex.getCode() != tgtok::r_paren) { in ParseOperation()
1046 Lex.Lex(); // eat the ')' in ParseOperation()
1122 if (Lex.getCode() != tgtok::less) { in ParseOperatorType()
1126 Lex.Lex(); // eat the < in ParseOperatorType()
1135 if (Lex.getCode() != tgtok::greater) { in ParseOperatorType()
1139 Lex.Lex(); // eat the > in ParseOperatorType()
1167 switch (Lex.getCode()) { in ParseSimpleValue()
1172 Lex.Lex(); // Skip '#'. in ParseSimpleValue()
1174 case tgtok::IntVal: R = IntInit::get(Lex.getCurIntVal()); Lex.Lex(); break; in ParseSimpleValue()
1176 auto BinaryVal = Lex.getCurBinaryIntVal(); in ParseSimpleValue()
1181 Lex.Lex(); in ParseSimpleValue()
1185 std::string Val = Lex.getCurStrVal(); in ParseSimpleValue()
1186 Lex.Lex(); in ParseSimpleValue()
1189 while (Lex.getCode() == tgtok::StrVal) { in ParseSimpleValue()
1190 Val += Lex.getCurStrVal(); in ParseSimpleValue()
1191 Lex.Lex(); in ParseSimpleValue()
1198 R = StringInit::get(Lex.getCurStrVal()); in ParseSimpleValue()
1199 Lex.Lex(); in ParseSimpleValue()
1203 Lex.Lex(); in ParseSimpleValue()
1206 SMLoc NameLoc = Lex.getLoc(); in ParseSimpleValue()
1207 std::string Name = Lex.getCurStrVal(); in ParseSimpleValue()
1208 if (Lex.Lex() != tgtok::less) // consume the Id. in ParseSimpleValue()
1212 if (Lex.Lex() == tgtok::greater) { in ParseSimpleValue()
1229 if (Lex.getCode() != tgtok::greater) { in ParseSimpleValue()
1233 Lex.Lex(); // eat the '>' in ParseSimpleValue()
1234 SMLoc EndLoc = Lex.getLoc(); in ParseSimpleValue()
1286 SMLoc BraceLoc = Lex.getLoc(); in ParseSimpleValue()
1287 Lex.Lex(); // eat the '{' in ParseSimpleValue()
1290 if (Lex.getCode() != tgtok::r_brace) { in ParseSimpleValue()
1294 if (Lex.getCode() != tgtok::r_brace) { in ParseSimpleValue()
1298 Lex.Lex(); // eat the '}' in ParseSimpleValue()
1337 Lex.Lex(); // eat the '[' in ParseSimpleValue()
1356 if (Lex.getCode() != tgtok::r_square) { in ParseSimpleValue()
1361 if (Lex.getCode() != tgtok::r_square) { in ParseSimpleValue()
1365 Lex.Lex(); // eat the ']' in ParseSimpleValue()
1368 if (Lex.getCode() == tgtok::less) { in ParseSimpleValue()
1370 Lex.Lex(); // eat the '<' in ParseSimpleValue()
1378 if (Lex.getCode() != tgtok::greater) { in ParseSimpleValue()
1382 Lex.Lex(); // eat the '>' in ParseSimpleValue()
1437 Lex.Lex(); // eat the '(' in ParseSimpleValue()
1438 if (Lex.getCode() != tgtok::Id && Lex.getCode() != tgtok::XCast) { in ParseSimpleValue()
1448 if (Lex.getCode() == tgtok::colon) { in ParseSimpleValue()
1449 if (Lex.Lex() != tgtok::VarName) { // eat the ':' in ParseSimpleValue()
1453 OperatorName = Lex.getCurStrVal(); in ParseSimpleValue()
1454 Lex.Lex(); // eat the VarName. in ParseSimpleValue()
1458 if (Lex.getCode() != tgtok::r_paren) { in ParseSimpleValue()
1463 if (Lex.getCode() != tgtok::r_paren) { in ParseSimpleValue()
1467 Lex.Lex(); // eat the ')' in ParseSimpleValue()
1508 switch (Lex.getCode()) { in ParseValue()
1515 SMLoc CurlyLoc = Lex.getLoc(); in ParseValue()
1516 Lex.Lex(); // eat the '{' in ParseValue()
1529 if (Lex.getCode() != tgtok::r_brace) { in ParseValue()
1533 Lex.Lex(); in ParseValue()
1537 SMLoc SquareLoc = Lex.getLoc(); in ParseValue()
1538 Lex.Lex(); // eat the '[' in ParseValue()
1549 if (Lex.getCode() != tgtok::r_square) { in ParseValue()
1553 Lex.Lex(); in ParseValue()
1557 if (Lex.Lex() != tgtok::Id) { // eat the . in ParseValue()
1561 if (!Result->getFieldType(Lex.getCurStrVal())) { in ParseValue()
1562 TokError("Cannot access field '" + Lex.getCurStrVal() + "' of value '" + in ParseValue()
1566 Result = FieldInit::get(Result, Lex.getCurStrVal()); in ParseValue()
1567 Lex.Lex(); // eat field name in ParseValue()
1571 SMLoc PasteLoc = Lex.getLoc(); in ParseValue()
1588 Lex.Lex(); // Eat the '#'. in ParseValue()
1589 switch (Lex.getCode()) { in ParseValue()
1635 if (Lex.getCode() == tgtok::VarName) { in ParseDagArgList()
1637 Result.push_back(std::make_pair(UnsetInit::get(), Lex.getCurStrVal())); in ParseDagArgList()
1638 Lex.Lex(); in ParseDagArgList()
1647 if (Lex.getCode() == tgtok::colon) { in ParseDagArgList()
1648 if (Lex.Lex() != tgtok::VarName) { // eat the ':' in ParseDagArgList()
1652 VarName = Lex.getCurStrVal(); in ParseDagArgList()
1653 Lex.Lex(); // eat the VarName. in ParseDagArgList()
1658 if (Lex.getCode() != tgtok::comma) break; in ParseDagArgList()
1659 Lex.Lex(); // eat the ',' in ParseDagArgList()
1695 while (Lex.getCode() == tgtok::comma) { in ParseValueList()
1696 Lex.Lex(); // Eat the comma in ParseValueList()
1730 bool HasField = Lex.getCode() == tgtok::Field; in ParseDeclaration()
1731 if (HasField) Lex.Lex(); in ParseDeclaration()
1736 if (Lex.getCode() != tgtok::Id) { in ParseDeclaration()
1741 SMLoc IdLoc = Lex.getLoc(); in ParseDeclaration()
1742 Init *DeclName = StringInit::get(Lex.getCurStrVal()); in ParseDeclaration()
1743 Lex.Lex(); in ParseDeclaration()
1761 if (Lex.getCode() == tgtok::equal) { in ParseDeclaration()
1762 Lex.Lex(); in ParseDeclaration()
1763 SMLoc ValLoc = Lex.getLoc(); in ParseDeclaration()
1785 if (Lex.getCode() != tgtok::Id) { in ParseForeachDeclaration()
1790 Init *DeclName = StringInit::get(Lex.getCurStrVal()); in ParseForeachDeclaration()
1791 Lex.Lex(); in ParseForeachDeclaration()
1794 if (Lex.getCode() != tgtok::equal) { in ParseForeachDeclaration()
1798 Lex.Lex(); // Eat the '=' in ParseForeachDeclaration()
1803 switch (Lex.getCode()) { in ParseForeachDeclaration()
1829 Lex.Lex(); // eat the '{' in ParseForeachDeclaration()
1831 if (Lex.getCode() != tgtok::r_brace) { in ParseForeachDeclaration()
1835 Lex.Lex(); in ParseForeachDeclaration()
1863 assert(Lex.getCode() == tgtok::less && "Not a template arg list!"); in ParseTemplateArgList()
1864 Lex.Lex(); // eat the '<' in ParseTemplateArgList()
1875 while (Lex.getCode() == tgtok::comma) { in ParseTemplateArgList()
1876 Lex.Lex(); // eat the ',' in ParseTemplateArgList()
1885 if (Lex.getCode() != tgtok::greater) in ParseTemplateArgList()
1887 Lex.Lex(); // eat the '>'. in ParseTemplateArgList()
1897 if (Lex.getCode() != tgtok::Let) { in ParseBodyItem()
1901 if (Lex.getCode() != tgtok::semi) in ParseBodyItem()
1903 Lex.Lex(); in ParseBodyItem()
1908 if (Lex.Lex() != tgtok::Id) in ParseBodyItem()
1911 SMLoc IdLoc = Lex.getLoc(); in ParseBodyItem()
1912 std::string FieldName = Lex.getCurStrVal(); in ParseBodyItem()
1913 Lex.Lex(); // eat the field name. in ParseBodyItem()
1920 if (Lex.getCode() != tgtok::equal) in ParseBodyItem()
1922 Lex.Lex(); // eat the '='. in ParseBodyItem()
1933 if (Lex.getCode() != tgtok::semi) in ParseBodyItem()
1935 Lex.Lex(); in ParseBodyItem()
1949 if (Lex.getCode() == tgtok::semi) { in ParseBody()
1950 Lex.Lex(); in ParseBody()
1954 if (Lex.getCode() != tgtok::l_brace) in ParseBody()
1957 Lex.Lex(); in ParseBody()
1959 while (Lex.getCode() != tgtok::r_brace) in ParseBody()
1964 Lex.Lex(); in ParseBody()
1990 if (Lex.getCode() == tgtok::colon) { in ParseObjectBody()
1991 Lex.Lex(); in ParseObjectBody()
2003 if (Lex.getCode() != tgtok::comma) break; in ParseObjectBody()
2004 Lex.Lex(); // eat ','. in ParseObjectBody()
2021 SMLoc DefLoc = Lex.getLoc(); in ParseDef()
2022 assert(Lex.getCode() == tgtok::Def && "Unknown tok"); in ParseDef()
2023 Lex.Lex(); // Eat the 'def' token. in ParseDef()
2102 assert(Lex.getCode() == tgtok::Foreach && "Unknown tok"); in ParseForeach()
2103 Lex.Lex(); // Eat the 'for' token. in ParseForeach()
2112 if (Lex.getCode() != tgtok::In) in ParseForeach()
2114 Lex.Lex(); // Eat the in in ParseForeach()
2119 if (Lex.getCode() != tgtok::l_brace) { in ParseForeach()
2125 SMLoc BraceLoc = Lex.getLoc(); in ParseForeach()
2127 Lex.Lex(); // eat the '{'. in ParseForeach()
2133 if (Lex.getCode() != tgtok::r_brace) { in ParseForeach()
2137 Lex.Lex(); // Eat the } in ParseForeach()
2151 assert(Lex.getCode() == tgtok::Class && "Unexpected token!"); in ParseClass()
2152 Lex.Lex(); in ParseClass()
2154 if (Lex.getCode() != tgtok::Id) in ParseClass()
2157 Record *CurRec = Records.getClass(Lex.getCurStrVal()); in ParseClass()
2168 llvm::make_unique<Record>(Lex.getCurStrVal(), Lex.getLoc(), Records); in ParseClass()
2172 Lex.Lex(); // eat the name. in ParseClass()
2175 if (Lex.getCode() == tgtok::less) in ParseClass()
2193 if (Lex.getCode() != tgtok::Id) { in ParseLetList()
2197 std::string Name = Lex.getCurStrVal(); in ParseLetList()
2198 SMLoc NameLoc = Lex.getLoc(); in ParseLetList()
2199 Lex.Lex(); // Eat the identifier. in ParseLetList()
2207 if (Lex.getCode() != tgtok::equal) { in ParseLetList()
2211 Lex.Lex(); // eat the '='. in ParseLetList()
2219 if (Lex.getCode() != tgtok::comma) in ParseLetList()
2221 Lex.Lex(); // eat the comma. in ParseLetList()
2232 assert(Lex.getCode() == tgtok::Let && "Unexpected token"); in ParseTopLevelLet()
2233 Lex.Lex(); in ParseTopLevelLet()
2240 if (Lex.getCode() != tgtok::In) in ParseTopLevelLet()
2242 Lex.Lex(); in ParseTopLevelLet()
2245 if (Lex.getCode() != tgtok::l_brace) { in ParseTopLevelLet()
2250 SMLoc BraceLoc = Lex.getLoc(); in ParseTopLevelLet()
2252 Lex.Lex(); // eat the '{'. in ParseTopLevelLet()
2258 if (Lex.getCode() != tgtok::r_brace) { in ParseTopLevelLet()
2262 Lex.Lex(); in ParseTopLevelLet()
2281 assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token"); in ParseMultiClass()
2282 Lex.Lex(); // Eat the multiclass token. in ParseMultiClass()
2284 if (Lex.getCode() != tgtok::Id) in ParseMultiClass()
2286 std::string Name = Lex.getCurStrVal(); in ParseMultiClass()
2290 llvm::make_unique<MultiClass>(Name, Lex.getLoc(),Records))); in ParseMultiClass()
2296 Lex.Lex(); // Eat the identifier. in ParseMultiClass()
2299 if (Lex.getCode() == tgtok::less) in ParseMultiClass()
2306 if (Lex.getCode() == tgtok::colon) { in ParseMultiClass()
2309 Lex.Lex(); in ParseMultiClass()
2322 if (Lex.getCode() != tgtok::comma) break; in ParseMultiClass()
2323 Lex.Lex(); // eat ','. in ParseMultiClass()
2328 if (Lex.getCode() != tgtok::l_brace) { in ParseMultiClass()
2331 if (Lex.getCode() != tgtok::semi) in ParseMultiClass()
2333 Lex.Lex(); // eat the ';'. in ParseMultiClass()
2335 if (Lex.Lex() == tgtok::r_brace) // eat the '{'. in ParseMultiClass()
2338 while (Lex.getCode() != tgtok::r_brace) { in ParseMultiClass()
2339 switch (Lex.getCode()) { in ParseMultiClass()
2351 Lex.Lex(); // eat the '}'. in ParseMultiClass()
2526 assert(Lex.getCode() == tgtok::Defm && "Unexpected token!"); in ParseDefm()
2527 SMLoc DefmLoc = Lex.getLoc(); in ParseDefm()
2530 if (Lex.Lex() == tgtok::Id) { // eat the defm. in ParseDefm()
2534 SMLoc DefmPrefixEndLoc = Lex.getLoc(); in ParseDefm()
2535 if (Lex.getCode() != tgtok::colon) in ParseDefm()
2545 Lex.Lex(); in ParseDefm()
2547 SMLoc SubClassLoc = Lex.getLoc(); in ParseDefm()
2593 if (Lex.getCode() != tgtok::comma) break; in ParseDefm()
2594 Lex.Lex(); // eat ','. in ParseDefm()
2596 if (Lex.getCode() != tgtok::Id) in ParseDefm()
2599 SubClassLoc = Lex.getLoc(); in ParseDefm()
2603 InheritFromClass = (Records.getClass(Lex.getCurStrVal()) != nullptr); in ParseDefm()
2632 if (Lex.getCode() != tgtok::comma) break; in ParseDefm()
2633 Lex.Lex(); // eat ','. in ParseDefm()
2645 if (Lex.getCode() != tgtok::semi) in ParseDefm()
2647 Lex.Lex(); in ParseDefm()
2660 switch (Lex.getCode()) { in ParseObject()
2675 while (isObjectStart(Lex.getCode())) { in ParseObjectList()
2683 Lex.Lex(); // Prime the lexer. in ParseFile()
2687 if (Lex.getCode() == tgtok::Eof) in ParseFile()