| OLD | NEW |
| 1 //===- TGParser.h - Parser for TableGen Files -------------------*- C++ -*-===// | 1 //===- TGParser.h - Parser for TableGen Files -------------------*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This class represents the Parser for tablegen files. | 10 // This class represents the Parser for tablegen files. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 std::vector<std::vector<LetRecord> > LetStack; | 46 std::vector<std::vector<LetRecord> > LetStack; |
| 47 std::map<std::string, MultiClass*> MultiClasses; | 47 std::map<std::string, MultiClass*> MultiClasses; |
| 48 | 48 |
| 49 /// CurMultiClass - If we are parsing a 'multiclass' definition, this is the | 49 /// CurMultiClass - If we are parsing a 'multiclass' definition, this is the |
| 50 /// current value. | 50 /// current value. |
| 51 MultiClass *CurMultiClass; | 51 MultiClass *CurMultiClass; |
| 52 | 52 |
| 53 // Record tracker | 53 // Record tracker |
| 54 RecordKeeper &Records; | 54 RecordKeeper &Records; |
| 55 public: | 55 public: |
| 56 TGParser(SourceMgr &SrcMgr, RecordKeeper &records) : | 56 TGParser(SourceMgr &SrcMgr, RecordKeeper &records, |
| 57 Lex(SrcMgr), CurMultiClass(0), Records(records) {} | 57 std::vector<std::string> PreProcDefines) |
| 58 | 58 : Lex(SrcMgr, PreProcDefines), CurMultiClass(0), Records(records) {} |
| 59 |
| 59 /// ParseFile - Main entrypoint for parsing a tblgen file. These parser | 60 /// ParseFile - Main entrypoint for parsing a tblgen file. These parser |
| 60 /// routines return true on error, or false on success. | 61 /// routines return true on error, or false on success. |
| 61 bool ParseFile(); | 62 bool ParseFile(); |
| 62 | 63 |
| 63 bool Error(SMLoc L, const Twine &Msg) const { | 64 bool Error(SMLoc L, const Twine &Msg) const { |
| 64 PrintError(L, Msg); | 65 PrintError(L, Msg); |
| 65 return true; | 66 return true; |
| 66 } | 67 } |
| 67 bool TokError(const Twine &Msg) const { | 68 bool TokError(const Twine &Msg) const { |
| 68 return Error(Lex.getLoc(), Msg); | 69 return Error(Lex.getLoc(), Msg); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 RecTy *ParseOperatorType(); | 114 RecTy *ParseOperatorType(); |
| 114 std::string ParseObjectName(); | 115 std::string ParseObjectName(); |
| 115 Record *ParseClassID(); | 116 Record *ParseClassID(); |
| 116 MultiClass *ParseMultiClassID(); | 117 MultiClass *ParseMultiClassID(); |
| 117 Record *ParseDefmID(); | 118 Record *ParseDefmID(); |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 } // end namespace llvm | 121 } // end namespace llvm |
| 121 | 122 |
| 122 #endif | 123 #endif |
| OLD | NEW |