LLVM  3.7.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::MCAsmLexer Class Referenceabstract

Generic assembler lexer interface, for use by target specific assembly lexers. More...

#include <MCAsmLexer.h>

Inheritance diagram for llvm::MCAsmLexer:
[legend]
Collaboration diagram for llvm::MCAsmLexer:
[legend]

Public Member Functions

virtual ~MCAsmLexer ()
 
const AsmTokenLex ()
 Consume the next token from the input stream and return it. More...
 
virtual StringRef LexUntilEndOfStatement ()=0
 
SMLoc getLoc () const
 Get the current source location. More...
 
const AsmTokengetTok () const
 Get the current (last) lexed token. More...
 
virtual const AsmToken peekTok (bool ShouldSkipSpace=true)=0
 Look ahead at the next token to be lexed. More...
 
const SMLocgetErrLoc ()
 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)
 

Protected Member Functions

 MCAsmLexer ()
 
virtual AsmToken LexToken ()=0
 
void SetError (const SMLoc &errLoc, const std::string &err)
 

Protected Attributes

const char * TokStart
 
bool SkipSpace
 
bool AllowAtInIdentifier
 

Detailed Description

Generic assembler lexer interface, for use by target specific assembly lexers.

Definition at line 119 of file MCAsmLexer.h.

Constructor & Destructor Documentation

MCAsmLexer::MCAsmLexer ( )
protected

Definition at line 15 of file MCAsmLexer.cpp.

MCAsmLexer::~MCAsmLexer ( )
virtual

Definition at line 19 of file MCAsmLexer.cpp.

Member Function Documentation

bool llvm::MCAsmLexer::getAllowAtInIdentifier ( )
inline

Definition at line 189 of file MCAsmLexer.h.

References AllowAtInIdentifier.

const std::string& llvm::MCAsmLexer::getErr ( )
inline

Get the current error string.

Definition at line 173 of file MCAsmLexer.h.

Referenced by llvm::AsmLexer::peekTok().

const SMLoc& llvm::MCAsmLexer::getErrLoc ( )
inline

Get the current error location.

Definition at line 168 of file MCAsmLexer.h.

Referenced by llvm::AsmLexer::peekTok().

AsmToken::TokenKind llvm::MCAsmLexer::getKind ( ) const
inline

Get the kind of current token.

Definition at line 178 of file MCAsmLexer.h.

References llvm::AsmToken::getKind().

SMLoc MCAsmLexer::getLoc ( ) const

Get the current source location.

Definition at line 22 of file MCAsmLexer.cpp.

References llvm::SMLoc::getFromPointer(), and TokStart.

Referenced by llvm::MCParserUtils::parseAssignmentExpression().

const AsmToken& llvm::MCAsmLexer::getTok ( ) const
inline

Get the current (last) lexed token.

Definition at line 160 of file MCAsmLexer.h.

Referenced by llvm::MCAsmParser::getTok().

bool llvm::MCAsmLexer::is ( AsmToken::TokenKind  K) const
inline

Check if the current token has kind K.

Definition at line 181 of file MCAsmLexer.h.

References llvm::AsmToken::is().

bool llvm::MCAsmLexer::isNot ( AsmToken::TokenKind  K) const
inline

Check if the current token has kind K.

Definition at line 184 of file MCAsmLexer.h.

References llvm::AsmToken::isNot().

Referenced by llvm::MCParserUtils::parseAssignmentExpression().

const AsmToken& llvm::MCAsmLexer::Lex ( )
inline

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 150 of file MCAsmLexer.h.

References LexToken().

virtual AsmToken llvm::MCAsmLexer::LexToken ( )
protectedpure virtual

Implemented in llvm::AsmLexer.

Referenced by Lex().

virtual StringRef llvm::MCAsmLexer::LexUntilEndOfStatement ( )
pure virtual

Implemented in llvm::AsmLexer.

virtual const AsmToken llvm::MCAsmLexer::peekTok ( bool  ShouldSkipSpace = true)
pure virtual

Look ahead at the next token to be lexed.

Implemented in llvm::AsmLexer.

void llvm::MCAsmLexer::setAllowAtInIdentifier ( bool  v)
inline

Definition at line 190 of file MCAsmLexer.h.

References AllowAtInIdentifier.

void llvm::MCAsmLexer::SetError ( const SMLoc errLoc,
const std::string &  err 
)
inlineprotected

Definition at line 138 of file MCAsmLexer.h.

Referenced by llvm::AsmLexer::peekTok().

void llvm::MCAsmLexer::setSkipSpace ( bool  val)
inline

Set whether spaces should be ignored by the lexer.

Definition at line 187 of file MCAsmLexer.h.

References SkipSpace.

Member Data Documentation

bool llvm::MCAsmLexer::AllowAtInIdentifier
protected
bool llvm::MCAsmLexer::SkipSpace
protected

Definition at line 131 of file MCAsmLexer.h.

Referenced by llvm::AsmLexer::LexToken(), llvm::AsmLexer::peekTok(), and setSkipSpace().

const char* llvm::MCAsmLexer::TokStart
protected

The documentation for this class was generated from the following files: