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 //===----------------------------------------------------------------------===//
33 AsmParser(SourceMgr &SM, MCContext &ctx, MCStreamer &OutStr)
34 : Lexer(SM), Ctx(ctx), Out(OutStr) {}
40 bool ParseStatement();
42 bool Error(SMLoc L, const char *Msg);
43 bool TokError(const char *Msg);
45 void EatToEndOfStatement();
47 bool ParseAssignment(const char *Name, bool IsDotSet);
49 /// ParseExpression - Parse a general assembly expression.
51 /// @param Res - The resulting expression. The pointer value is null on error.
52 /// @result - False on success.
53 bool ParseExpression(AsmExpr *&Res);
55 /// ParseAbsoluteExpr - Parse an expression which must evaluate to an absolute
58 /// @param Res - The value of the absolute expression. The result is undefined
60 /// @result - False on success.
61 bool ParseAbsoluteExpression(int64_t &Res);
63 bool ParsePrimaryExpr(AsmExpr *&Res);
64 bool ParseBinOpRHS(unsigned Precedence, AsmExpr *&Res);
65 bool ParseParenExpr(AsmExpr *&Res);
68 bool ParseX86InstOperands(MCInst &Inst);
69 bool ParseX86Operand(X86Operand &Op);
70 bool ParseX86MemOperand(X86Operand &Op);
73 bool ParseDirectiveDarwinSection(); // Darwin specific ".section".
74 bool ParseDirectiveSectionSwitch(const char *Section,
75 const char *Directives = 0);
76 bool ParseDirectiveAscii(bool ZeroTerminated); // ".ascii", ".asciiz"
77 bool ParseDirectiveValue(unsigned Size); // ".byte", ".long", ...
78 bool ParseDirectiveFill(); // ".fill"
79 bool ParseDirectiveSpace(); // ".space"
80 bool ParseDirectiveSet(); // ".set"
81 bool ParseDirectiveOrg(); // ".org"
85 } // end namespace llvm