blob: 670d987bfc3465136c6296f4ba31deb317029541 [file] [log] [blame]
Chris Lattner3b4bfbd2009-06-21 20:16:42 +00001//===- AsmParser.h - Parser for Assembly Files ------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This class declares the parser for assembly files.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef ASMPARSER_H
15#define ASMPARSER_H
16
17#include "AsmLexer.h"
18
19namespace llvm {
Chris Lattnere883aa62009-06-22 01:29:09 +000020
Chris Lattner3b4bfbd2009-06-21 20:16:42 +000021class AsmParser {
22 AsmLexer Lexer;
Chris Lattnere883aa62009-06-22 01:29:09 +000023 struct X86Operand;
Chris Lattner3b4bfbd2009-06-21 20:16:42 +000024
25public:
26 AsmParser(SourceMgr &SM) : Lexer(SM) {}
27 ~AsmParser() {}
28
29 bool Run();
30
Chris Lattnercfd2e3b2009-06-21 20:54:55 +000031private:
32 bool ParseStatement();
33
Chris Lattnerf6611852009-06-21 21:22:11 +000034 bool Error(SMLoc L, const char *Msg);
35 bool TokError(const char *Msg);
Chris Lattnere883aa62009-06-22 01:29:09 +000036
37 void EatToEndOfStatement();
38
39 bool ParseX86Operand(X86Operand &Op);
Chris Lattner7bd4cc12009-06-22 05:51:26 +000040 bool ParseX86MemOperand(X86Operand &Op);
41 bool ParseExpression(int64_t &Res);
Chris Lattner3b4bfbd2009-06-21 20:16:42 +000042};
43
44} // end namespace llvm
45
46#endif