BUILD 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. package(default_visibility = ["//executable_semantics:__subpackages__"])
  5. cc_library(
  6. name = "ast",
  7. hdrs = ["ast.h"],
  8. deps = [
  9. ":declaration",
  10. ":library_name",
  11. ":static_scope",
  12. ],
  13. )
  14. cc_library(
  15. name = "ast_node",
  16. srcs = ["ast_node.cpp"],
  17. hdrs = [
  18. "ast_node.h",
  19. "ast_rtti.h",
  20. ],
  21. deps = [
  22. ":source_location",
  23. ],
  24. )
  25. genrule(
  26. name = "ast_rtti",
  27. srcs = ["ast_rtti.txt"],
  28. outs = ["ast_rtti.h"],
  29. cmd = "./$(location //executable_semantics:gen_rtti)" +
  30. " $(location ast_rtti.txt) > \"$@\"",
  31. tools = ["//executable_semantics:gen_rtti"],
  32. )
  33. cc_library(
  34. name = "ast_test_matchers",
  35. testonly = 1,
  36. srcs = [
  37. "ast_test_matchers_internal.cpp",
  38. "ast_test_matchers_internal.h",
  39. ],
  40. hdrs = ["ast_test_matchers.h"],
  41. deps = [
  42. ":ast",
  43. ":ast_node",
  44. ":declaration",
  45. ":expression",
  46. ":statement",
  47. "@com_google_googletest//:gtest",
  48. "@llvm-project//llvm:Support",
  49. ],
  50. )
  51. cc_test(
  52. name = "ast_test_matchers_test",
  53. srcs = ["ast_test_matchers_test.cpp"],
  54. deps = [
  55. ":ast_test_matchers",
  56. ":declaration",
  57. ":expression",
  58. ":pattern",
  59. ":statement",
  60. "//executable_semantics/common:arena",
  61. "@com_google_googletest//:gtest_main",
  62. ],
  63. )
  64. cc_library(
  65. name = "declaration",
  66. srcs = ["declaration.cpp"],
  67. hdrs = [
  68. "declaration.h",
  69. ],
  70. deps = [
  71. ":ast_node",
  72. ":member",
  73. ":pattern",
  74. ":source_location",
  75. ":statement",
  76. ":static_scope",
  77. "//common:ostream",
  78. "//executable_semantics/common:nonnull",
  79. "@llvm-project//llvm:Support",
  80. ],
  81. )
  82. cc_library(
  83. name = "expression",
  84. srcs = ["expression.cpp"],
  85. hdrs = ["expression.h"],
  86. deps = [
  87. ":ast_node",
  88. ":paren_contents",
  89. "//common:indirect_value",
  90. "//common:ostream",
  91. "//executable_semantics/common:arena",
  92. "//executable_semantics/common:error",
  93. "@llvm-project//llvm:Support",
  94. ],
  95. )
  96. cc_test(
  97. name = "expression_test",
  98. srcs = ["expression_test.cpp"],
  99. deps = [
  100. ":expression",
  101. ":paren_contents",
  102. "@com_google_googletest//:gtest_main",
  103. ],
  104. )
  105. cc_library(
  106. name = "member",
  107. srcs = ["member.cpp"],
  108. hdrs = ["member.h"],
  109. deps = [
  110. ":pattern",
  111. ":source_location",
  112. "//common:ostream",
  113. ],
  114. )
  115. cc_library(
  116. name = "library_name",
  117. hdrs = ["library_name.h"],
  118. )
  119. cc_library(
  120. name = "paren_contents",
  121. hdrs = ["paren_contents.h"],
  122. deps = [
  123. ":source_location",
  124. "//executable_semantics/common:error",
  125. ],
  126. )
  127. cc_library(
  128. name = "pattern",
  129. srcs = ["pattern.cpp"],
  130. hdrs = ["pattern.h"],
  131. deps = [
  132. ":ast_node",
  133. ":expression",
  134. ":source_location",
  135. ":static_scope",
  136. "//common:ostream",
  137. "//executable_semantics/common:arena",
  138. "//executable_semantics/common:error",
  139. "@llvm-project//llvm:Support",
  140. ],
  141. )
  142. cc_test(
  143. name = "pattern_test",
  144. srcs = ["pattern_test.cpp"],
  145. deps = [
  146. ":paren_contents",
  147. ":pattern",
  148. "@com_google_googletest//:gtest_main",
  149. "@llvm-project//llvm:Support",
  150. ],
  151. )
  152. cc_library(
  153. name = "static_scope",
  154. srcs = ["static_scope.cpp"],
  155. hdrs = ["static_scope.h"],
  156. deps = [
  157. ":ast_node",
  158. ":source_location",
  159. "//executable_semantics/common:arena",
  160. "//executable_semantics/common:error",
  161. ],
  162. )
  163. cc_library(
  164. name = "source_location",
  165. hdrs = ["source_location.h"],
  166. deps = [
  167. "//common:ostream",
  168. "//executable_semantics/common:nonnull",
  169. ],
  170. )
  171. cc_library(
  172. name = "statement",
  173. srcs = ["statement.cpp"],
  174. hdrs = ["statement.h"],
  175. deps = [
  176. ":ast_node",
  177. ":expression",
  178. ":pattern",
  179. ":source_location",
  180. "//common:check",
  181. "//common:ostream",
  182. "//executable_semantics/common:arena",
  183. "@llvm-project//llvm:Support",
  184. ],
  185. )