Lines Matching refs:Lex

523   if (Lex.getCode() == K) {  in consume()
524 Lex.Lex(); in consume()
537 switch (Lex.getCode()) { in ParseObjectName()
575 if (Lex.getCode() != tgtok::Id) { in ParseClassID()
580 Record *Result = Records.getClass(Lex.getCurStrVal()); in ParseClassID()
582 std::string Msg("Couldn't find class '" + Lex.getCurStrVal() + "'"); in ParseClassID()
583 if (MultiClasses[Lex.getCurStrVal()].get()) in ParseClassID()
585 Lex.getCurStrVal() + "'"); in ParseClassID()
590 Lex.Lex(); in ParseClassID()
600 if (Lex.getCode() != tgtok::Id) { in ParseMultiClassID()
605 MultiClass *Result = MultiClasses[Lex.getCurStrVal()].get(); in ParseMultiClassID()
607 TokError("Couldn't find multiclass '" + Lex.getCurStrVal() + "'"); in ParseMultiClassID()
609 Lex.Lex(); in ParseMultiClassID()
622 Result.RefRange.Start = Lex.getLoc(); in ParseSubClassReference()
634 Result.RefRange.End = Lex.getLoc(); in ParseSubClassReference()
649 Result.RefRange.End = Lex.getLoc(); in ParseSubClassReference()
663 Result.RefRange.Start = Lex.getLoc(); in ParseSubMultiClassReference()
670 Result.RefRange.End = Lex.getLoc(); in ParseSubMultiClassReference()
680 Result.RefRange.End = Lex.getLoc(); in ParseSubMultiClassReference()
707 switch (Lex.getCode()) { in ParseRangePiece()
714 Lex.Lex(); // eat in ParseRangePiece()
727 End = -Lex.getCurIntVal(); in ParseRangePiece()
728 Lex.Lex(); in ParseRangePiece()
767 SMLoc StartLoc = Lex.getLoc(); in ParseOptionalRangeList()
786 SMLoc StartLoc = Lex.getLoc(); in ParseOptionalBitList()
813 switch (Lex.getCode()) { in ParseType()
816 case tgtok::Code: Lex.Lex(); return StringRecTy::get(); in ParseType()
817 case tgtok::Bit: Lex.Lex(); return BitRecTy::get(); in ParseType()
818 case tgtok::Int: Lex.Lex(); return IntRecTy::get(); in ParseType()
819 case tgtok::Dag: Lex.Lex(); return DagRecTy::get(); in ParseType()
825 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
829 if (Lex.Lex() != tgtok::IntVal) { // Eat '<' in ParseType()
833 uint64_t Val = Lex.getCurIntVal(); in ParseType()
834 if (Lex.Lex() != tgtok::greater) { // Eat count. in ParseType()
838 Lex.Lex(); // Eat '>' in ParseType()
842 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
846 Lex.Lex(); // Eat '<' in ParseType()
919 switch (Lex.getCode()) { in ParseOperation()
933 switch (Lex.getCode()) { in ParseOperation()
936 Lex.Lex(); // eat the operation in ParseOperation()
948 Lex.Lex(); // eat the operation in ParseOperation()
953 Lex.Lex(); // eat the operation in ParseOperation()
957 Lex.Lex(); // eat the operation in ParseOperation()
961 Lex.Lex(); in ParseOperation()
966 Lex.Lex(); // eat the operation in ParseOperation()
971 Lex.Lex(); // eat the operation in ParseOperation()
972 if (Lex.getCode() == tgtok::less) { in ParseOperation()
1065 Lex.Lex(); // eat the operation in ParseOperation()
1109 tgtok::TokKind OpTok = Lex.getCode(); in ParseOperation()
1110 SMLoc OpLoc = Lex.getLoc(); in ParseOperation()
1111 Lex.Lex(); // eat the operation in ParseOperation()
1203 SMLoc InitLoc = Lex.getLoc(); in ParseOperation()
1380 tgtok::TokKind LexCode = Lex.getCode(); in ParseOperation()
1381 Lex.Lex(); // eat the operation in ParseOperation()
1409 SMLoc MHSLoc = Lex.getLoc(); in ParseOperation()
1419 SMLoc RHSLoc = Lex.getLoc(); in ParseOperation()
1522 Lex.Lex(); // eat the operation in ParseOperation()
1562 if (Lex.getCode() != tgtok::comma) { in ParseOperation()
1567 if (Lex.Lex() != tgtok::Id) { // eat the ',' in ParseOperation()
1572 Init *A = StringInit::get(Lex.getCurStrVal()); in ParseOperation()
1580 if (Lex.Lex() != tgtok::comma) { // eat the id in ParseOperation()
1585 if (Lex.Lex() != tgtok::Id) { // eat the ',' in ParseOperation()
1590 Init *B = StringInit::get(Lex.getCurStrVal()); in ParseOperation()
1598 if (Lex.Lex() != tgtok::comma) { // eat the id in ParseOperation()
1602 Lex.Lex(); // eat the ',' in ParseOperation()
1659 if (Lex.getCode() == tgtok::Code) in ParseOperatorType()
1684 Lex.Lex(); // eat the operation in ParseOperationSubstr()
1700 SMLoc MHSLoc = Lex.getLoc(); in ParseOperationSubstr()
1705 SMLoc RHSLoc = Lex.getLoc(); in ParseOperationSubstr()
1708 RHSLoc = Lex.getLoc(); in ParseOperationSubstr()
1772 Lex.Lex(); // eat the operation in ParseOperationFind()
1788 SMLoc MHSLoc = Lex.getLoc(); in ParseOperationFind()
1793 SMLoc RHSLoc = Lex.getLoc(); in ParseOperationFind()
1796 RHSLoc = Lex.getLoc(); in ParseOperationFind()
1858 SMLoc OpLoc = Lex.getLoc(); in ParseOperationForEachFilter()
1859 tgtok::TokKind Operation = Lex.getCode(); in ParseOperationForEachFilter()
1860 Lex.Lex(); // eat the operation in ParseOperationForEachFilter()
1861 if (Lex.getCode() != tgtok::l_paren) { in ParseOperationForEachFilter()
1866 if (Lex.Lex() != tgtok::Id) { // eat the '(' in ParseOperationForEachFilter()
1871 Init *LHS = StringInit::get(Lex.getCurStrVal()); in ParseOperationForEachFilter()
1872 Lex.Lex(); // eat the ID. in ParseOperationForEachFilter()
1981 Lex.Lex(); // eat the operation 'cond' in ParseOperationCond()
2083 switch (Lex.getCode()) { in ParseSimpleValue()
2088 Lex.Lex(); in ParseSimpleValue()
2092 Lex.Lex(); in ParseSimpleValue()
2095 R = IntInit::get(Lex.getCurIntVal()); in ParseSimpleValue()
2096 Lex.Lex(); in ParseSimpleValue()
2099 auto BinaryVal = Lex.getCurBinaryIntVal(); in ParseSimpleValue()
2104 Lex.Lex(); in ParseSimpleValue()
2108 std::string Val = Lex.getCurStrVal(); in ParseSimpleValue()
2109 Lex.Lex(); in ParseSimpleValue()
2112 while (Lex.getCode() == tgtok::StrVal) { in ParseSimpleValue()
2113 Val += Lex.getCurStrVal(); in ParseSimpleValue()
2114 Lex.Lex(); in ParseSimpleValue()
2121 R = StringInit::get(Lex.getCurStrVal(), StringInit::SF_Code); in ParseSimpleValue()
2122 Lex.Lex(); in ParseSimpleValue()
2126 Lex.Lex(); in ParseSimpleValue()
2129 SMLoc NameLoc = Lex.getLoc(); in ParseSimpleValue()
2130 StringInit *Name = StringInit::get(Lex.getCurStrVal()); in ParseSimpleValue()
2131 if (Lex.Lex() != tgtok::less) // consume the Id. in ParseSimpleValue()
2144 Lex.Lex(); // consume the < in ParseSimpleValue()
2167 SMLoc BraceLoc = Lex.getLoc(); in ParseSimpleValue()
2168 Lex.Lex(); // eat the '{' in ParseSimpleValue()
2171 if (Lex.getCode() != tgtok::r_brace) { in ParseSimpleValue()
2217 Lex.Lex(); // eat the '[' in ParseSimpleValue()
2233 if (Lex.getCode() != tgtok::r_square) { in ParseSimpleValue()
2308 Lex.Lex(); // eat the '(' in ParseSimpleValue()
2309 if (Lex.getCode() != tgtok::Id && Lex.getCode() != tgtok::XCast && in ParseSimpleValue()
2310 Lex.getCode() != tgtok::question && Lex.getCode() != tgtok::XGetDagOp) { in ParseSimpleValue()
2321 if (Lex.getCode() != tgtok::VarName) { // eat the ':' in ParseSimpleValue()
2325 OperatorName = StringInit::get(Lex.getCurStrVal()); in ParseSimpleValue()
2326 Lex.Lex(); // eat the VarName. in ParseSimpleValue()
2330 if (Lex.getCode() != tgtok::r_paren) { in ParseSimpleValue()
2401 switch (Lex.getCode()) { in ParseValue()
2408 SMLoc CurlyLoc = Lex.getLoc(); in ParseValue()
2409 Lex.Lex(); // eat the '{' in ParseValue()
2430 SMLoc SquareLoc = Lex.getLoc(); in ParseValue()
2431 Lex.Lex(); // eat the '[' in ParseValue()
2450 if (Lex.Lex() != tgtok::Id) { // eat the . in ParseValue()
2454 StringInit *FieldName = StringInit::get(Lex.getCurStrVal()); in ParseValue()
2456 TokError("Cannot access field '" + Lex.getCurStrVal() + "' of value '" + in ParseValue()
2461 Lex.Lex(); // eat field name in ParseValue()
2466 SMLoc PasteLoc = Lex.getLoc(); in ParseValue()
2475 Lex.Lex(); // Eat the '#'. in ParseValue()
2479 switch (Lex.getCode()) { in ParseValue()
2511 Lex.Lex(); // Eat the '#'. in ParseValue()
2512 switch (Lex.getCode()) { in ParseValue()
2567 if (Lex.getCode() == tgtok::VarName) { in ParseDagArgList()
2569 StringInit *VarName = StringInit::get(Lex.getCurStrVal()); in ParseDagArgList()
2571 Lex.Lex(); in ParseDagArgList()
2582 if (Lex.getCode() == tgtok::colon) { in ParseDagArgList()
2583 if (Lex.Lex() != tgtok::VarName) { // eat the ':' in ParseDagArgList()
2588 VarName = StringInit::get(Lex.getCurStrVal()); in ParseDagArgList()
2589 Lex.Lex(); // eat the VarName. in ParseDagArgList()
2616 if (Lex.getCode() == tgtok::r_square) in ParseValueList()
2683 if (Lex.getCode() != tgtok::Id) { in ParseDeclaration()
2688 std::string Str = Lex.getCurStrVal(); in ParseDeclaration()
2694 SMLoc IdLoc = Lex.getLoc(); in ParseDeclaration()
2696 Lex.Lex(); in ParseDeclaration()
2721 SMLoc ValLoc = Lex.getLoc(); in ParseDeclaration()
2743 if (Lex.getCode() != tgtok::Id) { in ParseForeachDeclaration()
2748 Init *DeclName = StringInit::get(Lex.getCurStrVal()); in ParseForeachDeclaration()
2749 Lex.Lex(); in ParseForeachDeclaration()
2760 switch (Lex.getCode()) { in ParseForeachDeclaration()
2762 Lex.Lex(); // eat the '{' in ParseForeachDeclaration()
2772 SMLoc ValueLoc = Lex.getLoc(); in ParseForeachDeclaration()
2823 assert(Lex.getCode() == tgtok::less && "Not a template arg list!"); in ParseTemplateArgList()
2824 Lex.Lex(); // eat the '<' in ParseTemplateArgList()
2837 SMLoc Loc = Lex.getLoc(); in ParseTemplateArgList()
2862 if (Lex.getCode() == tgtok::Assert) in ParseBodyItem()
2865 if (Lex.getCode() == tgtok::Defvar) in ParseBodyItem()
2868 if (Lex.getCode() != tgtok::Let) { in ParseBodyItem()
2878 if (Lex.Lex() != tgtok::Id) in ParseBodyItem()
2881 SMLoc IdLoc = Lex.getLoc(); in ParseBodyItem()
2882 StringInit *FieldName = StringInit::get(Lex.getCurStrVal()); in ParseBodyItem()
2883 Lex.Lex(); // eat the field name. in ParseBodyItem()
2931 while (Lex.getCode() != tgtok::r_brace) in ParseBody()
2938 Lex.Lex(); in ParseBody()
2941 SMLoc SemiLoc = Lex.getLoc(); in ParseBody()
3018 SMLoc DefLoc = Lex.getLoc(); in ParseDef()
3019 assert(Lex.getCode() == tgtok::Def && "Unknown tok"); in ParseDef()
3020 Lex.Lex(); // Eat the 'def' token. in ParseDef()
3045 assert(Lex.getCode() == tgtok::Defset); in ParseDefset()
3046 Lex.Lex(); // Eat the 'defset' token in ParseDefset()
3049 Defset.Loc = Lex.getLoc(); in ParseDefset()
3057 if (Lex.getCode() != tgtok::Id) in ParseDefset()
3059 StringInit *DeclName = StringInit::get(Lex.getCurStrVal()); in ParseDefset()
3063 if (Lex.Lex() != tgtok::equal) // Eat the identifier in ParseDefset()
3065 if (Lex.Lex() != tgtok::l_brace) // Eat the '=' in ParseDefset()
3067 SMLoc BraceLoc = Lex.getLoc(); in ParseDefset()
3068 Lex.Lex(); // Eat the '{' in ParseDefset()
3091 assert(Lex.getCode() == tgtok::Defvar); in ParseDefvar()
3092 Lex.Lex(); // Eat the 'defvar' token in ParseDefvar()
3094 if (Lex.getCode() != tgtok::Id) in ParseDefvar()
3096 StringInit *DeclName = StringInit::get(Lex.getCurStrVal()); in ParseDefvar()
3105 Lex.Lex(); in ParseDefvar()
3131 SMLoc Loc = Lex.getLoc(); in ParseForeach()
3132 assert(Lex.getCode() == tgtok::Foreach && "Unknown tok"); in ParseForeach()
3133 Lex.Lex(); // Eat the 'for' token. in ParseForeach()
3151 if (Lex.getCode() != tgtok::l_brace) { in ParseForeach()
3156 SMLoc BraceLoc = Lex.getLoc(); in ParseForeach()
3158 Lex.Lex(); // eat the '{'. in ParseForeach()
3185 SMLoc Loc = Lex.getLoc(); in ParseIf()
3186 assert(Lex.getCode() == tgtok::If && "Unknown tok"); in ParseIf()
3187 Lex.Lex(); // Eat the 'if' token. in ParseIf()
3260 if (Lex.getCode() != tgtok::l_brace) { in ParseIfBody()
3265 SMLoc BraceLoc = Lex.getLoc(); in ParseIfBody()
3267 Lex.Lex(); // eat the '{'. in ParseIfBody()
3287 assert(Lex.getCode() == tgtok::Assert && "Unknown tok"); in ParseAssert()
3288 Lex.Lex(); // Eat the 'assert' token. in ParseAssert()
3290 SMLoc ConditionLoc = Lex.getLoc(); in ParseAssert()
3320 assert(Lex.getCode() == tgtok::Class && "Unexpected token!"); in ParseClass()
3321 Lex.Lex(); in ParseClass()
3323 if (Lex.getCode() != tgtok::Id) in ParseClass()
3326 Record *CurRec = Records.getClass(Lex.getCurStrVal()); in ParseClass()
3337 std::make_unique<Record>(Lex.getCurStrVal(), Lex.getLoc(), Records, in ParseClass()
3342 Lex.Lex(); // eat the name. in ParseClass()
3345 if (Lex.getCode() == tgtok::less) in ParseClass()
3360 if (Lex.getCode() != tgtok::Id) { in ParseLetList()
3366 StringInit *Name = StringInit::get(Lex.getCurStrVal()); in ParseLetList()
3367 SMLoc NameLoc = Lex.getLoc(); in ParseLetList()
3368 Lex.Lex(); // Eat the identifier. in ParseLetList()
3402 assert(Lex.getCode() == tgtok::Let && "Unexpected token"); in ParseTopLevelLet()
3403 Lex.Lex(); in ParseTopLevelLet()
3417 if (Lex.getCode() != tgtok::l_brace) { in ParseTopLevelLet()
3422 SMLoc BraceLoc = Lex.getLoc(); in ParseTopLevelLet()
3424 Lex.Lex(); // eat the '{'. in ParseTopLevelLet()
3457 assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token"); in ParseMultiClass()
3458 Lex.Lex(); // Eat the multiclass token. in ParseMultiClass()
3460 if (Lex.getCode() != tgtok::Id) in ParseMultiClass()
3462 std::string Name = Lex.getCurStrVal(); in ParseMultiClass()
3466 std::make_unique<MultiClass>(Name, Lex.getLoc(),Records))); in ParseMultiClass()
3472 Lex.Lex(); // Eat the identifier. in ParseMultiClass()
3475 if (Lex.getCode() == tgtok::less) in ParseMultiClass()
3502 if (Lex.getCode() != tgtok::l_brace) { in ParseMultiClass()
3508 if (Lex.Lex() == tgtok::r_brace) // eat the '{'. in ParseMultiClass()
3514 while (Lex.getCode() != tgtok::r_brace) { in ParseMultiClass()
3515 switch (Lex.getCode()) { in ParseMultiClass()
3532 Lex.Lex(); // eat the '}'. in ParseMultiClass()
3535 SMLoc SemiLoc = Lex.getLoc(); in ParseMultiClass()
3553 assert(Lex.getCode() == tgtok::Defm && "Unexpected token!"); in ParseDefm()
3554 Lex.Lex(); // eat the defm in ParseDefm()
3568 if (Lex.getCode() != tgtok::colon) in ParseDefm()
3578 Lex.Lex(); in ParseDefm()
3580 SMLoc SubClassLoc = Lex.getLoc(); in ParseDefm()
3621 if (Lex.getCode() != tgtok::Id) in ParseDefm()
3624 SubClassLoc = Lex.getLoc(); in ParseDefm()
3628 InheritFromClass = (Records.getClass(Lex.getCurStrVal()) != nullptr); in ParseDefm()
3682 switch (Lex.getCode()) { in ParseObject()
3713 while (isObjectStart(Lex.getCode())) { in ParseObjectList()
3721 Lex.Lex(); // Prime the lexer. in ParseFile()
3725 if (Lex.getCode() == tgtok::Eof) in ParseFile()