ast.h 845 B

123456789101112131415161718192021222324252627282930
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #ifndef EXECUTABLE_SEMANTICS_AST_AST_H_
  5. #define EXECUTABLE_SEMANTICS_AST_AST_H_
  6. #include <vector>
  7. #include "executable_semantics/ast/declaration.h"
  8. #include "executable_semantics/ast/library_name.h"
  9. #include "executable_semantics/common/nonnull.h"
  10. namespace Carbon {
  11. // A Carbon file's AST.
  12. struct AST {
  13. // The package directive's library.
  14. LibraryName package;
  15. // The package directive's API or impl state.
  16. bool is_api;
  17. // Import directives.
  18. std::vector<LibraryName> imports;
  19. // The file's ordered declarations.
  20. std::vector<Nonnull<Declaration*>> declarations;
  21. };
  22. } // namespace Carbon
  23. #endif // EXECUTABLE_SEMANTICS_AST_AST_H_