Move TableGen's parser and entry point into a library
[oota-llvm.git] / include / llvm / TableGen / TableGenAction.h
1 //===- llvm/TableGen/TableGenAction.h - defines TableGenAction --*- 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 file defines the TableGenAction base class to be derived from by
11 // tblgen tools.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_TABLEGEN_TABLEGENACTION_H
16 #define LLVM_TABLEGEN_TABLEGENACTION_H
17
18 namespace llvm {
19
20 class raw_ostream;
21 class RecordKeeper;
22
23 class TableGenAction {
24 public:
25   virtual ~TableGenAction() {}
26
27   /// Perform the action using Records, and write output to OS.
28   /// @returns true on error, false otherwise
29   virtual bool operator()(raw_ostream &OS, RecordKeeper &Records) = 0;
30 };
31
32 }
33
34 #endif