Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame^] | 1 | #ifndef AST_H_ |
| 2 | |
| 3 | #define AST_H_ |
| 4 | |
| 5 | #include <android-base/macros.h> |
| 6 | #include <utils/Vector.h> |
| 7 | |
| 8 | namespace android { |
| 9 | |
| 10 | struct Formatter; |
| 11 | struct Type; |
| 12 | struct Scope; |
| 13 | |
| 14 | struct AST { |
| 15 | AST(); |
| 16 | ~AST(); |
| 17 | |
| 18 | static AST *Parse(const char *path); |
| 19 | |
| 20 | void enterScope(Scope *container); |
| 21 | void leaveScope(); |
| 22 | Scope *scope(); |
| 23 | |
| 24 | void *scanner(); |
| 25 | void setScanner(void *scanner); |
| 26 | |
| 27 | Type *lookupType(const char *name); |
| 28 | |
| 29 | void dump(Formatter &out) const; |
| 30 | |
| 31 | private: |
| 32 | Vector<Scope *> mScopePath; |
| 33 | |
| 34 | void *mScanner; |
| 35 | Scope *mRootScope; |
| 36 | |
| 37 | DISALLOW_COPY_AND_ASSIGN(AST); |
| 38 | }; |
| 39 | |
| 40 | } // namespace android |
| 41 | |
| 42 | #endif // AST_H_ |