10 #ifndef LLVM_MC_MCPARSER_MCASMLEXER_H
11 #define LLVM_MC_MCPARSER_MCASMLEXER_H
16 #include "llvm/Support/DataTypes.h"
67 : Kind(Kind), Str(Str), IntVal(IntVal) {}
69 : Kind(Kind), Str(Str), IntVal(64, IntVal,
true) {}
81 assert(Kind ==
String &&
"This token isn't a string!");
106 assert(Kind ==
Integer &&
"This token isn't an integer!");
112 "This token isn't an integer!");
Represents a range in source code.
AsmToken(TokenKind Kind, StringRef Str, APInt IntVal)
uint64_t getZExtValue() const
Get zero extended value.
virtual const AsmToken peekTok(bool ShouldSkipSpace=true)=0
Look ahead at the next token to be lexed.
size_t size() const
size - Get the string size.
TokenKind getKind() const
void setSkipSpace(bool val)
Set whether spaces should be ignored by the lexer.
virtual AsmToken LexToken()=0
StringRef getString() const
Get the string for the current token, this includes all characters (for example, the quotes on string...
bool isNot(TokenKind K) const
SMLoc getLoc() const
Get the current source location.
const AsmToken & getTok() const
Get the current (last) lexed token.
Generic assembler lexer interface, for use by target specific assembly lexers.
AsmToken::TokenKind getKind() const
Get the kind of current token.
Target independent representation for an assembler token.
This file implements a class to represent arbitrary precision integral constant values and operations...
bool isNot(AsmToken::TokenKind K) const
Check if the current token has kind K.
int64_t getIntVal() const
StringRef getStringContents() const
Get the contents of a string token (without quotes).
const std::string & getErr()
Get the current error string.
bool getAllowAtInIdentifier()
bool is(AsmToken::TokenKind K) const
Check if the current token has kind K.
AsmToken(TokenKind Kind, StringRef Str, int64_t IntVal=0)
virtual StringRef LexUntilEndOfStatement()=0
SMRange getLocRange() const
const SMLoc & getErrLoc()
Get the current error location.
bool is(TokenKind K) const
const AsmToken & Lex()
Consume the next token from the input stream and return it.
Class for arbitrary precision integers.
StringRef getIdentifier() const
Get the identifier string for the current token, which should be an identifier or a string...
APInt getAPIntVal() const
void SetError(const SMLoc &errLoc, const std::string &err)
StringRef - Represent a constant reference to a string, i.e.
StringRef slice(size_t Start, size_t End) const
Return a reference to the substring from [Start, End).
Represents a location in source code.
void setAllowAtInIdentifier(bool v)