@mfissehaye/string-to-drizzle-orm-filters
Version:
42 lines • 1.28 kB
TypeScript
import { Program } from "./ast";
import { Lexer, Token } from "./lexer";
export declare class ParserError extends Error {
token?: Token | undefined;
constructor(message: string, token?: Token | undefined);
}
/**
* The Parser class takes a Lexer instance and constructs an Abstraact Syntax Tree (AST)
* from the stream of tokens
*/
export declare class Parser {
private lexer;
private lookahead;
constructor(lexer: Lexer);
parse(): Program;
private consume;
/**
* Checks if the current lookahead matches the given type without consuming it.
*/
private match;
/**
* @Parses a general expression.
* Currently, this only delegates to logical expressions.
*/
private parseExpression;
private parseLogicalExpression;
/**
* Parses a primary expression, which can be a CallExpression or a parenthesized expression.
*/
private parsePrimaryExpression;
/**
* Parses a function call expression (e.g., `eq("col", "val")`).
*/
private parseCallExpression;
/**
* Parses the arguments within a function call.
* Arguments can be string literals or nested call expressions.
*/
private parseArguments;
private parseArgument;
}
//# sourceMappingURL=parser.d.ts.map