parser 1.0.0
UTF-8 CEL expression compilation and checked library extensions
Loading...
Searching...
No Matches
Extension libraries

Detailed Description

Register exact operation signatures, opaque types, nominal record schemas, ordinary function names, and persistent scopes before creating a compiler. See Add an extension library for the registration APIs.

Classes

class  cel::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...

Typedefs

using cel::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 cel::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); }.