exec_program.h 1.1 KB

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. // Helpers should be added here when logic in syntax.ypp is more than a single
  5. // statement. The intent is to minimize the amount of C++ in the .ypp file, to
  6. // improve ease of maintenance.
  7. #ifndef CARBON_EXPLORER_INTERPRETER_EXEC_PROGRAM_H_
  8. #define CARBON_EXPLORER_INTERPRETER_EXEC_PROGRAM_H_
  9. #include "explorer/ast/ast.h"
  10. #include "explorer/base/trace_stream.h"
  11. #include "llvm/Support/raw_ostream.h"
  12. namespace Carbon {
  13. // Perform semantic analysis on the AST.
  14. auto AnalyzeProgram(Nonnull<Arena*> arena, AST ast,
  15. Nonnull<TraceStream*> trace_stream,
  16. Nonnull<llvm::raw_ostream*> print_stream) -> ErrorOr<AST>;
  17. // Run the program's `Main` function.
  18. auto ExecProgram(Nonnull<Arena*> arena, AST ast,
  19. Nonnull<TraceStream*> trace_stream,
  20. Nonnull<llvm::raw_ostream*> print_stream) -> ErrorOr<int>;
  21. } // namespace Carbon
  22. #endif // CARBON_EXPLORER_INTERPRETER_EXEC_PROGRAM_H_