mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Don't repeat name in comment. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221664 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
/// AsmToken - Target independent representation for an assembler token.
|
/// Target independent representation for an assembler token.
|
||||||
class AsmToken {
|
class AsmToken {
|
||||||
public:
|
public:
|
||||||
enum TokenKind {
|
enum TokenKind {
|
||||||
@@ -76,24 +76,24 @@ public:
|
|||||||
SMLoc getEndLoc() const;
|
SMLoc getEndLoc() const;
|
||||||
SMRange getLocRange() const;
|
SMRange getLocRange() const;
|
||||||
|
|
||||||
/// getStringContents - Get the contents of a string token (without quotes).
|
/// Get the contents of a string token (without quotes).
|
||||||
StringRef getStringContents() const {
|
StringRef getStringContents() const {
|
||||||
assert(Kind == String && "This token isn't a string!");
|
assert(Kind == String && "This token isn't a string!");
|
||||||
return Str.slice(1, Str.size() - 1);
|
return Str.slice(1, Str.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getIdentifier - Get the identifier string for the current token, which
|
/// Get the identifier string for the current token, which should be an
|
||||||
/// should be an identifier or a string. This gets the portion of the string
|
/// identifier or a string. This gets the portion of the string which should
|
||||||
/// which should be used as the identifier, e.g., it does not include the
|
/// be used as the identifier, e.g., it does not include the quotes on
|
||||||
/// quotes on strings.
|
/// strings.
|
||||||
StringRef getIdentifier() const {
|
StringRef getIdentifier() const {
|
||||||
if (Kind == Identifier)
|
if (Kind == Identifier)
|
||||||
return getString();
|
return getString();
|
||||||
return getStringContents();
|
return getStringContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getString - Get the string for the current token, this includes all
|
/// Get the string for the current token, this includes all characters (for
|
||||||
/// characters (for example, the quotes on strings) in the token.
|
/// example, the quotes on strings) in the token.
|
||||||
///
|
///
|
||||||
/// The returned StringRef points into the source manager's memory buffer, and
|
/// The returned StringRef points into the source manager's memory buffer, and
|
||||||
/// is safe to store across calls to Lex().
|
/// is safe to store across calls to Lex().
|
||||||
@@ -114,8 +114,8 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// MCAsmLexer - Generic assembler lexer interface, for use by target specific
|
/// Generic assembler lexer interface, for use by target specific assembly
|
||||||
/// assembly lexers.
|
/// lexers.
|
||||||
class MCAsmLexer {
|
class MCAsmLexer {
|
||||||
/// The current token, stored in the base class for faster access.
|
/// The current token, stored in the base class for faster access.
|
||||||
AsmToken CurTok;
|
AsmToken CurTok;
|
||||||
@@ -143,7 +143,7 @@ protected: // Can only create subclasses.
|
|||||||
public:
|
public:
|
||||||
virtual ~MCAsmLexer();
|
virtual ~MCAsmLexer();
|
||||||
|
|
||||||
/// Lex - Consume the next token from the input stream and return it.
|
/// Consume the next token from the input stream and return it.
|
||||||
///
|
///
|
||||||
/// The lexer will continuosly return the end-of-file token once the end of
|
/// The lexer will continuosly return the end-of-file token once the end of
|
||||||
/// the main input file has been reached.
|
/// the main input file has been reached.
|
||||||
@@ -153,37 +153,37 @@ public:
|
|||||||
|
|
||||||
virtual StringRef LexUntilEndOfStatement() = 0;
|
virtual StringRef LexUntilEndOfStatement() = 0;
|
||||||
|
|
||||||
/// getLoc - Get the current source location.
|
/// Get the current source location.
|
||||||
SMLoc getLoc() const;
|
SMLoc getLoc() const;
|
||||||
|
|
||||||
/// getTok - Get the current (last) lexed token.
|
/// Get the current (last) lexed token.
|
||||||
const AsmToken &getTok() {
|
const AsmToken &getTok() {
|
||||||
return CurTok;
|
return CurTok;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// peekTok - Look ahead at the next token to be lexed.
|
/// Look ahead at the next token to be lexed.
|
||||||
virtual const AsmToken peekTok(bool ShouldSkipSpace = true) = 0;
|
virtual const AsmToken peekTok(bool ShouldSkipSpace = true) = 0;
|
||||||
|
|
||||||
/// getErrLoc - Get the current error location
|
/// Get the current error location
|
||||||
const SMLoc &getErrLoc() {
|
const SMLoc &getErrLoc() {
|
||||||
return ErrLoc;
|
return ErrLoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getErr - Get the current error string
|
/// Get the current error string
|
||||||
const std::string &getErr() {
|
const std::string &getErr() {
|
||||||
return Err;
|
return Err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getKind - Get the kind of current token.
|
/// Get the kind of current token.
|
||||||
AsmToken::TokenKind getKind() const { return CurTok.getKind(); }
|
AsmToken::TokenKind getKind() const { return CurTok.getKind(); }
|
||||||
|
|
||||||
/// is - Check if the current token has kind \p K.
|
/// Check if the current token has kind \p K.
|
||||||
bool is(AsmToken::TokenKind K) const { return CurTok.is(K); }
|
bool is(AsmToken::TokenKind K) const { return CurTok.is(K); }
|
||||||
|
|
||||||
/// isNot - Check if the current token has kind \p K.
|
/// Check if the current token has kind \p K.
|
||||||
bool isNot(AsmToken::TokenKind K) const { return CurTok.isNot(K); }
|
bool isNot(AsmToken::TokenKind K) const { return CurTok.isNot(K); }
|
||||||
|
|
||||||
/// setSkipSpace - Set whether spaces should be ignored by the lexer
|
/// Set whether spaces should be ignored by the lexer
|
||||||
void setSkipSpace(bool val) { SkipSpace = val; }
|
void setSkipSpace(bool val) { SkipSpace = val; }
|
||||||
|
|
||||||
bool getAllowAtInIdentifier() { return AllowAtInIdentifier; }
|
bool getAllowAtInIdentifier() { return AllowAtInIdentifier; }
|
||||||
|
Reference in New Issue
Block a user