parser 1.0.0
UTF-8 CEL expression compilation and checked library extensions
Loading...
Searching...
No Matches
cel Namespace Reference

Provides checked CEL compilation, extension libraries, and owned results. More...

Classes

class  op_lookup
 Owns exact registrations, nominal schemas, and LIFO scope callbacks. Owns copied names, retained descriptors, and stored callbacks, not references inside captures. register_op retains its runtime callback in emitted code after this lookup dies. Custom scope callbacks and operation emitters must retain state in the code they emit. Client-captured references must outlive every execution that uses them. Mutable callbacks are not made thread-safe by registry ownership. Registration matches complete compatible input descriptors, including nominal identity and ownership representation; equal layouts or display names do not establish a match. Copies are unavailable; moves transfer registry ownership. Register a receiver operation before transferring the lookup into a parser: More...
class  parse_error
 Owns a source-located diagnostic; copied diagnostics own independent messages. Example: parse_error(error_category::malformed_input, {0, 1}, "invalid input"). More...
class  parser
 Owns lookup state and compiles CEL expressions into reusable checked programs. Each successful call returns a program owning its values, descriptors, and emitted runtime callbacks; the source and parser need not survive the program. References inside client captures remain client-owned and must outlive their uses. Custom scope callbacks and emitters follow their own code-retention contracts. Precondition: clients provide exclusive access across threads, including during emitters. Recursive entry throws std::logic_error before changing cursor or lookup state. Failed parsing retires temporary scopes; subsequent parses may reuse the parser. A selected client emitter's own failure leaves its lookup state subject to its contract. Compilation invokes lookup scopes and emitters, not the emitted runtime operations. Copying and moving are unavailable. Compile and execute a program independently of its parser: More...
struct  source_span
 Identifies a half-open UTF-8 byte interval; begin never exceeds end. Example: source_span{0, 4} covers all bytes of "true". More...

Typedefs

using scope_callback
 Owns a copyable resolver called with a borrowed name, builder, operand count, and source span. The name and builder are borrowed only for the call. Operands are older-first. Returning false must leave instructions and operands unchanged. Returning true must emit the resolved value or operation, consuming arity operands and adding one result. Exceptions propagate; after an emission failure, the builder need only be safely discardable. Captured references must outlive uses of the callback and any emitted code retaining them. Clients synchronize shared mutable captures. Example: [](std::string_view, dyn_segment&, std::size_t, source_span) { return false; }.
using operation_emitter
 Owns a checked emitter whose successful effect consumes its declared inputs and adds one result. The builder is borrowed only for the call; span locates the source operation. Emitted code must retain the values, descriptors, and captures it needs for execution. Callback exceptions propagate; an error need only leave the builder safely discardable. Example: [](dyn_segment& b, source_span) { b.project_tuple(0); }.

Enumerations

enum class  error_category {
  error_category::malformed_input , error_category::unsupported_literal , error_category::type_error , error_category::lookup_error ,
  error_category::delimiter_error , error_category::resource_limit
}
 Classifies a source diagnostic independently of its human-readable message. Example: error_category::unsupported_literal identifies an f32 suffix. More...

Detailed Description

Provides checked CEL compilation, extension libraries, and owned results.