blob: 7fa34b95536b616cf08337d9300fdc95c8bb8b4e [file] [log] [blame]
Andreas Huberc9410c72016-07-28 12:18:40 -07001#include "AST.h"
Andreas Huber5345ec22016-07-29 13:33:27 -07002#include "Coordinator.h"
Andreas Huberc9410c72016-07-28 12:18:40 -07003#include "Formatter.h"
Andreas Huber84f89de2016-07-28 15:39:51 -07004#include "FQName.h"
Andreas Huberc9410c72016-07-28 12:18:40 -07005
Andreas Huber68f24592016-07-29 14:53:48 -07006#include <android-base/logging.h>
Andreas Huberc9410c72016-07-28 12:18:40 -07007#include <stdio.h>
8
9using namespace android;
10
11int main(int argc, const char *const argv[]) {
Andreas Huber5345ec22016-07-29 13:33:27 -070012 Coordinator coordinator;
13
Andreas Hubereb1081f2016-07-28 13:13:24 -070014 for (int i = 1; i < argc; ++i) {
Andreas Huber68f24592016-07-29 14:53:48 -070015 FQName fqName(argv[i]);
16 CHECK(fqName.isValid() && fqName.isFullyQualified());
17
18 AST *ast = coordinator.parse(fqName);
19
20 if (ast == NULL) {
21 continue;
22 }
Andreas Huberc9410c72016-07-28 12:18:40 -070023
Andreas Hubereb1081f2016-07-28 13:13:24 -070024 Formatter out;
Andreas Huberc9410c72016-07-28 12:18:40 -070025
Andreas Hubereb1081f2016-07-28 13:13:24 -070026 printf("========================================\n");
Andreas Huberc9410c72016-07-28 12:18:40 -070027
Andreas Hubereb1081f2016-07-28 13:13:24 -070028 ast->dump(out);
Andreas Huberc9410c72016-07-28 12:18:40 -070029
Andreas Hubereb1081f2016-07-28 13:13:24 -070030 delete ast;
31 ast = NULL;
32 }
Andreas Huberc9410c72016-07-28 12:18:40 -070033
Andreas Huberc9410c72016-07-28 12:18:40 -070034 return 0;
35}