parser 1.0.0
UTF-8 CEL expression compilation and checked library extensions
Loading...
Searching...
No Matches
compiler.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2#ifndef CEL_PARSER_COMPILER_HPP
3#define CEL_PARSER_COMPILER_HPP
5
9
10namespace cel {
13
14namespace parser_detail {
15struct parser_access;
16} // namespace parser_detail
37class parser {
38 friend struct parser_detail::parser_access;
39 op_lookup lookup_;
40 bool active_ = false;
41
42public:
45 explicit parser(op_lookup lookup) : lookup_(std::move(lookup)) {}
47 parser(const parser&) = delete;
49 parser& operator=(const parser&) = delete;
66 compiled_segment parse_str(std::string_view source);
67};
68// [knowledge] Preserve current-token LL(1) compilation: no cursor cloning, speculation,
69// checkpoints, or multi-token lookahead. Character composition belongs to the lexer.
70
72} // namespace cel
73#endif
Owns exact registrations, nominal schemas, and LIFO scope callbacks. Owns copied names,...
Definition lookup.hpp:81
parser & operator=(const parser &)=delete
Prevents replacing lookup state through copied assignment.
compiled_segment parse_str(std::string_view source)
Compiles one complete decoded UTF-8 CEL source through an owned source copy. Selects grammar alternat...
parser(op_lookup lookup)
Transfers the lookup's names, schemas, registrations, and scopes into this compiler....
Definition compiler.hpp:45
parser(const parser &)=delete
Prevents copying mutable lookup and compilation ownership.
Provides owned type and operation registrations for extension libraries. Include <cel/parser/compiler...
Provides checked CEL compilation, extension libraries, and owned results.
Definition compiler.hpp:10