diff --git a/executable_semantics/BUILD b/executable_semantics/BUILD index 3defe88a7014..5a17f7d0e203 100644 --- a/executable_semantics/BUILD +++ b/executable_semantics/BUILD @@ -10,6 +10,7 @@ cc_binary( srcs = ["main.cpp"], deps = [ "//executable_semantics/common:tracing_flag", + "//executable_semantics/interpreter:exec_program", "//executable_semantics/syntax", "@llvm-project//llvm:Support", ], diff --git a/executable_semantics/interpreter/BUILD b/executable_semantics/interpreter/BUILD index 5751deff8f2a..03dcb009f90a 100644 --- a/executable_semantics/interpreter/BUILD +++ b/executable_semantics/interpreter/BUILD @@ -2,7 +2,7 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -package(default_visibility = ["//executable_semantics:__subpackages__"]) +package(default_visibility = ["//executable_semantics:__pkg__"]) cc_library( name = "action", @@ -36,6 +36,16 @@ cc_library( deps = ["//executable_semantics/common:arena"], ) +cc_library( + name = "exec_program", + srcs = ["exec_program.cpp"], + hdrs = ["exec_program.h"], + deps = [ + ":interpreter", + ":type_checker", + ], +) + cc_library( name = "field_path", hdrs = ["field_path.h"], diff --git a/executable_semantics/syntax/syntax_helpers.cpp b/executable_semantics/interpreter/exec_program.cpp similarity index 97% rename from executable_semantics/syntax/syntax_helpers.cpp rename to executable_semantics/interpreter/exec_program.cpp index 3af44da23214..d2d560ea95b7 100644 --- a/executable_semantics/syntax/syntax_helpers.cpp +++ b/executable_semantics/interpreter/exec_program.cpp @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/syntax/syntax_helpers.h" +#include "executable_semantics/interpreter/exec_program.h" #include "common/check.h" #include "common/ostream.h" diff --git a/executable_semantics/syntax/syntax_helpers.h b/executable_semantics/interpreter/exec_program.h similarity index 78% rename from executable_semantics/syntax/syntax_helpers.h rename to executable_semantics/interpreter/exec_program.h index 58ca916c5e01..be819b835e7f 100644 --- a/executable_semantics/syntax/syntax_helpers.h +++ b/executable_semantics/interpreter/exec_program.h @@ -6,8 +6,8 @@ // statement. The intent is to minimize the amount of C++ in the .ypp file, to // improve ease of maintenance. -#ifndef EXECUTABLE_SEMANTICS_EXEC_H_ -#define EXECUTABLE_SEMANTICS_EXEC_H_ +#ifndef EXECUTABLE_SEMANTICS_INTERPRETER_EXEC_PROGRAM_H_ +#define EXECUTABLE_SEMANTICS_INTERPRETER_EXEC_PROGRAM_H_ #include @@ -21,4 +21,4 @@ void ExecProgram(std::list> fs); } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_EXEC_H_ +#endif // EXECUTABLE_SEMANTICS_INTERPRETER_EXEC_PROGRAM_H_ diff --git a/executable_semantics/main.cpp b/executable_semantics/main.cpp index 05ed40557735..aca0744f3a84 100644 --- a/executable_semantics/main.cpp +++ b/executable_semantics/main.cpp @@ -7,8 +7,8 @@ #include #include "executable_semantics/common/tracing_flag.h" +#include "executable_semantics/interpreter/exec_program.h" #include "executable_semantics/syntax/parse.h" -#include "executable_semantics/syntax/syntax_helpers.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/InitLLVM.h" diff --git a/executable_semantics/syntax/BUILD b/executable_semantics/syntax/BUILD index 485624bcf8c8..ba243ecd156b 100644 --- a/executable_semantics/syntax/BUILD +++ b/executable_semantics/syntax/BUILD @@ -2,10 +2,10 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -package(default_visibility = ["//executable_semantics:__pkg__"]) - load("@mypy_integration//:mypy.bzl", "mypy_test") +package(default_visibility = ["//executable_semantics:__pkg__"]) + cc_library( name = "bison_wrap", hdrs = ["bison_wrap.h"], @@ -22,8 +22,6 @@ cc_library( "parse_and_lex_context.h", "parser.cpp", "parser.h", - "syntax_helpers.cpp", - "syntax_helpers.h", ], hdrs = [ "parse.h", @@ -45,8 +43,6 @@ cc_library( "//executable_semantics/common:arena", "//executable_semantics/common:error", "//executable_semantics/common:tracing_flag", - "//executable_semantics/interpreter", - "//executable_semantics/interpreter:type_checker", ], ) diff --git a/executable_semantics/syntax/parser.ypp b/executable_semantics/syntax/parser.ypp index 141203ac1b3e..51de0c267b5b 100644 --- a/executable_semantics/syntax/parser.ypp +++ b/executable_semantics/syntax/parser.ypp @@ -59,7 +59,6 @@ #include "common/check.h" #include "executable_semantics/syntax/parse_and_lex_context.h" - #include "executable_semantics/syntax/syntax_helpers.h" #include "llvm/ADT/StringExtras.h" } // %code top