import { Expression, Token } from './ast'; import { TemplateLexerToken } from './lexer'; /** * Parse result with collected variables */ export interface ParseResult { expression: Expression; variables: Set; } /** * Parse an expression string into an AST * Supports: * - Literals: strings, numbers, booleans, null * - Identifiers: variable names * - Member access: obj.prop * - Index access: arr[0] * - Function calls: func(arg1, arg2) * - Binary operators: +, -, *, /, %, ==, !=, <, >, <=, >=, &&, || * - Unary operators: !, -, + * - Conditional: condition ? true : false */ export declare function parseExpression(input: string): Expression; /** * Template Parser: Recursive descent parser * Consumes template lexer token stream and builds AST * Handles control structures (if/for/while/repeat) and expressions */ export declare class TemplateParser { private tokens; private pos; constructor(tokens: TemplateLexerToken[]); parse(): Token[]; private parseToken; private parseTag; private parseIfBlock; private parseForBlock; private parseWhileBlock; private parseRepeatBlock; private peek; private advance; private isAtEnd; }