Skip to content

Commit 3aee209

Browse files
dmitriplotnikovcopybara-github
authored andcommitted
[Pratt Parser] Add Lexer
PiperOrigin-RevId: 938306415
1 parent eb8a894 commit 3aee209

6 files changed

Lines changed: 1301 additions & 12 deletions

File tree

parser/internal/BUILD

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
load("@rules_cc//cc:cc_library.bzl", "cc_library")
16+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
1617
load("//bazel:antlr.bzl", "antlr_cc_library")
1718

1819
package(default_visibility = ["//visibility:public"])
@@ -29,3 +30,39 @@ antlr_cc_library(
2930
src = "Cel.g4",
3031
package = "cel_parser_internal",
3132
)
33+
34+
cc_library(
35+
name = "lexer",
36+
srcs = ["lexer.cc"],
37+
hdrs = ["lexer.h"],
38+
deps = [
39+
"@com_google_absl//absl/base:core_headers",
40+
"@com_google_absl//absl/base:no_destructor",
41+
"@com_google_absl//absl/base:nullability",
42+
"@com_google_absl//absl/container:flat_hash_map",
43+
"@com_google_absl//absl/functional:function_ref",
44+
"@com_google_absl//absl/log:absl_check",
45+
"@com_google_absl//absl/strings",
46+
"@com_google_absl//absl/strings:string_view",
47+
],
48+
)
49+
50+
cc_test(
51+
name = "lexer_test",
52+
srcs = ["lexer_test.cc"],
53+
deps = [
54+
":lexer",
55+
"//internal:testing",
56+
],
57+
)
58+
59+
cc_test(
60+
name = "lexer_fuzzer",
61+
size = "large",
62+
srcs = ["lexer_fuzzer.cc"],
63+
deps = [
64+
":lexer",
65+
"//internal:testing",
66+
"//testing/fuzzing:fuzztest",
67+
],
68+
)

0 commit comments

Comments
 (0)