Lines Matching refs:RemainingExpr
43 StringRef RemainingExpr; in evaluate() local
45 std::tie(LHSResult, RemainingExpr) = in evaluate()
49 if (RemainingExpr != "") in evaluate()
50 return handleError(Expr, unexpectedToken(RemainingExpr, LHSExpr, "")); in evaluate()
55 std::tie(RHSResult, RemainingExpr) = in evaluate()
59 if (RemainingExpr != "") in evaluate()
60 return handleError(Expr, unexpectedToken(RemainingExpr, RHSExpr, "")); in evaluate()
223 StringRef RemainingExpr = Expr.substr(1).ltrim(); in evalDecodeOperand() local
225 std::tie(Symbol, RemainingExpr) = parseSymbol(RemainingExpr); in evalDecodeOperand()
232 if (!RemainingExpr.startswith(",")) in evalDecodeOperand()
234 unexpectedToken(RemainingExpr, RemainingExpr, "expected ','"), ""); in evalDecodeOperand()
235 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalDecodeOperand()
238 std::tie(OpIdxExpr, RemainingExpr) = evalNumberExpr(RemainingExpr); in evalDecodeOperand()
242 if (!RemainingExpr.startswith(")")) in evalDecodeOperand()
244 unexpectedToken(RemainingExpr, RemainingExpr, "expected ')'"), ""); in evalDecodeOperand()
245 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalDecodeOperand()
278 return std::make_pair(EvalResult(Op.getImm()), RemainingExpr); in evalDecodeOperand()
291 StringRef RemainingExpr = Expr.substr(1).ltrim(); in evalNextPC() local
293 std::tie(Symbol, RemainingExpr) = parseSymbol(RemainingExpr); in evalNextPC()
300 if (!RemainingExpr.startswith(")")) in evalNextPC()
302 unexpectedToken(RemainingExpr, RemainingExpr, "expected ')'"), ""); in evalNextPC()
303 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalNextPC()
317 return std::make_pair(EvalResult(NextPC), RemainingExpr); in evalNextPC()
329 StringRef RemainingExpr = Expr.substr(1).ltrim(); in evalStubAddr() local
334 size_t ComaIdx = RemainingExpr.find(','); in evalStubAddr()
335 FileName = RemainingExpr.substr(0, ComaIdx).rtrim(); in evalStubAddr()
336 RemainingExpr = RemainingExpr.substr(ComaIdx).ltrim(); in evalStubAddr()
338 if (!RemainingExpr.startswith(",")) in evalStubAddr()
340 unexpectedToken(RemainingExpr, Expr, "expected ','"), ""); in evalStubAddr()
341 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalStubAddr()
344 std::tie(SectionName, RemainingExpr) = parseSymbol(RemainingExpr); in evalStubAddr()
346 if (!RemainingExpr.startswith(",")) in evalStubAddr()
348 unexpectedToken(RemainingExpr, Expr, "expected ','"), ""); in evalStubAddr()
349 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalStubAddr()
352 std::tie(Symbol, RemainingExpr) = parseSymbol(RemainingExpr); in evalStubAddr()
354 if (!RemainingExpr.startswith(")")) in evalStubAddr()
356 unexpectedToken(RemainingExpr, Expr, "expected ')'"), ""); in evalStubAddr()
357 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalStubAddr()
367 return std::make_pair(EvalResult(StubAddr), RemainingExpr); in evalStubAddr()
374 StringRef RemainingExpr = Expr.substr(1).ltrim(); in evalSectionAddr() local
379 size_t ComaIdx = RemainingExpr.find(','); in evalSectionAddr()
380 FileName = RemainingExpr.substr(0, ComaIdx).rtrim(); in evalSectionAddr()
381 RemainingExpr = RemainingExpr.substr(ComaIdx).ltrim(); in evalSectionAddr()
383 if (!RemainingExpr.startswith(",")) in evalSectionAddr()
385 unexpectedToken(RemainingExpr, Expr, "expected ','"), ""); in evalSectionAddr()
386 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalSectionAddr()
389 std::tie(SectionName, RemainingExpr) = parseSymbol(RemainingExpr); in evalSectionAddr()
391 if (!RemainingExpr.startswith(")")) in evalSectionAddr()
393 unexpectedToken(RemainingExpr, Expr, "expected ')'"), ""); in evalSectionAddr()
394 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalSectionAddr()
404 return std::make_pair(EvalResult(StubAddr), RemainingExpr); in evalSectionAddr()
413 StringRef RemainingExpr; in evalIdentifierExpr() local
414 std::tie(Symbol, RemainingExpr) = parseSymbol(Expr); in evalIdentifierExpr()
418 return evalDecodeOperand(RemainingExpr); in evalIdentifierExpr()
420 return evalNextPC(RemainingExpr, PCtx); in evalIdentifierExpr()
422 return evalStubAddr(RemainingExpr, PCtx); in evalIdentifierExpr()
424 return evalSectionAddr(RemainingExpr, PCtx); in evalIdentifierExpr()
444 return std::make_pair(EvalResult(Value), RemainingExpr); in evalIdentifierExpr()
469 StringRef RemainingExpr; in evalNumberExpr() local
470 std::tie(ValueStr, RemainingExpr) = parseNumberString(Expr); in evalNumberExpr()
474 unexpectedToken(RemainingExpr, RemainingExpr, "expected number"), ""); in evalNumberExpr()
477 return std::make_pair(EvalResult(Value), RemainingExpr); in evalNumberExpr()
487 StringRef RemainingExpr; in evalParensExpr() local
488 std::tie(SubExprResult, RemainingExpr) = in evalParensExpr()
492 if (!RemainingExpr.startswith(")")) in evalParensExpr()
494 unexpectedToken(RemainingExpr, Expr, "expected ')'"), ""); in evalParensExpr()
495 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalParensExpr()
496 return std::make_pair(SubExprResult, RemainingExpr); in evalParensExpr()
505 StringRef RemainingExpr = Expr.substr(1).ltrim(); in evalLoadExpr() local
508 if (!RemainingExpr.startswith("{")) in evalLoadExpr()
510 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalLoadExpr()
512 std::tie(ReadSizeExpr, RemainingExpr) = evalNumberExpr(RemainingExpr); in evalLoadExpr()
514 return std::make_pair(ReadSizeExpr, RemainingExpr); in evalLoadExpr()
518 if (!RemainingExpr.startswith("}")) in evalLoadExpr()
520 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalLoadExpr()
525 std::tie(LoadAddrExprResult, RemainingExpr) = in evalLoadExpr()
526 evalComplexExpr(evalSimpleExpr(RemainingExpr, LoadCtx), LoadCtx); in evalLoadExpr()
535 RemainingExpr); in evalLoadExpr()
548 StringRef RemainingExpr; in evalSimpleExpr() local
554 std::tie(SubExprResult, RemainingExpr) = evalParensExpr(Expr, PCtx); in evalSimpleExpr()
556 std::tie(SubExprResult, RemainingExpr) = evalLoadExpr(Expr); in evalSimpleExpr()
558 std::tie(SubExprResult, RemainingExpr) = evalIdentifierExpr(Expr, PCtx); in evalSimpleExpr()
560 std::tie(SubExprResult, RemainingExpr) = evalNumberExpr(Expr); in evalSimpleExpr()
567 return std::make_pair(SubExprResult, RemainingExpr); in evalSimpleExpr()
570 if (RemainingExpr.startswith("[")) in evalSimpleExpr()
571 std::tie(SubExprResult, RemainingExpr) = in evalSimpleExpr()
572 evalSliceExpr(std::make_pair(SubExprResult, RemainingExpr)); in evalSimpleExpr()
574 return std::make_pair(SubExprResult, RemainingExpr); in evalSimpleExpr()
587 StringRef RemainingExpr; in evalSliceExpr() local
588 std::tie(SubExprResult, RemainingExpr) = Ctx; in evalSliceExpr()
590 assert(RemainingExpr.startswith("[") && "Not a slice expr."); in evalSliceExpr()
591 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalSliceExpr()
594 std::tie(HighBitExpr, RemainingExpr) = evalNumberExpr(RemainingExpr); in evalSliceExpr()
597 return std::make_pair(HighBitExpr, RemainingExpr); in evalSliceExpr()
599 if (!RemainingExpr.startswith(":")) in evalSliceExpr()
601 unexpectedToken(RemainingExpr, RemainingExpr, "expected ':'"), ""); in evalSliceExpr()
602 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalSliceExpr()
605 std::tie(LowBitExpr, RemainingExpr) = evalNumberExpr(RemainingExpr); in evalSliceExpr()
608 return std::make_pair(LowBitExpr, RemainingExpr); in evalSliceExpr()
610 if (!RemainingExpr.startswith("]")) in evalSliceExpr()
612 unexpectedToken(RemainingExpr, RemainingExpr, "expected ']'"), ""); in evalSliceExpr()
613 RemainingExpr = RemainingExpr.substr(1).ltrim(); in evalSliceExpr()
619 return std::make_pair(EvalResult(SlicedValue), RemainingExpr); in evalSliceExpr()
632 StringRef RemainingExpr; in evalComplexExpr() local
633 std::tie(LHSResult, RemainingExpr) = LHSAndRemaining; in evalComplexExpr()
637 if (LHSResult.hasError() || RemainingExpr == "") in evalComplexExpr()
638 return std::make_pair(LHSResult, RemainingExpr); in evalComplexExpr()
642 std::tie(BinOp, RemainingExpr) = parseBinOpToken(RemainingExpr); in evalComplexExpr()
646 return std::make_pair(LHSResult, RemainingExpr); in evalComplexExpr()
650 std::tie(RHSResult, RemainingExpr) = evalSimpleExpr(RemainingExpr, PCtx); in evalComplexExpr()
654 return std::make_pair(RHSResult, RemainingExpr); in evalComplexExpr()
660 return evalComplexExpr(std::make_pair(ThisResult, RemainingExpr), PCtx); in evalComplexExpr()