28 assert(!TargetParser &&
"Target parser is already initialized!");
57 if (
getTok().getKind() != T)
87 return Error(Loc, Msg);
142 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
143 dbgs() <<
" " << *
this;
void toVector(SmallVectorImpl< char > &Out) const
Append the concatenated string into the given SmallString or SmallVector.
Represents a range in source code.
bool addErrorSuffix(const Twine &Suffix)
TokenKind getKind() const
virtual void Initialize(MCAsmParser &Parser)
Initialize the extension for parsing using the given Parser.
MCTargetAsmParser - Generic interface to target specific assembly parsers.
bool check(bool P, const Twine &Msg)
An efficient, type-erasing, non-owning reference to a callable.
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
const AsmToken & getTok() const
Get the current (last) lexed token.
bool parseIntToken(int64_t &V, const Twine &ErrMsg)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Base class for the full range of assembler expressions which are needed for parsing.
Target independent representation for an assembler token.
virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression.
int64_t getIntVal() const
const AsmToken & getTok() const
Get the current AsmToken from the stream.
bool parseToken(AsmToken::TokenKind T, const Twine &Msg="unexpected token")
virtual MCAsmLexer & getLexer()=0
bool parseTokenLoc(SMLoc &Loc)
bool Error(SMLoc L, const Twine &Msg, SMRange Range=None)
Return an error at the location L, with the message Msg.
virtual StringRef parseStringToEndOfStatement()=0
Parse up to the end of statement and return the contents from the current token until the end of the ...
void UnLex(AsmToken const &Token)
bool parseMany(function_ref< bool()> parseOne, bool hasComma=true)
SmallVector< MCPendingError, 1 > PendingErrors
virtual void dump() const
dump - Print to the debug stream.
const AsmToken & Lex()
Consume the next token from the input stream and return it.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool TokError(const Twine &Msg, SMRange Range=None)
Report an error at the current lexer location.
bool parseEOL(const Twine &ErrMsg)
void setTargetParser(MCTargetAsmParser &P)
bool parseOptionalToken(AsmToken::TokenKind T)
Attempt to parse and consume token, returning true on success.
StringRef - Represent a constant reference to a string, i.e.
Represents a location in source code.