Files
carbon-lang/executable_semantics/ast/ast.h
T
Geoff RomerandJon Meow 17e0a1afb9 Implement static name resolution (#958)
This doesn't actually use the results of name resolution, but it does verify that they are present.
Also ensures that name resolution and type checking are applied to deduced function parameters and the implicit call to `Main()`.

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
2021-11-30 13:33:54 -08:00

36 lines
1.1 KiB
C++

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef EXECUTABLE_SEMANTICS_AST_AST_H_
#define EXECUTABLE_SEMANTICS_AST_AST_H_
#include <vector>
#include "executable_semantics/ast/declaration.h"
#include "executable_semantics/ast/library_name.h"
#include "executable_semantics/ast/static_scope.h"
#include "executable_semantics/common/nonnull.h"
namespace Carbon {
// A Carbon file's AST.
struct AST {
// The package directive's library.
LibraryName package;
// The package directive's API or impl state.
bool is_api;
// Import directives.
std::vector<LibraryName> imports;
// The file's ordered declarations.
std::vector<Nonnull<Declaration*>> declarations;
// Names declared at the top level of the file.
StaticScope static_scope;
// Synthesized call to `Main`. Injected after parsing.
std::optional<Nonnull<CallExpression*>> main_call;
};
} // namespace Carbon
#endif // EXECUTABLE_SEMANTICS_AST_AST_H_