|
LLVM
4.0.0
|
Target independent representation for an assembler token. More...
#include <MCAsmLexer.h>
Public Types | |
| enum | TokenKind { Eof, Error, Identifier, String, Integer, BigNum, Real, Comment, HashDirective, EndOfStatement, Colon, Space, Plus, Minus, Tilde, Slash, BackSlash, LParen, RParen, LBrac, RBrac, LCurly, RCurly, Star, Dot, Comma, Dollar, Equal, EqualEqual, Pipe, PipePipe, Caret, Amp, AmpAmp, Exclaim, ExclaimEqual, Percent, Hash, Less, LessEqual, LessLess, LessGreater, Greater, GreaterEqual, GreaterGreater, At, PercentCall16, PercentCall_Hi, PercentCall_Lo, PercentDtprel_Hi, PercentDtprel_Lo, PercentGot, PercentGot_Disp, PercentGot_Hi, PercentGot_Lo, PercentGot_Ofst, PercentGot_Page, PercentGottprel, PercentGp_Rel, PercentHi, PercentHigher, PercentHighest, PercentLo, PercentNeg, PercentPcrel_Hi, PercentPcrel_Lo, PercentTlsgd, PercentTlsldm, PercentTprel_Hi, PercentTprel_Lo } |
Public Member Functions | |
| AsmToken () | |
| AsmToken (TokenKind Kind, StringRef Str, APInt IntVal) | |
| AsmToken (TokenKind Kind, StringRef Str, int64_t IntVal=0) | |
| TokenKind | getKind () const |
| bool | is (TokenKind K) const |
| bool | isNot (TokenKind K) const |
| SMLoc | getLoc () const |
| SMLoc | getEndLoc () const |
| SMRange | getLocRange () const |
| StringRef | getStringContents () const |
| Get the contents of a string token (without quotes). More... | |
| StringRef | getIdentifier () const |
| Get the identifier string for the current token, which should be an identifier or a string. More... | |
| StringRef | getString () const |
| Get the string for the current token, this includes all characters (for example, the quotes on strings) in the token. More... | |
| int64_t | getIntVal () const |
| APInt | getAPIntVal () const |
Target independent representation for an assembler token.
Definition at line 25 of file MCAsmLexer.h.
Definition at line 27 of file MCAsmLexer.h.
|
inline |
Definition at line 79 of file MCAsmLexer.h.
Definition at line 80 of file MCAsmLexer.h.
Definition at line 82 of file MCAsmLexer.h.
|
inline |
Definition at line 124 of file MCAsmLexer.h.
| SMLoc AsmToken::getEndLoc | ( | ) | const |
Definition at line 32 of file MCAsmLexer.cpp.
References llvm::StringRef::data(), llvm::SMLoc::getFromPointer(), and llvm::StringRef::size().
Referenced by getLocRange().
|
inline |
Get the identifier string for the current token, which should be an identifier or a string.
This gets the portion of the string which should be used as the identifier, e.g., it does not include the quotes on strings.
Definition at line 103 of file MCAsmLexer.h.
References getString(), getStringContents(), and Identifier.
|
inline |
Definition at line 119 of file MCAsmLexer.h.
References assert(), llvm::APInt::getZExtValue(), and Integer.
Referenced by llvm::MCAsmParser::parseIntToken().
|
inline |
Definition at line 85 of file MCAsmLexer.h.
Referenced by llvm::MCAsmLexer::getKind(), and llvm::MCAsmParser::parseOptionalToken().
| SMLoc AsmToken::getLoc | ( | ) | const |
Definition at line 28 of file MCAsmLexer.cpp.
References llvm::StringRef::data(), and llvm::SMLoc::getFromPointer().
Referenced by getLocRange(), llvm::MCParserUtils::parseAssignmentExpression(), llvm::MCTargetAsmParser::ParseInstruction(), and llvm::MCAsmParser::parseTokenLoc().
| SMRange AsmToken::getLocRange | ( | ) | const |
Definition at line 36 of file MCAsmLexer.cpp.
References getEndLoc(), and getLoc().
|
inline |
Get the string for the current token, this includes all characters (for example, the quotes on strings) in the token.
The returned StringRef points into the source manager's memory buffer, and is safe to store across calls to Lex().
Definition at line 114 of file MCAsmLexer.h.
Referenced by getIdentifier().
|
inline |
Get the contents of a string token (without quotes).
Definition at line 94 of file MCAsmLexer.h.
References assert(), llvm::StringRef::size(), llvm::StringRef::slice(), and String.
Referenced by getIdentifier().
Definition at line 86 of file MCAsmLexer.h.
Referenced by llvm::MCAsmLexer::is(), and llvm::AsmLexer::peekTokens().
Definition at line 87 of file MCAsmLexer.h.
Referenced by llvm::MCAsmLexer::isNot().
1.8.6