diff options
Diffstat (limited to 'tools/llvm-mc/AsmParser.h')
-rw-r--r-- | tools/llvm-mc/AsmParser.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/llvm-mc/AsmParser.h b/tools/llvm-mc/AsmParser.h new file mode 100644 index 0000000..82eb433 --- /dev/null +++ b/tools/llvm-mc/AsmParser.h @@ -0,0 +1,48 @@ +//===- 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 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 ParseX86Operand(X86Operand &Op); + bool ParseX86MemOperand(X86Operand &Op); + bool ParseExpression(int64_t &Res); + bool ParsePrimaryExpr(int64_t &Res); + bool ParseParenExpr(int64_t &Res); +}; + +} // end namespace llvm + +#endif |