Impulse Graph C++ Engine 2.4.0
High-Performance Zero-Copy C-ABI Kernel and C++20 Fluent VM Engine
Loading...
Searching...
No Matches
impulse::cel::AstOptimizer Class Reference

Zero-Dependency AST Optimizer & Constant Folder for CEL ASTs. More...

#include <impulse_cel.h>

Static Public Member Functions

static std::shared_ptr< AstNode > optimize (const std::shared_ptr< AstNode > &node, size_t depth=0)

Static Public Attributes

static constexpr size_t MAX_PARSE_DEPTH = 256

Detailed Description

Zero-Dependency AST Optimizer & Constant Folder for CEL ASTs.

Implements:

  1. Constant folding across arithmetic, logical, comparison, and transcendental math functions.
  2. Algebraic simplification & identity reduction (x + 0, x * 1, x * 0, !(!x), etc.).
  3. Dead branch elimination for ternary expressions with constant conditions.

Member Function Documentation

◆ optimize()

std::shared_ptr< AstNode > impulse::cel::AstOptimizer::optimize ( const std::shared_ptr< AstNode > & node,
size_t depth = 0 )
inlinestatic

Member Data Documentation

◆ MAX_PARSE_DEPTH

size_t impulse::cel::AstOptimizer::MAX_PARSE_DEPTH = 256
staticconstexpr

The documentation for this class was generated from the following file: