syntax_helpers.h 854 B

1234567891011121314151617181920212223242526272829
  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 EXECUTABLE_SEMANTICS_EXEC_H_
  8. #define EXECUTABLE_SEMANTICS_EXEC_H_
  9. #include <list>
  10. #include "executable_semantics/ast/declaration.h"
  11. namespace Carbon {
  12. // Initialized by main(), and used when printing errors.
  13. extern char* input_filename;
  14. // Prints errors.
  15. void PrintSyntaxError(char* error, int line_num);
  16. // Runs the top-level declaration list.
  17. void ExecProgram(std::list<Declaration>* fs);
  18. } // namespace Carbon
  19. #endif // EXECUTABLE_SEMANTICS_EXEC_H_