LLVM API Documentation

Public Types | Public Member Functions
llvm::AsmToken Class Reference

AsmToken - Target independent representation for an assembler token. More...

#include <MCAsmLexer.h>

List of all members.

Public Types

enum  TokenKind {
  Eof, Error, Identifier, String,
  Integer, BigNum, Real, 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
}

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
StringRef getStringContents () const
 getStringContents - Get the contents of a string token (without quotes).
StringRef getIdentifier () const
StringRef getString () const
int64_t getIntVal () const
APInt getAPIntVal () const

Detailed Description

AsmToken - Target independent representation for an assembler token.

Definition at line 22 of file MCAsmLexer.h.


Member Enumeration Documentation

Enumerator:
Eof 
Error 
Identifier 
String 
Integer 
BigNum 
Real 
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 

Definition at line 24 of file MCAsmLexer.h.


Constructor & Destructor Documentation

Definition at line 65 of file MCAsmLexer.h.

llvm::AsmToken::AsmToken ( TokenKind  _Kind,
StringRef  _Str,
APInt  _IntVal 
) [inline]

Definition at line 66 of file MCAsmLexer.h.

llvm::AsmToken::AsmToken ( TokenKind  _Kind,
StringRef  _Str,
int64_t  _IntVal = 0 
) [inline]

Definition at line 68 of file MCAsmLexer.h.


Member Function Documentation

APInt llvm::AsmToken::getAPIntVal ( ) const [inline]

Definition at line 109 of file MCAsmLexer.h.

References BigNum, and Integer.

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

References getString(), getStringContents(), and Identifier.

int64_t llvm::AsmToken::getIntVal ( ) const [inline]

Definition at line 104 of file MCAsmLexer.h.

References llvm::APInt::getZExtValue(), and Integer.

TokenKind llvm::AsmToken::getKind ( ) const [inline]

Definition at line 71 of file MCAsmLexer.h.

Referenced by llvm::MCAsmLexer::getKind().

Definition at line 26 of file MCAsmLexer.cpp.

References llvm::StringRef::data(), and llvm::SMLoc::getFromPointer().

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

Referenced by getIdentifier().

getStringContents - Get the contents of a string token (without quotes).

Definition at line 79 of file MCAsmLexer.h.

References llvm::StringRef::size(), llvm::StringRef::slice(), and String.

Referenced by getIdentifier().

bool llvm::AsmToken::is ( TokenKind  K) const [inline]

Definition at line 72 of file MCAsmLexer.h.

Referenced by llvm::MCAsmLexer::is().

bool llvm::AsmToken::isNot ( TokenKind  K) const [inline]

Definition at line 73 of file MCAsmLexer.h.

Referenced by llvm::MCAsmLexer::isNot().


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