blob: 935fc56e3cb70694c1aa0815fc00aafe6589613a [file] [log] [blame]
Christopher Wiley038485e2015-09-12 11:14:14 -07001/*
2 * Copyright (C) 2015, The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef AIDL_AST_JAVA_H_
18#define AIDL_AST_JAVA_H_
Adam Lesinskiffa16862014-01-23 18:17:42 -080019
Christopher Wileyf76b59a2016-01-29 11:32:11 -080020#include <memory>
Adam Lesinskiffa16862014-01-23 18:17:42 -080021#include <stdarg.h>
22#include <stdio.h>
Christopher Wileyae589972016-01-29 11:19:23 -080023#include <string>
24#include <vector>
Adam Lesinskiffa16862014-01-23 18:17:42 -080025
Adam Lesinskiffa16862014-01-23 18:17:42 -080026enum {
Christopher Wileyae589972016-01-29 11:19:23 -080027 PACKAGE_PRIVATE = 0x00000000,
28 PUBLIC = 0x00000001,
29 PRIVATE = 0x00000002,
30 PROTECTED = 0x00000003,
31 SCOPE_MASK = 0x00000003,
Adam Lesinskiffa16862014-01-23 18:17:42 -080032
Christopher Wileyae589972016-01-29 11:19:23 -080033 STATIC = 0x00000010,
34 FINAL = 0x00000020,
35 ABSTRACT = 0x00000040,
Adam Lesinskiffa16862014-01-23 18:17:42 -080036
Christopher Wileyae589972016-01-29 11:19:23 -080037 OVERRIDE = 0x00000100,
Adam Lesinskiffa16862014-01-23 18:17:42 -080038
Christopher Wileyae589972016-01-29 11:19:23 -080039 ALL_MODIFIERS = 0xffffffff
Adam Lesinskiffa16862014-01-23 18:17:42 -080040};
41
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070042namespace android {
43namespace aidl {
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070044class CodeWriter;
Christopher Wileydb154a52015-09-28 16:32:25 -070045} // namespace aidl
46} // namespace android
47
48namespace android {
49namespace aidl {
50namespace java {
51
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070052class Type;
53
Adam Lesinskiffa16862014-01-23 18:17:42 -080054// Write the modifiers that are set in both mod and mask
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070055void WriteModifiers(CodeWriter* to, int mod, int mask);
Adam Lesinskiffa16862014-01-23 18:17:42 -080056
Jiyong Park176905e2018-07-04 22:29:41 +090057struct AstNode {
58 AstNode() = default;
59 virtual ~AstNode() = default;
Christopher Wileyae589972016-01-29 11:19:23 -080060 virtual void Write(CodeWriter* to) const = 0;
Jiyong Park176905e2018-07-04 22:29:41 +090061 std::string ToString();
Adam Lesinskiffa16862014-01-23 18:17:42 -080062};
63
Jiyong Park176905e2018-07-04 22:29:41 +090064struct ClassElement : public AstNode {
65 ClassElement() = default;
66 virtual ~ClassElement() = default;
67};
68
69struct Expression : public AstNode {
Christopher Wileyae589972016-01-29 11:19:23 -080070 virtual ~Expression() = default;
Adam Lesinskiffa16862014-01-23 18:17:42 -080071};
72
Christopher Wileyae589972016-01-29 11:19:23 -080073struct LiteralExpression : public Expression {
Christopher Wiley12e894a2016-01-29 11:55:07 -080074 std::string value;
Adam Lesinskiffa16862014-01-23 18:17:42 -080075
Chih-Hung Hsieh156a57f2016-06-02 16:17:28 -070076 explicit LiteralExpression(const std::string& value);
Christopher Wileyae589972016-01-29 11:19:23 -080077 virtual ~LiteralExpression() = default;
78 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -080079};
80
81// TODO: also escape the contents. not needed for now
Christopher Wileyae589972016-01-29 11:19:23 -080082struct StringLiteralExpression : public Expression {
Christopher Wiley12e894a2016-01-29 11:55:07 -080083 std::string value;
Adam Lesinskiffa16862014-01-23 18:17:42 -080084
Chih-Hung Hsieh156a57f2016-06-02 16:17:28 -070085 explicit StringLiteralExpression(const std::string& value);
Christopher Wileyae589972016-01-29 11:19:23 -080086 virtual ~StringLiteralExpression() = default;
87 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -080088};
89
Christopher Wileyae589972016-01-29 11:19:23 -080090struct Variable : public Expression {
91 const Type* type = nullptr;
Christopher Wiley12e894a2016-01-29 11:55:07 -080092 std::string name;
Christopher Wileyae589972016-01-29 11:19:23 -080093 int dimension = 0;
Adam Lesinskiffa16862014-01-23 18:17:42 -080094
Christopher Wileyae589972016-01-29 11:19:23 -080095 Variable() = default;
Christopher Wiley12e894a2016-01-29 11:55:07 -080096 Variable(const Type* type, const std::string& name);
97 Variable(const Type* type, const std::string& name, int dimension);
Christopher Wileyae589972016-01-29 11:19:23 -080098 virtual ~Variable() = default;
Adam Lesinskiffa16862014-01-23 18:17:42 -080099
Christopher Wileyae589972016-01-29 11:19:23 -0800100 void WriteDeclaration(CodeWriter* to) const;
101 void Write(CodeWriter* to) const;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800102};
103
Christopher Wileyae589972016-01-29 11:19:23 -0800104struct FieldVariable : public Expression {
105 Expression* object;
106 const Type* clazz;
Christopher Wiley12e894a2016-01-29 11:55:07 -0800107 std::string name;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800108
Christopher Wiley12e894a2016-01-29 11:55:07 -0800109 FieldVariable(Expression* object, const std::string& name);
110 FieldVariable(const Type* clazz, const std::string& name);
Christopher Wileyae589972016-01-29 11:19:23 -0800111 virtual ~FieldVariable() = default;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800112
Christopher Wileyae589972016-01-29 11:19:23 -0800113 void Write(CodeWriter* to) const;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800114};
115
Christopher Wileyae589972016-01-29 11:19:23 -0800116struct Field : public ClassElement {
Christopher Wiley12e894a2016-01-29 11:55:07 -0800117 std::string comment;
Christopher Wileyae589972016-01-29 11:19:23 -0800118 int modifiers = 0;
119 Variable* variable = nullptr;
Christopher Wiley12e894a2016-01-29 11:55:07 -0800120 std::string value;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800121
Christopher Wileyae589972016-01-29 11:19:23 -0800122 Field() = default;
123 Field(int modifiers, Variable* variable);
124 virtual ~Field() = default;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800125
Christopher Wileyae589972016-01-29 11:19:23 -0800126 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800127};
128
Jiyong Park176905e2018-07-04 22:29:41 +0900129struct Statement : public AstNode {
Christopher Wileyae589972016-01-29 11:19:23 -0800130 virtual ~Statement() = default;
Jiyong Park176905e2018-07-04 22:29:41 +0900131};
132
133struct LiteralStatement : public Statement {
134 public:
135 LiteralStatement(const std::string& value);
136 virtual ~LiteralStatement() = default;
137 void Write(CodeWriter* to) const override;
138
139 private:
140 const std::string value_;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800141};
142
Christopher Wileyae589972016-01-29 11:19:23 -0800143struct StatementBlock : public Statement {
Christopher Wiley12e894a2016-01-29 11:55:07 -0800144 std::vector<Statement*> statements;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800145
Christopher Wileyae589972016-01-29 11:19:23 -0800146 StatementBlock() = default;
147 virtual ~StatementBlock() = default;
148 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800149
Christopher Wileyae589972016-01-29 11:19:23 -0800150 void Add(Statement* statement);
151 void Add(Expression* expression);
Adam Lesinskiffa16862014-01-23 18:17:42 -0800152};
153
Christopher Wileyae589972016-01-29 11:19:23 -0800154struct ExpressionStatement : public Statement {
155 Expression* expression;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800156
Chih-Hung Hsieh156a57f2016-06-02 16:17:28 -0700157 explicit ExpressionStatement(Expression* expression);
Christopher Wileyae589972016-01-29 11:19:23 -0800158 virtual ~ExpressionStatement() = default;
159 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800160};
161
Christopher Wileyae589972016-01-29 11:19:23 -0800162struct Assignment : public Expression {
163 Variable* lvalue;
164 Expression* rvalue;
165 const Type* cast;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800166
Christopher Wileyae589972016-01-29 11:19:23 -0800167 Assignment(Variable* lvalue, Expression* rvalue);
168 Assignment(Variable* lvalue, Expression* rvalue, const Type* cast);
169 virtual ~Assignment() = default;
170 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800171};
172
Christopher Wileyae589972016-01-29 11:19:23 -0800173struct MethodCall : public Expression {
174 Expression* obj = nullptr;
175 const Type* clazz = nullptr;
Christopher Wiley12e894a2016-01-29 11:55:07 -0800176 std::string name;
177 std::vector<Expression*> arguments;
178 std::vector<std::string> exceptions;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800179
Chih-Hung Hsieh156a57f2016-06-02 16:17:28 -0700180 explicit MethodCall(const std::string& name);
Christopher Wiley12e894a2016-01-29 11:55:07 -0800181 MethodCall(const std::string& name, int argc, ...);
182 MethodCall(Expression* obj, const std::string& name);
183 MethodCall(const Type* clazz, const std::string& name);
184 MethodCall(Expression* obj, const std::string& name, int argc, ...);
185 MethodCall(const Type* clazz, const std::string& name, int argc, ...);
Christopher Wileyae589972016-01-29 11:19:23 -0800186 virtual ~MethodCall() = default;
187 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800188
Christopher Wileyae589972016-01-29 11:19:23 -0800189 private:
190 void init(int n, va_list args);
Adam Lesinskiffa16862014-01-23 18:17:42 -0800191};
192
Christopher Wileyae589972016-01-29 11:19:23 -0800193struct Comparison : public Expression {
194 Expression* lvalue;
Christopher Wiley12e894a2016-01-29 11:55:07 -0800195 std::string op;
Christopher Wileyae589972016-01-29 11:19:23 -0800196 Expression* rvalue;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800197
Christopher Wiley12e894a2016-01-29 11:55:07 -0800198 Comparison(Expression* lvalue, const std::string& op, Expression* rvalue);
Christopher Wileyae589972016-01-29 11:19:23 -0800199 virtual ~Comparison() = default;
200 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800201};
202
Christopher Wileyae589972016-01-29 11:19:23 -0800203struct NewExpression : public Expression {
204 const Type* type;
Christopher Wiley12e894a2016-01-29 11:55:07 -0800205 std::vector<Expression*> arguments;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800206
Chih-Hung Hsieh156a57f2016-06-02 16:17:28 -0700207 explicit NewExpression(const Type* type);
Christopher Wileyae589972016-01-29 11:19:23 -0800208 NewExpression(const Type* type, int argc, ...);
209 virtual ~NewExpression() = default;
210 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800211
Christopher Wileyae589972016-01-29 11:19:23 -0800212 private:
213 void init(int n, va_list args);
Adam Lesinskiffa16862014-01-23 18:17:42 -0800214};
215
Christopher Wileyae589972016-01-29 11:19:23 -0800216struct NewArrayExpression : public Expression {
217 const Type* type;
218 Expression* size;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800219
Christopher Wileyae589972016-01-29 11:19:23 -0800220 NewArrayExpression(const Type* type, Expression* size);
221 virtual ~NewArrayExpression() = default;
222 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800223};
224
Christopher Wileyae589972016-01-29 11:19:23 -0800225struct Ternary : public Expression {
226 Expression* condition = nullptr;
227 Expression* ifpart = nullptr;
228 Expression* elsepart = nullptr;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800229
Christopher Wileyae589972016-01-29 11:19:23 -0800230 Ternary() = default;
231 Ternary(Expression* condition, Expression* ifpart, Expression* elsepart);
232 virtual ~Ternary() = default;
233 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800234};
235
Christopher Wileyae589972016-01-29 11:19:23 -0800236struct Cast : public Expression {
237 const Type* type = nullptr;
238 Expression* expression = nullptr;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800239
Christopher Wileyae589972016-01-29 11:19:23 -0800240 Cast() = default;
241 Cast(const Type* type, Expression* expression);
242 virtual ~Cast() = default;
243 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800244};
245
Christopher Wileyae589972016-01-29 11:19:23 -0800246struct VariableDeclaration : public Statement {
247 Variable* lvalue = nullptr;
248 const Type* cast = nullptr;
249 Expression* rvalue = nullptr;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800250
Chih-Hung Hsieh156a57f2016-06-02 16:17:28 -0700251 explicit VariableDeclaration(Variable* lvalue);
Christopher Wileyae589972016-01-29 11:19:23 -0800252 VariableDeclaration(Variable* lvalue, Expression* rvalue,
Yi Kong894d6ba2018-07-24 11:27:38 -0700253 const Type* cast = nullptr);
Christopher Wileyae589972016-01-29 11:19:23 -0800254 virtual ~VariableDeclaration() = default;
255 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800256};
257
Christopher Wileyae589972016-01-29 11:19:23 -0800258struct IfStatement : public Statement {
259 Expression* expression = nullptr;
260 StatementBlock* statements = new StatementBlock;
261 IfStatement* elseif = nullptr;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800262
Christopher Wileyae589972016-01-29 11:19:23 -0800263 IfStatement() = default;
264 virtual ~IfStatement() = default;
265 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800266};
267
Christopher Wileyae589972016-01-29 11:19:23 -0800268struct ReturnStatement : public Statement {
269 Expression* expression;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800270
Chih-Hung Hsieh156a57f2016-06-02 16:17:28 -0700271 explicit ReturnStatement(Expression* expression);
Christopher Wileyae589972016-01-29 11:19:23 -0800272 virtual ~ReturnStatement() = default;
273 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800274};
275
Christopher Wileyae589972016-01-29 11:19:23 -0800276struct TryStatement : public Statement {
277 StatementBlock* statements = new StatementBlock;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800278
Christopher Wileyae589972016-01-29 11:19:23 -0800279 TryStatement() = default;
280 virtual ~TryStatement() = default;
281 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800282};
283
Christopher Wileyae589972016-01-29 11:19:23 -0800284struct CatchStatement : public Statement {
285 StatementBlock* statements;
286 Variable* exception;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800287
Chih-Hung Hsieh156a57f2016-06-02 16:17:28 -0700288 explicit CatchStatement(Variable* exception);
Christopher Wileyae589972016-01-29 11:19:23 -0800289 virtual ~CatchStatement() = default;
290 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800291};
292
Christopher Wileyae589972016-01-29 11:19:23 -0800293struct FinallyStatement : public Statement {
294 StatementBlock* statements = new StatementBlock;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800295
Christopher Wileyae589972016-01-29 11:19:23 -0800296 FinallyStatement() = default;
297 virtual ~FinallyStatement() = default;
298 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800299};
300
Jiyong Park176905e2018-07-04 22:29:41 +0900301struct Case : public AstNode {
Christopher Wiley12e894a2016-01-29 11:55:07 -0800302 std::vector<std::string> cases;
Christopher Wileyae589972016-01-29 11:19:23 -0800303 StatementBlock* statements = new StatementBlock;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800304
Christopher Wileyae589972016-01-29 11:19:23 -0800305 Case() = default;
Chih-Hung Hsieh156a57f2016-06-02 16:17:28 -0700306 explicit Case(const std::string& c);
Christopher Wileyae589972016-01-29 11:19:23 -0800307 virtual ~Case() = default;
Jiyong Park176905e2018-07-04 22:29:41 +0900308 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800309};
310
Christopher Wileyae589972016-01-29 11:19:23 -0800311struct SwitchStatement : public Statement {
312 Expression* expression;
Christopher Wiley12e894a2016-01-29 11:55:07 -0800313 std::vector<Case*> cases;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800314
Chih-Hung Hsieh156a57f2016-06-02 16:17:28 -0700315 explicit SwitchStatement(Expression* expression);
Christopher Wileyae589972016-01-29 11:19:23 -0800316 virtual ~SwitchStatement() = default;
317 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800318};
319
Christopher Wileyae589972016-01-29 11:19:23 -0800320struct Break : public Statement {
321 Break() = default;
322 virtual ~Break() = default;
323 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800324};
325
Christopher Wileyae589972016-01-29 11:19:23 -0800326struct Method : public ClassElement {
Christopher Wiley12e894a2016-01-29 11:55:07 -0800327 std::string comment;
Christopher Wileyae589972016-01-29 11:19:23 -0800328 int modifiers = 0;
329 const Type* returnType = nullptr; // nullptr means constructor
330 size_t returnTypeDimension = 0;
Christopher Wiley12e894a2016-01-29 11:55:07 -0800331 std::string name;
332 std::vector<Variable*> parameters;
333 std::vector<const Type*> exceptions;
Christopher Wileyae589972016-01-29 11:19:23 -0800334 StatementBlock* statements = nullptr;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800335
Christopher Wileyae589972016-01-29 11:19:23 -0800336 Method() = default;
337 virtual ~Method() = default;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800338
Christopher Wileyae589972016-01-29 11:19:23 -0800339 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800340};
341
Steven Moreland5557f1c2018-07-02 13:50:23 -0700342struct LiteralClassElement : public ClassElement {
343 std::string element;
344
345 LiteralClassElement(std::string e) : element(e) {}
346 virtual ~LiteralClassElement() = default;
347
348 void Write(CodeWriter* to) const override;
349};
350
Christopher Wiley69b44cf2016-05-03 13:43:33 -0700351struct IntConstant : public ClassElement {
352 const std::string name;
Steven Moreland693640b2018-07-19 13:46:27 -0700353 const std::string value;
Casey Dahlind40e2fe2015-11-24 14:06:52 -0800354
Steven Moreland693640b2018-07-19 13:46:27 -0700355 IntConstant(const std::string& name, const std::string& value) : name(name), value(value) {}
Christopher Wiley69b44cf2016-05-03 13:43:33 -0700356 virtual ~IntConstant() = default;
357
358 void Write(CodeWriter* to) const override;
359};
360
361struct StringConstant : public ClassElement {
362 const std::string name;
363 const std::string value;
364
365 StringConstant(std::string name, std::string value)
366 : name(name), value(value) {}
367 ~StringConstant() override = default;
Casey Dahlind40e2fe2015-11-24 14:06:52 -0800368
Christopher Wileyae589972016-01-29 11:19:23 -0800369 void Write(CodeWriter* to) const override;
Casey Dahlind40e2fe2015-11-24 14:06:52 -0800370};
371
Christopher Wileyae589972016-01-29 11:19:23 -0800372struct Class : public ClassElement {
373 enum { CLASS, INTERFACE };
Adam Lesinskiffa16862014-01-23 18:17:42 -0800374
Christopher Wiley12e894a2016-01-29 11:55:07 -0800375 std::string comment;
Christopher Wileyae589972016-01-29 11:19:23 -0800376 int modifiers = 0;
377 int what = CLASS; // CLASS or INTERFACE
378 const Type* type = nullptr;
379 const Type* extends = nullptr;
Christopher Wiley12e894a2016-01-29 11:55:07 -0800380 std::vector<const Type*> interfaces;
381 std::vector<ClassElement*> elements;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800382
Christopher Wileyae589972016-01-29 11:19:23 -0800383 Class() = default;
384 virtual ~Class() = default;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800385
Christopher Wileyae589972016-01-29 11:19:23 -0800386 void Write(CodeWriter* to) const override;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800387};
388
Jiyong Park176905e2018-07-04 22:29:41 +0900389class Document : public AstNode {
Christopher Wileyf76b59a2016-01-29 11:32:11 -0800390 public:
391 Document(const std::string& comment,
392 const std::string& package,
393 const std::string& original_src,
394 std::unique_ptr<Class> clazz);
Christopher Wileyae589972016-01-29 11:19:23 -0800395 virtual ~Document() = default;
Jiyong Park176905e2018-07-04 22:29:41 +0900396 void Write(CodeWriter* to) const override;
Christopher Wileyf76b59a2016-01-29 11:32:11 -0800397
398 private:
399 std::string comment_;
400 std::string package_;
401 std::string original_src_;
402 std::unique_ptr<Class> clazz_;
Adam Lesinskiffa16862014-01-23 18:17:42 -0800403};
404
Christopher Wileydb154a52015-09-28 16:32:25 -0700405} // namespace java
Christopher Wileyfdeb0f42015-09-11 15:38:22 -0700406} // namespace aidl
407} // namespace android
408
Christopher Wileyae589972016-01-29 11:19:23 -0800409#endif // AIDL_AST_JAVA_H_