xlucene-parser / parser / Parser
Class: Parser
Parse a xLucene query
Constructors
new Parser()
new Parser(
query
,options
?,_overrideNode
?):Parser
Parameters
Parameter | Type |
---|---|
query | string |
options ? | ParserOptions |
_overrideNode ? | Node |
Returns
Source
xlucene-parser/src/parser.ts:23
Properties
ast
readonly
ast:Node
Source
xlucene-parser/src/parser.ts:18
filterNilVariables
readonly
filterNilVariables:boolean
Source
xlucene-parser/src/parser.ts:21
query
readonly
query:string
Source
xlucene-parser/src/parser.ts:19
typeConfig
readonly
typeConfig:xLuceneTypeConfig
Source
xlucene-parser/src/parser.ts:20
Methods
filterNodes()
filterNodes(
ast
,fn
):Node
Parameters
Parameter | Type |
---|---|
ast | Node |
fn | (node , parent ?) => boolean |
Returns
Source
xlucene-parser/src/parser.ts:89
forEachFieldValue()
forEachFieldValue(
cb
):void
Iterate over all of the field value from Term-Like nodes, this is useful for validating values and variables.
Parameters
Parameter | Type |
---|---|
cb | (value , node ) => void |
Returns
void
Source
xlucene-parser/src/parser.ts:267
forEachTermNode()
forEachTermNode(
fieldValidator
,valueValidator
):void
Parameters
Parameter | Type |
---|---|
fieldValidator | (field ) => void |
valueValidator | (fieldValue ) => void |
Returns
void
Source
xlucene-parser/src/parser.ts:289
forTermTypes()
forTermTypes(
cb
,skipFunctionParams
):void
Iterate over all of the Term-Like nodes.
Parameters
Parameter | Type | Default value |
---|---|---|
cb | (node ) => void | undefined |
skipFunctionParams | boolean | true |
Returns
void
Source
xlucene-parser/src/parser.ts:252
forTypes()
forTypes<
T
>(types
,cb
,skipFunctionParams
):void
Recursively Iterate over all or select set of the nodes types
Type parameters
Type parameter |
---|
T extends readonly NodeType [] | NodeType [] |
Parameters
Parameter | Type | Default value |
---|---|---|
types | T | undefined |
cb | (node ) => void | undefined |
skipFunctionParams | boolean | false |
Returns
void
Source
xlucene-parser/src/parser.ts:212
mapNode()
mapNode(
fn
):Node
Map the Node and return a new Node
Parameters
Parameter | Type |
---|---|
fn | (node , parent ?) => Node |
Returns
Source
xlucene-parser/src/parser.ts:391
resolveVariables()
resolveVariables(
variables
):Parser
Validate and resolve the variables, returns a new Parser instance
Parameters
Parameter | Type |
---|---|
variables | xLuceneVariables |