LLVM API Documentation
#include <MCAsmParser.h>
Public Types | |
typedef bool(* | DirectiveHandler )(MCAsmParserExtension *, StringRef, SMLoc) |
typedef std::pair < MCAsmParserExtension *, DirectiveHandler > | ExtensionDirectiveHandler |
Public Member Functions | |
virtual | ~MCAsmParser () |
virtual void | addDirectiveHandler (StringRef Directive, ExtensionDirectiveHandler Handler)=0 |
virtual SourceMgr & | getSourceManager ()=0 |
virtual MCAsmLexer & | getLexer ()=0 |
virtual MCContext & | getContext ()=0 |
virtual MCStreamer & | getStreamer ()=0 |
getStreamer - Return the output streamer for the assembler. More... | |
MCTargetAsmParser & | getTargetParser () const |
void | setTargetParser (MCTargetAsmParser &P) |
virtual unsigned | getAssemblerDialect () |
virtual void | setAssemblerDialect (unsigned i) |
bool | getShowParsedOperands () const |
void | setShowParsedOperands (bool Value) |
virtual bool | Run (bool NoInitialTextSection, bool NoFinalize=false)=0 |
Run - Run the parser on the input source buffer. More... | |
virtual void | setParsingInlineAsm (bool V)=0 |
virtual bool | isParsingInlineAsm ()=0 |
virtual bool | parseMSInlineAsm (void *AsmLoc, std::string &AsmString, unsigned &NumOutputs, unsigned &NumInputs, SmallVectorImpl< std::pair< void *, bool > > &OpDecls, SmallVectorImpl< std::string > &Constraints, SmallVectorImpl< std::string > &Clobbers, const MCInstrInfo *MII, const MCInstPrinter *IP, MCAsmParserSemaCallback &SI)=0 |
parseMSInlineAsm - Parse ms-style inline assembly. More... | |
virtual bool | Warning (SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0 |
virtual bool | Error (SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0 |
virtual const AsmToken & | Lex ()=0 |
const AsmToken & | getTok () |
getTok - Get the current AsmToken from the stream. More... | |
bool | TokError (const Twine &Msg, ArrayRef< SMRange > Ranges=None) |
Report an error at the current lexer location. More... | |
virtual bool | parseIdentifier (StringRef &Res)=0 |
virtual StringRef | parseStringToEndOfStatement ()=0 |
Parse up to the end of statement and return the contents from the current token until the end of the statement; the current token on exit will be either the EndOfStatement or EOF. More... | |
virtual bool | parseEscapedString (std::string &Data)=0 |
virtual void | eatToEndOfStatement ()=0 |
virtual bool | parseExpression (const MCExpr *&Res, SMLoc &EndLoc)=0 |
bool | parseExpression (const MCExpr *&Res) |
virtual bool | parsePrimaryExpr (const MCExpr *&Res, SMLoc &EndLoc)=0 |
virtual bool | parseParenExpression (const MCExpr *&Res, SMLoc &EndLoc)=0 |
virtual bool | parseAbsoluteExpression (int64_t &Res)=0 |
virtual void | checkForValidSection ()=0 |
Protected Member Functions | |
MCAsmParser () | |
MCAsmParser - Generic assembler parser interface, for use by target specific assembly parsers.
Definition at line 64 of file MCAsmParser.h.
typedef bool(* llvm::MCAsmParser::DirectiveHandler)(MCAsmParserExtension *, StringRef, SMLoc) |
Definition at line 66 of file MCAsmParser.h.
typedef std::pair<MCAsmParserExtension*, DirectiveHandler> llvm::MCAsmParser::ExtensionDirectiveHandler |
Definition at line 68 of file MCAsmParser.h.
|
protected |
Definition at line 20 of file MCAsmParser.cpp.
|
virtual |
Definition at line 23 of file MCAsmParser.cpp.
|
pure virtual |
|
pure virtual |
checkForValidSection - Ensure that we have a valid section set in the streamer. Otherwise, report an error and switch to .text.
|
pure virtual |
eatToEndOfStatement - Skip to the end of the current statement, for error recovery.
|
pure virtual |
Error - Emit an error at the location L
, with the message Msg
.
Referenced by llvm::MCAsmParserExtension::Error(), and TokError().
|
inlinevirtual |
Definition at line 99 of file MCAsmParser.h.
|
pure virtual |
Referenced by llvm::MCAsmParserExtension::getContext().
|
pure virtual |
Referenced by llvm::MCAsmParserExtension::getLexer(), getTok(), and TokError().
|
inline |
Definition at line 102 of file MCAsmParser.h.
|
pure virtual |
Referenced by llvm::MCAsmParserExtension::getSourceManager().
|
pure virtual |
getStreamer - Return the output streamer for the assembler.
Referenced by llvm::MCAsmParserExtension::getStreamer().
|
inline |
Definition at line 96 of file MCAsmParser.h.
const AsmToken & MCAsmParser::getTok | ( | ) |
getTok - Get the current AsmToken from the stream.
Definition at line 32 of file MCAsmParser.cpp.
References getLexer(), and llvm::MCAsmLexer::getTok().
Referenced by llvm::MCAsmParserExtension::getTok().
|
pure virtual |
|
pure virtual |
Lex - Get the next AsmToken in the stream, possibly handling file inclusion first.
Referenced by llvm::MCAsmParserExtension::Lex().
|
pure virtual |
parseAbsoluteExpression - Parse an expression which must evaluate to an absolute value.
Res | - The value of the absolute expression. The result is undefined on error. |
|
pure virtual |
parseEscapedString - Parse the current token as a string which may include escaped characters and return the string contents.
|
pure virtual |
parseExpression - Parse an arbitrary expression.
Res | - The value of the expression. The result is undefined on error. |
Referenced by parseExpression().
Definition at line 41 of file MCAsmParser.cpp.
References parseExpression().
parseIdentifier - Parse an identifier or string (as a quoted identifier) and set Res
to the identifier contents.
|
pure virtual |
parseMSInlineAsm - Parse ms-style inline assembly.
|
pure virtual |
parseParenExpression - Parse an arbitrary expression, assuming that an initial '(' has already been consumed.
Res | - The value of the expression. The result is undefined on error. |
|
pure virtual |
parsePrimaryExpr - Parse a primary expression.
Res | - The value of the expression. The result is undefined on error. |
|
pure virtual |
Parse up to the end of statement and return the contents from the current token until the end of the statement; the current token on exit will be either the EndOfStatement or EOF.
|
pure virtual |
Run - Run the parser on the input source buffer.
|
inlinevirtual |
Definition at line 100 of file MCAsmParser.h.
|
pure virtual |
|
inline |
Definition at line 103 of file MCAsmParser.h.
void MCAsmParser::setTargetParser | ( | MCTargetAsmParser & | P | ) |
Definition at line 26 of file MCAsmParser.cpp.
References llvm::MCAsmParserExtension::Initialize(), and P.
Report an error at the current lexer location.
Definition at line 36 of file MCAsmParser.cpp.
References Error(), and getLexer().
Referenced by llvm::MCAsmParserExtension::TokError().
|
pure virtual |
Warning - Emit a warning at the location L
, with the message Msg
.
Referenced by llvm::MCAsmParserExtension::Warning().