@aws-lambda-powertools/jmespath
Version:
A type safe and modern jmespath module to parse and extract data from JSON documents using JMESPath
35 lines • 1.41 kB
TypeScript
import { ParsedResult } from './ParsedResult.js';
/**
* Top down operaotr precedence parser for JMESPath.
*
* ## References
* The implementation of this Parser is based on the implementation of
* [jmespath.py](https://github.com/jmespath/jmespath.py/), which in turn
* is based on [Vaughan R. Pratt's "Top Down Operator Precedence"](http://dl.acm.org/citation.cfm?doid=512927.512931).
*
* If you don't want to read the full paper, there are some other good
* overviews that explain the general idea:
* - [Pratt Parsers: Expression Parsing Made Easy](https://journal.stuffwithstuff.com/2011/03/19/pratt-parsers-expression-parsing-made-easy/)
* - [Simple Top-Down Parsing in Python](https://11l-lang.org/archive/simple-top-down-parsing/)
* - [Top Down Operator Precedence](http://javascript.crockford.com/tdop/tdop.html)
*/
declare class Parser {
#private;
constructor(lookahead?: number);
/**
* Parse a JMESPath expression and return the Abstract Syntax Tree (AST)
* that represents the expression.
*
* The AST is cached, so if you parse the same expression multiple times,
* the AST will be returned from the cache.
*
* @param expression The JMESPath expression to parse.
*/
parse(expression: string): ParsedResult;
/**
* Purge the entire cache.
*/
purgeCache(): void;
}
export { Parser };
//# sourceMappingURL=Parser.d.ts.map