1f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland/* 2f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * Copyright (C) 2016 The Android Open Source Project 3f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * 4f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * Licensed under the Apache License, Version 2.0 (the "License"); 5f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * you may not use this file except in compliance with the License. 6f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * You may obtain a copy of the License at 7f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * 8f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * http://www.apache.org/licenses/LICENSE-2.0 9f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * 10f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * Unless required by applicable law or agreed to in writing, software 11f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * distributed under the License is distributed on an "AS IS" BASIS, 12f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * See the License for the specific language governing permissions and 14f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * limitations under the License. 15f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland */ 16f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland 17f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#ifndef TYPE_DEF_H_ 18f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#define TYPE_DEF_H_ 19f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland 20f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#include <android-base/macros.h> 21f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#include <android-base/logging.h> 22f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#include <string> 23f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#include <vector> 24f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#include "Declaration.h" 25f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland 26f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Morelandnamespace android { 27f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland 28f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Morelandstruct TypeDef : Declaration { 29f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland TypeDef(const std::string &name, Declaration* declaration); 30f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland ~TypeDef(); 31f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland 32f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland static std::string type() { return "typedef"; } 33f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland const std::string decType() const override { return type(); } 34f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland 35f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland void generateSource(Formatter &out) const override; 36f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland void processContents(AST &ast) override; 37f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland 38f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Morelandprivate: 39f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland Declaration* mDeclaration; 40f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland 41f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland DISALLOW_COPY_AND_ASSIGN(TypeDef); 42f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland}; 43f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland 44f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland} // namespace android 45f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland 46f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#endif // TYPE_DEF_H_