llvm-6502/tools/llvm-mc/AsmParser.h
Chris Lattner 74ec1a3b11 Implement full support for parsing primary expressions. We can now parse
all of health and voronoi (ignoring directives).  We only get 409 lines into
176.gcc though because we don't have binary operators yet:

Parsing 176.gcc.llc.s:409: unexpected token in operand list
	movsbl	_arityvec+1(,%edi,8), %eax
	      	         ^



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-22 06:32:03 +00:00

49 lines
1.1 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 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