Lines Matching refs:Lex
524 if (Lex.getCode() == K) { in consume()
525 Lex.Lex(); in consume()
538 switch (Lex.getCode()) { in ParseObjectName()
576 if (Lex.getCode() != tgtok::Id) { in ParseClassID()
581 Record *Result = Records.getClass(Lex.getCurStrVal()); in ParseClassID()
583 std::string Msg("Couldn't find class '" + Lex.getCurStrVal() + "'"); in ParseClassID()
584 if (MultiClasses[Lex.getCurStrVal()].get()) in ParseClassID()
586 Lex.getCurStrVal() + "'"); in ParseClassID()
591 Lex.Lex(); in ParseClassID()
601 if (Lex.getCode() != tgtok::Id) { in ParseMultiClassID()
606 MultiClass *Result = MultiClasses[Lex.getCurStrVal()].get(); in ParseMultiClassID()
608 TokError("Couldn't find multiclass '" + Lex.getCurStrVal() + "'"); in ParseMultiClassID()
610 Lex.Lex(); in ParseMultiClassID()
623 Result.RefRange.Start = Lex.getLoc(); in ParseSubClassReference()
635 Result.RefRange.End = Lex.getLoc(); in ParseSubClassReference()
650 Result.RefRange.End = Lex.getLoc(); in ParseSubClassReference()
664 Result.RefRange.Start = Lex.getLoc(); in ParseSubMultiClassReference()
671 Result.RefRange.End = Lex.getLoc(); in ParseSubMultiClassReference()
681 Result.RefRange.End = Lex.getLoc(); in ParseSubMultiClassReference()
708 switch (Lex.getCode()) { in ParseRangePiece()
715 Lex.Lex(); // eat in ParseRangePiece()
728 End = -Lex.getCurIntVal(); in ParseRangePiece()
729 Lex.Lex(); in ParseRangePiece()
768 SMLoc StartLoc = Lex.getLoc(); in ParseOptionalRangeList()
787 SMLoc StartLoc = Lex.getLoc(); in ParseOptionalBitList()
814 switch (Lex.getCode()) { in ParseType()
818 Lex.Lex(); in ParseType()
821 Lex.Lex(); in ParseType()
824 Lex.Lex(); in ParseType()
827 Lex.Lex(); in ParseType()
835 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
839 if (Lex.Lex() != tgtok::IntVal) { // Eat '<' in ParseType()
843 uint64_t Val = Lex.getCurIntVal(); in ParseType()
844 if (Lex.Lex() != tgtok::greater) { // Eat count. in ParseType()
848 Lex.Lex(); // Eat '>' in ParseType()
852 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
856 Lex.Lex(); // Eat '<' in ParseType()
930 switch (Lex.getCode()) { in ParseOperation()
944 switch (Lex.getCode()) { in ParseOperation()
947 Lex.Lex(); // eat the operation in ParseOperation()
959 Lex.Lex(); // eat the operation in ParseOperation()
964 Lex.Lex(); // eat the operation in ParseOperation()
968 Lex.Lex(); // eat the operation in ParseOperation()
972 Lex.Lex(); in ParseOperation()
977 Lex.Lex(); // eat the operation in ParseOperation()
982 Lex.Lex(); // eat the operation in ParseOperation()
983 if (Lex.getCode() == tgtok::less) { in ParseOperation()
1076 Lex.Lex(); // eat the operation in ParseOperation()
1101 Lex.Lex(); // eat the operation in ParseOperation()
1112 SMLoc ExprLoc = Lex.getLoc(); in ParseOperation()
1166 tgtok::TokKind OpTok = Lex.getCode(); in ParseOperation()
1167 SMLoc OpLoc = Lex.getLoc(); in ParseOperation()
1168 Lex.Lex(); // eat the operation in ParseOperation()
1260 SMLoc InitLoc = Lex.getLoc(); in ParseOperation()
1438 tgtok::TokKind LexCode = Lex.getCode(); in ParseOperation()
1439 Lex.Lex(); // eat the operation in ParseOperation()
1467 SMLoc MHSLoc = Lex.getLoc(); in ParseOperation()
1477 SMLoc RHSLoc = Lex.getLoc(); in ParseOperation()
1580 Lex.Lex(); // eat the operation in ParseOperation()
1620 if (Lex.getCode() != tgtok::comma) { in ParseOperation()
1625 if (Lex.Lex() != tgtok::Id) { // eat the ',' in ParseOperation()
1630 Init *A = StringInit::get(Records, Lex.getCurStrVal()); in ParseOperation()
1638 if (Lex.Lex() != tgtok::comma) { // eat the id in ParseOperation()
1643 if (Lex.Lex() != tgtok::Id) { // eat the ',' in ParseOperation()
1648 Init *B = StringInit::get(Records, Lex.getCurStrVal()); in ParseOperation()
1656 if (Lex.Lex() != tgtok::comma) { // eat the id in ParseOperation()
1660 Lex.Lex(); // eat the ',' in ParseOperation()
1717 if (Lex.getCode() == tgtok::Code) in ParseOperatorType()
1742 Lex.Lex(); // eat the operation in ParseOperationSubstr()
1758 SMLoc MHSLoc = Lex.getLoc(); in ParseOperationSubstr()
1763 SMLoc RHSLoc = Lex.getLoc(); in ParseOperationSubstr()
1766 RHSLoc = Lex.getLoc(); in ParseOperationSubstr()
1830 Lex.Lex(); // eat the operation in ParseOperationFind()
1846 SMLoc MHSLoc = Lex.getLoc(); in ParseOperationFind()
1851 SMLoc RHSLoc = Lex.getLoc(); in ParseOperationFind()
1854 RHSLoc = Lex.getLoc(); in ParseOperationFind()
1916 SMLoc OpLoc = Lex.getLoc(); in ParseOperationForEachFilter()
1917 tgtok::TokKind Operation = Lex.getCode(); in ParseOperationForEachFilter()
1918 Lex.Lex(); // eat the operation in ParseOperationForEachFilter()
1919 if (Lex.getCode() != tgtok::l_paren) { in ParseOperationForEachFilter()
1924 if (Lex.Lex() != tgtok::Id) { // eat the '(' in ParseOperationForEachFilter()
1929 Init *LHS = StringInit::get(Records, Lex.getCurStrVal()); in ParseOperationForEachFilter()
1930 Lex.Lex(); // eat the ID. in ParseOperationForEachFilter()
2039 Lex.Lex(); // eat the operation 'cond' in ParseOperationCond()
2141 switch (Lex.getCode()) { in ParseSimpleValue()
2146 Lex.Lex(); in ParseSimpleValue()
2150 Lex.Lex(); in ParseSimpleValue()
2153 R = IntInit::get(Records, Lex.getCurIntVal()); in ParseSimpleValue()
2154 Lex.Lex(); in ParseSimpleValue()
2157 auto BinaryVal = Lex.getCurBinaryIntVal(); in ParseSimpleValue()
2162 Lex.Lex(); in ParseSimpleValue()
2166 std::string Val = Lex.getCurStrVal(); in ParseSimpleValue()
2167 Lex.Lex(); in ParseSimpleValue()
2170 while (Lex.getCode() == tgtok::StrVal) { in ParseSimpleValue()
2171 Val += Lex.getCurStrVal(); in ParseSimpleValue()
2172 Lex.Lex(); in ParseSimpleValue()
2179 R = StringInit::get(Records, Lex.getCurStrVal(), StringInit::SF_Code); in ParseSimpleValue()
2180 Lex.Lex(); in ParseSimpleValue()
2184 Lex.Lex(); in ParseSimpleValue()
2187 SMLoc NameLoc = Lex.getLoc(); in ParseSimpleValue()
2188 StringInit *Name = StringInit::get(Records, Lex.getCurStrVal()); in ParseSimpleValue()
2189 if (Lex.Lex() != tgtok::less) // consume the Id. in ParseSimpleValue()
2202 Lex.Lex(); // consume the < in ParseSimpleValue()
2225 SMLoc BraceLoc = Lex.getLoc(); in ParseSimpleValue()
2226 Lex.Lex(); // eat the '{' in ParseSimpleValue()
2229 if (Lex.getCode() != tgtok::r_brace) { in ParseSimpleValue()
2275 Lex.Lex(); // eat the '[' in ParseSimpleValue()
2291 if (Lex.getCode() != tgtok::r_square) { in ParseSimpleValue()
2366 Lex.Lex(); // eat the '(' in ParseSimpleValue()
2367 if (Lex.getCode() != tgtok::Id && Lex.getCode() != tgtok::XCast && in ParseSimpleValue()
2368 Lex.getCode() != tgtok::question && Lex.getCode() != tgtok::XGetDagOp) { in ParseSimpleValue()
2379 if (Lex.getCode() != tgtok::VarName) { // eat the ':' in ParseSimpleValue()
2383 OperatorName = StringInit::get(Records, Lex.getCurStrVal()); in ParseSimpleValue()
2384 Lex.Lex(); // eat the VarName. in ParseSimpleValue()
2388 if (Lex.getCode() != tgtok::r_paren) { in ParseSimpleValue()
2460 switch (Lex.getCode()) { in ParseValue()
2467 SMLoc CurlyLoc = Lex.getLoc(); in ParseValue()
2468 Lex.Lex(); // eat the '{' in ParseValue()
2489 SMLoc SquareLoc = Lex.getLoc(); in ParseValue()
2490 Lex.Lex(); // eat the '[' in ParseValue()
2509 if (Lex.Lex() != tgtok::Id) { // eat the . in ParseValue()
2513 StringInit *FieldName = StringInit::get(Records, Lex.getCurStrVal()); in ParseValue()
2515 TokError("Cannot access field '" + Lex.getCurStrVal() + "' of value '" + in ParseValue()
2520 Lex.Lex(); // eat field name in ParseValue()
2525 SMLoc PasteLoc = Lex.getLoc(); in ParseValue()
2534 Lex.Lex(); // Eat the '#'. in ParseValue()
2538 switch (Lex.getCode()) { in ParseValue()
2570 Lex.Lex(); // Eat the '#'. in ParseValue()
2571 switch (Lex.getCode()) { in ParseValue()
2626 if (Lex.getCode() == tgtok::VarName) { in ParseDagArgList()
2628 StringInit *VarName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDagArgList()
2630 Lex.Lex(); in ParseDagArgList()
2641 if (Lex.getCode() == tgtok::colon) { in ParseDagArgList()
2642 if (Lex.Lex() != tgtok::VarName) { // eat the ':' in ParseDagArgList()
2647 VarName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDagArgList()
2648 Lex.Lex(); // eat the VarName. in ParseDagArgList()
2675 if (Lex.getCode() == tgtok::r_square) in ParseValueList()
2742 if (Lex.getCode() != tgtok::Id) { in ParseDeclaration()
2747 std::string Str = Lex.getCurStrVal(); in ParseDeclaration()
2753 SMLoc IdLoc = Lex.getLoc(); in ParseDeclaration()
2755 Lex.Lex(); in ParseDeclaration()
2780 SMLoc ValLoc = Lex.getLoc(); in ParseDeclaration()
2802 if (Lex.getCode() != tgtok::Id) { in ParseForeachDeclaration()
2807 Init *DeclName = StringInit::get(Records, Lex.getCurStrVal()); in ParseForeachDeclaration()
2808 Lex.Lex(); in ParseForeachDeclaration()
2819 switch (Lex.getCode()) { in ParseForeachDeclaration()
2821 Lex.Lex(); // eat the '{' in ParseForeachDeclaration()
2831 SMLoc ValueLoc = Lex.getLoc(); in ParseForeachDeclaration()
2882 assert(Lex.getCode() == tgtok::less && "Not a template arg list!"); in ParseTemplateArgList()
2883 Lex.Lex(); // eat the '<' in ParseTemplateArgList()
2896 SMLoc Loc = Lex.getLoc(); in ParseTemplateArgList()
2921 if (Lex.getCode() == tgtok::Assert) in ParseBodyItem()
2924 if (Lex.getCode() == tgtok::Defvar) in ParseBodyItem()
2927 if (Lex.getCode() != tgtok::Let) { in ParseBodyItem()
2937 if (Lex.Lex() != tgtok::Id) in ParseBodyItem()
2940 SMLoc IdLoc = Lex.getLoc(); in ParseBodyItem()
2941 StringInit *FieldName = StringInit::get(Records, Lex.getCurStrVal()); in ParseBodyItem()
2942 Lex.Lex(); // eat the field name. in ParseBodyItem()
2990 while (Lex.getCode() != tgtok::r_brace) in ParseBody()
2997 Lex.Lex(); in ParseBody()
3000 SMLoc SemiLoc = Lex.getLoc(); in ParseBody()
3077 SMLoc DefLoc = Lex.getLoc(); in ParseDef()
3078 assert(Lex.getCode() == tgtok::Def && "Unknown tok"); in ParseDef()
3079 Lex.Lex(); // Eat the 'def' token. in ParseDef()
3104 assert(Lex.getCode() == tgtok::Defset); in ParseDefset()
3105 Lex.Lex(); // Eat the 'defset' token in ParseDefset()
3108 Defset.Loc = Lex.getLoc(); in ParseDefset()
3116 if (Lex.getCode() != tgtok::Id) in ParseDefset()
3118 StringInit *DeclName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDefset()
3122 if (Lex.Lex() != tgtok::equal) // Eat the identifier in ParseDefset()
3124 if (Lex.Lex() != tgtok::l_brace) // Eat the '=' in ParseDefset()
3126 SMLoc BraceLoc = Lex.getLoc(); in ParseDefset()
3127 Lex.Lex(); // Eat the '{' in ParseDefset()
3150 assert(Lex.getCode() == tgtok::Defvar); in ParseDefvar()
3151 Lex.Lex(); // Eat the 'defvar' token in ParseDefvar()
3153 if (Lex.getCode() != tgtok::Id) in ParseDefvar()
3155 StringInit *DeclName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDefvar()
3164 Lex.Lex(); in ParseDefvar()
3190 SMLoc Loc = Lex.getLoc(); in ParseForeach()
3191 assert(Lex.getCode() == tgtok::Foreach && "Unknown tok"); in ParseForeach()
3192 Lex.Lex(); // Eat the 'for' token. in ParseForeach()
3210 if (Lex.getCode() != tgtok::l_brace) { in ParseForeach()
3215 SMLoc BraceLoc = Lex.getLoc(); in ParseForeach()
3217 Lex.Lex(); // eat the '{'. in ParseForeach()
3244 SMLoc Loc = Lex.getLoc(); in ParseIf()
3245 assert(Lex.getCode() == tgtok::If && "Unknown tok"); in ParseIf()
3246 Lex.Lex(); // Eat the 'if' token. in ParseIf()
3320 if (Lex.getCode() != tgtok::l_brace) { in ParseIfBody()
3325 SMLoc BraceLoc = Lex.getLoc(); in ParseIfBody()
3327 Lex.Lex(); // eat the '{'. in ParseIfBody()
3347 assert(Lex.getCode() == tgtok::Assert && "Unknown tok"); in ParseAssert()
3348 Lex.Lex(); // Eat the 'assert' token. in ParseAssert()
3350 SMLoc ConditionLoc = Lex.getLoc(); in ParseAssert()
3380 assert(Lex.getCode() == tgtok::Class && "Unexpected token!"); in ParseClass()
3381 Lex.Lex(); in ParseClass()
3383 if (Lex.getCode() != tgtok::Id) in ParseClass()
3386 Record *CurRec = Records.getClass(Lex.getCurStrVal()); in ParseClass()
3395 CurRec->updateClassLoc(Lex.getLoc()); in ParseClass()
3399 std::make_unique<Record>(Lex.getCurStrVal(), Lex.getLoc(), Records, in ParseClass()
3404 Lex.Lex(); // eat the name. in ParseClass()
3407 if (Lex.getCode() == tgtok::less) in ParseClass()
3427 if (Lex.getCode() != tgtok::Id) { in ParseLetList()
3433 StringInit *Name = StringInit::get(Records, Lex.getCurStrVal()); in ParseLetList()
3434 SMLoc NameLoc = Lex.getLoc(); in ParseLetList()
3435 Lex.Lex(); // Eat the identifier. in ParseLetList()
3469 assert(Lex.getCode() == tgtok::Let && "Unexpected token"); in ParseTopLevelLet()
3470 Lex.Lex(); in ParseTopLevelLet()
3484 if (Lex.getCode() != tgtok::l_brace) { in ParseTopLevelLet()
3489 SMLoc BraceLoc = Lex.getLoc(); in ParseTopLevelLet()
3491 Lex.Lex(); // eat the '{'. in ParseTopLevelLet()
3524 assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token"); in ParseMultiClass()
3525 Lex.Lex(); // Eat the multiclass token. in ParseMultiClass()
3527 if (Lex.getCode() != tgtok::Id) in ParseMultiClass()
3529 std::string Name = Lex.getCurStrVal(); in ParseMultiClass()
3533 std::make_unique<MultiClass>(Name, Lex.getLoc(),Records))); in ParseMultiClass()
3539 Lex.Lex(); // Eat the identifier. in ParseMultiClass()
3542 if (Lex.getCode() == tgtok::less) in ParseMultiClass()
3569 if (Lex.getCode() != tgtok::l_brace) { in ParseMultiClass()
3575 if (Lex.Lex() == tgtok::r_brace) // eat the '{'. in ParseMultiClass()
3581 while (Lex.getCode() != tgtok::r_brace) { in ParseMultiClass()
3582 switch (Lex.getCode()) { in ParseMultiClass()
3599 Lex.Lex(); // eat the '}'. in ParseMultiClass()
3602 SMLoc SemiLoc = Lex.getLoc(); in ParseMultiClass()
3623 assert(Lex.getCode() == tgtok::Defm && "Unexpected token!"); in ParseDefm()
3624 Lex.Lex(); // eat the defm in ParseDefm()
3638 if (Lex.getCode() != tgtok::colon) in ParseDefm()
3648 Lex.Lex(); in ParseDefm()
3650 SMLoc SubClassLoc = Lex.getLoc(); in ParseDefm()
3691 if (Lex.getCode() != tgtok::Id) in ParseDefm()
3694 SubClassLoc = Lex.getLoc(); in ParseDefm()
3698 InheritFromClass = (Records.getClass(Lex.getCurStrVal()) != nullptr); in ParseDefm()
3752 switch (Lex.getCode()) { in ParseObject()
3783 while (isObjectStart(Lex.getCode())) { in ParseObjectList()
3791 Lex.Lex(); // Prime the lexer. in ParseFile()
3795 if (Lex.getCode() == tgtok::Eof) in ParseFile()