|
LLVM
7.0.0
|
Generic assembler lexer interface, for use by target specific assembly lexers. More...
#include "llvm/MC/MCParser/MCAsmLexer.h"
Public Member Functions | |
| MCAsmLexer (const MCAsmLexer &)=delete | |
| MCAsmLexer & | operator= (const MCAsmLexer &)=delete |
| virtual | ~MCAsmLexer () |
| bool | IsaAltMacroMode () |
| void | SetAltMacroMode (bool AltMacroSet) |
| const AsmToken & | Lex () |
| Consume the next token from the input stream and return it. More... | |
| void | UnLex (AsmToken const &Token) |
| bool | isAtStartOfStatement () |
| virtual StringRef | LexUntilEndOfStatement ()=0 |
| SMLoc | getLoc () const |
| Get the current source location. More... | |
| const AsmToken & | getTok () const |
| Get the current (last) lexed token. More... | |
| const AsmToken | peekTok (bool ShouldSkipSpace=true) |
| Look ahead at the next token to be lexed. More... | |
| virtual size_t | peekTokens (MutableArrayRef< AsmToken > Buf, bool ShouldSkipSpace=true)=0 |
| Look ahead an arbitrary number of tokens. More... | |
| SMLoc | getErrLoc () |
| Get the current error location. More... | |
| const std::string & | getErr () |
| Get the current error string. More... | |
| AsmToken::TokenKind | getKind () const |
| Get the kind of current token. More... | |
| bool | is (AsmToken::TokenKind K) const |
Check if the current token has kind K. More... | |
| bool | isNot (AsmToken::TokenKind K) const |
Check if the current token has kind K. More... | |
| void | setSkipSpace (bool val) |
| Set whether spaces should be ignored by the lexer. More... | |
| bool | getAllowAtInIdentifier () |
| void | setAllowAtInIdentifier (bool v) |
| void | setCommentConsumer (AsmCommentConsumer *CommentConsumer) |
Protected Member Functions | |
| MCAsmLexer () | |
| virtual AsmToken | LexToken ()=0 |
| void | SetError (SMLoc errLoc, const std::string &err) |
Protected Attributes | |
| const char * | TokStart = nullptr |
| bool | SkipSpace = true |
| bool | AllowAtInIdentifier |
| bool | IsAtStartOfStatement = true |
| AsmCommentConsumer * | CommentConsumer = nullptr |
| bool | AltMacroMode |
Generic assembler lexer interface, for use by target specific assembly lexers.
Definition at line 40 of file MCAsmLexer.h.
|
protected |
Definition at line 18 of file MCAsmLexer.cpp.
References llvm::AsmToken::Space, and ~MCAsmLexer().
|
delete |
|
virtualdefault |
Referenced by MCAsmLexer().
|
inline |
Definition at line 152 of file MCAsmLexer.h.
Referenced by parseSectionFlags().
|
inline |
Get the current error string.
Definition at line 136 of file MCAsmLexer.h.
Referenced by parseHexOcta(), and llvm::AsmLexer::peekTokens().
|
inline |
Get the current error location.
Definition at line 131 of file MCAsmLexer.h.
Referenced by llvm::AsmLexer::peekTokens().
|
inline |
Get the kind of current token.
Definition at line 141 of file MCAsmLexer.h.
Referenced by getGNUBinOpPrecedence(), isOperator(), and llvm::AVROperand::print().
| SMLoc MCAsmLexer::getLoc | ( | ) | const |
Get the current source location.
Definition at line 24 of file MCAsmLexer.cpp.
References llvm::SMLoc::getFromPointer(), and TokStart.
Referenced by getGNUBinOpPrecedence(), llvm::AsmToken::getLocRange(), isOperator(), isValidEncoding(), parseHexOcta(), llvm::AVROperand::print(), and RefineErrorLoc().
Get the current (last) lexed token.
Definition at line 109 of file MCAsmLexer.h.
Referenced by llvm::MCAsmParser::getTok(), and isOperator().
|
inline |
Check if the current token has kind K.
Definition at line 144 of file MCAsmLexer.h.
Referenced by getGNUBinOpPrecedence(), isOperator(), isValidEncoding(), llvm::AsmLexer::LexToken(), parseHexOcta(), parseSectionFlags(), and RefineErrorLoc().
|
inline |
Definition at line 70 of file MCAsmLexer.h.
Referenced by isOperator().
|
inline |
Definition at line 101 of file MCAsmLexer.h.
|
inline |
Check if the current token has kind K.
Definition at line 147 of file MCAsmLexer.h.
Referenced by getGNUBinOpPrecedence(), hasPrefix(), isOperator(), parseHexOcta(), parseSectionFlags(), and RefineErrorLoc().
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 main input file has been reached.
Definition at line 82 of file MCAsmLexer.h.
References assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorBase::empty(), llvm::AsmToken::EndOfStatement, llvm::SmallVectorImpl< T >::erase(), llvm::SmallVectorTemplateCommon< T >::front(), llvm::SmallVectorImpl< T >::insert(), and T.
Referenced by llvm::MCAsmParser::Error(), getGNUBinOpPrecedence(), isOperator(), isValidEncoding(), and parseHexOcta().
|
protectedpure virtual |
Implemented in llvm::AsmLexer.
|
pure virtual |
Implemented in llvm::AsmLexer.
|
delete |
Look ahead at the next token to be lexed.
Definition at line 114 of file MCAsmLexer.h.
References assert().
Referenced by isOperator(), llvm::AVROperand::print(), and RefineErrorLoc().
|
pure virtual |
Look ahead an arbitrary number of tokens.
Implemented in llvm::AsmLexer.
Referenced by llvm::AVROperand::print().
|
inline |
Definition at line 153 of file MCAsmLexer.h.
|
inline |
Definition at line 74 of file MCAsmLexer.h.
|
inline |
Definition at line 155 of file MCAsmLexer.h.
Definition at line 60 of file MCAsmLexer.h.
Referenced by llvm::AsmLexer::peekTokens(), and llvm::AsmLexer::setBuffer().
|
inline |
Set whether spaces should be ignored by the lexer.
Definition at line 150 of file MCAsmLexer.h.
Referenced by isOperator().
Definition at line 96 of file MCAsmLexer.h.
References llvm::SmallVectorTemplateCommon< T >::begin(), and llvm::SmallVectorImpl< T >::insert().
Referenced by getGNUBinOpPrecedence(), and llvm::AsmLexer::LexToken().
|
protected |
Definition at line 51 of file MCAsmLexer.h.
Referenced by llvm::AsmLexer::AsmLexer(), and IsIdentifierChar().
|
protected |
Definition at line 55 of file MCAsmLexer.h.
|
protected |
Definition at line 53 of file MCAsmLexer.h.
Referenced by IsIdentifierChar().
Definition at line 52 of file MCAsmLexer.h.
Definition at line 50 of file MCAsmLexer.h.
Referenced by llvm::AsmLexer::LexToken(), and llvm::AsmLexer::peekTokens().
Definition at line 49 of file MCAsmLexer.h.
Referenced by getLoc(), intToken(), IsIdentifierChar(), llvm::AsmLexer::LexToken(), llvm::AsmLexer::LexUntilEndOfStatement(), llvm::AsmLexer::peekTokens(), and llvm::AsmLexer::setBuffer().
1.8.13