blob: 1e292279259ec9a3161568a988f7d99dc72f5000 [file] [log] [blame]
Andreas Huberc9410c72016-07-28 12:18:40 -07001#ifndef AST_H_
2
3#define AST_H_
4
5#include <android-base/macros.h>
6#include <utils/Vector.h>
7
8namespace android {
9
10struct Formatter;
11struct Type;
12struct Scope;
13
14struct 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
31private:
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_