mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
43f200c74a
llvm-svn: 73982
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
//===- AsmParser.h - Parser for Assembly Files ------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This class declares the parser for assembly files.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef ASMPARSER_H
|
|
#define ASMPARSER_H
|
|
|
|
#include "AsmLexer.h"
|
|
|
|
namespace llvm {
|
|
class MCInst;
|
|
|
|
class AsmParser {
|
|
AsmLexer Lexer;
|
|
struct X86Operand;
|
|
|
|
public:
|
|
AsmParser(SourceMgr &SM) : Lexer(SM) {}
|
|
~AsmParser() {}
|
|
|
|
bool Run();
|
|
|
|
private:
|
|
bool ParseStatement();
|
|
|
|
bool Error(SMLoc L, const char *Msg);
|
|
bool TokError(const char *Msg);
|
|
|
|
void EatToEndOfStatement();
|
|
|
|
bool ParseExpression(int64_t &Res);
|
|
bool ParsePrimaryExpr(int64_t &Res);
|
|
bool ParseBinOpRHS(unsigned Precedence, int64_t &Res);
|
|
bool ParseParenExpr(int64_t &Res);
|
|
|
|
// X86 specific.
|
|
bool ParseX86InstOperands(MCInst &Inst);
|
|
bool ParseX86Operand(X86Operand &Op);
|
|
bool ParseX86MemOperand(X86Operand &Op);
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
#endif
|