Expand description
SqlExprParser - Generated by CongoCC Parser Generator
This parser was automatically generated from: SqlExprParser.ccc Do not edit this file directly. Regenerate from the grammar instead.
§Features
- Arena-based allocation: All AST nodes and tokens are stored in a central arena
- Type-safe indices:
NodeIdandTokenIdprovide safe references without lifetimes - Result-based errors: All parsing operations return
Result<T, ParseError> - Location tracking: Errors include line/column information for better diagnostics
§Example
ⓘ
use parser::*;
fn main() -> Result<(), ParseError> {
let input = "your input here".to_string();
let mut parser = Parser::new(input)?;
// parse() returns the root NodeId of the AST
let root = parser.parse()?;
// Access AST through the arena, with original input for pretty printing
println!("{}", parser.arena().pretty_print(root, 0, parser.input()));
Ok(())
}Structs§
- AddExpression
Node - AST node for addExpression production
- AndExpression
Node - AST node for andExpression production
- Arena
- Arena that owns all AST nodes and tokens
- Comparison
Expression Node - AST node for comparisonExpression production
- Equality
Expression Node - AST node for equalityExpression production
- JmsSelector
Node - AST node for JmsSelector production
- Lexer
- The lexer/tokenizer for SqlExprParser
- Literal
Node - AST node for literal production
- Mult
Expr Node - AST node for multExpr production
- NodeId
- Type-safe index for nodes in the arena
- OrExpression
Node - AST node for orExpression production
- Parse
Error - Error type for parsing failures
- Parser
- The parser for SqlExprParser
- Primary
Expr Node - AST node for primaryExpr production
- String
Literal Node - AST node for stringLiteral production
- Token
- A single token in the input stream
- TokenId
- Type-safe index for tokens in the arena
- Unary
Expr Node - AST node for unaryExpr production
- Variable
Node - AST node for variable production
Enums§
- AddOp
- Operator for addExpression
- AstNode
- Enum containing all AST node types
- Comparison
Op - Operator for comparisonExpression
- Equality
Op - Operator for equalityExpression
- Eval
Error - Comprehensive error type for evaluation failures
- Lexical
State - Lexical state enumeration
- Mult
Expr Op - Operator for multExpr
- Runtime
Value - User-provided values for variable substitution
- Token
Type - Token type enumeration
- UnaryOp
- Operator for unaryExpr
- Visit
Control - Controls visitor traversal behavior
Traits§
- Token
Source - Token source trait for tracking token locations
Functions§
- evaluate
- Evaluate a SQL boolean expression string with variable bindings.
Type Aliases§
- Parse
Result - Result type for parsing operations