feat: introduce session type #23
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the
Sessionstruct, establishing it as the primary entry point for all EventQL (EQL) parsing and static analysis operations. TheSessiontype centralizes the necessary context and configuration, significantly streamlining the EQL processing pipeline.Key features and benefits of this new
Sessiontype include:Sessionnow encapsulates both theExprArena(for efficient Abstract Syntax Tree allocation) andAnalysisOptions. This provides a single, coherent object to manage all mutable and immutable state required throughout the parsing and analysis lifecycle.SessionBuilderis introduced, allowing users to easily configure theAnalysisOptions. This includes:event_type_info).use_stdlib().Sessionprovides high-level methods (tokenize,parse,run_static_analysis) that abstract away the individual steps of lexical analysis, syntactic parsing, and semantic analysis. This makes the library easier to consume and ensures consistent application of the configured analysis options across all stages.