Skip to content

Commit c19ab1c

Browse files
dmitriplotnikovcopybara-github
authored andcommitted
[Pratt parser] Initial implementation - private, for now
PiperOrigin-RevId: 974800991
1 parent a2353b3 commit c19ab1c

10 files changed

Lines changed: 5552 additions & 1 deletion

File tree

parser/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ java_library(
1111
exports = ["//parser/src/main/java/dev/cel/parser"],
1212
)
1313

14+
java_library(
15+
name = "pratt_parser",
16+
visibility = ["//:internal"],
17+
exports = ["//parser/src/main/java/dev/cel/parser:pratt_parser"],
18+
)
19+
1420
java_library(
1521
name = "parser_factory",
1622
exports = ["//parser/src/main/java/dev/cel/parser:parser_factory"],

parser/src/main/java/dev/cel/parser/BUILD.bazel

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ PARSER_SOURCES = [
1515
"Parser.java",
1616
]
1717

18+
# keep sorted
19+
PRATT_PARSER_SOURCES = [
20+
"Lexer.java",
21+
"PrattParser.java",
22+
]
23+
1824
# keep sorted
1925
PARSER_BUILDER_SOURCES = [
2026
"CelParser.java",
@@ -75,6 +81,26 @@ java_library(
7581
],
7682
)
7783

84+
java_library(
85+
name = "pratt_parser",
86+
srcs = PRATT_PARSER_SOURCES,
87+
tags = [
88+
],
89+
deps = [
90+
":macro",
91+
"//common:cel_ast",
92+
"//common:cel_source",
93+
"//common:compiler_common",
94+
"//common:operator",
95+
"//common:options",
96+
"//common:source_location",
97+
"//common/ast",
98+
"//common/internal",
99+
"@maven//:com_google_guava_guava",
100+
"@maven//:org_jspecify_jspecify",
101+
],
102+
)
103+
78104
java_library(
79105
name = "parser_builder",
80106
srcs = PARSER_BUILDER_SOURCES,

0 commit comments

Comments
 (0)