1 //===- AsmParser.h - Parser for Assembly Files ------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This class declares the parser for assembly files.
12 //===----------------------------------------------------------------------===//
32 AsmParser(SourceMgr &SM, MCContext &ctx, MCStreamer &OutStr)
33 : Lexer(SM), Ctx(ctx), Out(OutStr) {}
39 bool ParseStatement();
41 bool Error(SMLoc L, const char *Msg);
42 bool TokError(const char *Msg);
44 void EatToEndOfStatement();
46 bool ParseAssignment(const char *Name, bool IsDotSet);
47 bool ParseExpression(int64_t &Res);
48 bool ParsePrimaryExpr(int64_t &Res);
49 bool ParseBinOpRHS(unsigned Precedence, int64_t &Res);
50 bool ParseParenExpr(int64_t &Res);
53 bool ParseX86InstOperands(MCInst &Inst);
54 bool ParseX86Operand(X86Operand &Op);
55 bool ParseX86MemOperand(X86Operand &Op);
58 bool ParseDirectiveDarwinSection(); // Darwin specific ".section".
59 bool ParseDirectiveSectionSwitch(const char *Section,
60 const char *Directives = 0);
61 bool ParseDirectiveAscii(bool ZeroTerminated); // ".ascii", ".asciiz"
62 bool ParseDirectiveValue(unsigned Size); // ".byte", ".long", ...
63 bool ParseDirectiveFill(); // ".fill"
64 bool ParseDirectiveSpace(); // ".space"
65 bool ParseDirectiveSet(); // ".set"
66 bool ParseDirectiveOrg(); // ".org"
70 } // end namespace llvm