internal package Foswiki::Query::Parser

See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview

internal package Foswiki::Query::Parser is a Foswiki::Infix::Parser

Parser for queries, using the Foswiki::Infix::Parser.

The default node type in the generated parse tree is Foswiki::Query::Node, though you can pass your own alternative class as an option (it must implement Foswiki::Infix::Node)

Query Language BNF
expr ::= and_expr 'or' expr | and_expr;
and_expr ::= not_expr 'and' and_expr | not_expr;
not_expr ::= 'not' comma_expr | comma_expr;
comma_expr ::= cmp_expr ',' comma_expr | cmp_expr;
cmp_expr ::= add_expr cmp_op cm_expr | add_expr;
cmp_op ::= '<=' | '>=' | '<' | '>' | '=' | '=~' | '~' | '!=' | 'in';
add_expr ::= mul_expr add_op add_expr | mul_expr;
mul_expr ::= ref_expr mul_op mul_expr | ref_expr;
mul_op ::= '*' | 'div';
ref_expr ::= u_expr ref_op ref_expr | u_expr;
ref_op ::= '/' | '.';
u_expr ::= value uop u_expr | value;
uop ::= 'lc' | 'uc' | 'd2n' | 'length' | '-' | 'int' | '@';
value ::= <name> | <string> | <number>;
String and Numbers are as defined in Foswiki::Infix::Parser. Names default to /([A-Z:][A-Z0-9_:]*|({[A-Z][A-Z0-9_]*})+)/i.

See QuerySearch for details of the query language.

Topic revision: r1 - 02 Mar 2020, UnknownUser
© 2020 Ultranauts - 75 Broad Street, 2nd Floor, Suite 206, New York, NY 10004 - info@ultranauts.co