History log of /openbmc/bmcweb/test/redfish-core/include/filter_expr_parser_test.cpp (Results 1 – 2 of 2)
Revision Date Author Comments
# 2261a982 24-Jun-2024 Ed Tanous <ed@tanous.net>

Use lexme in redfish filter parser

Previously, the parser added space ignore instructions between every
node. This is because there was one place where we actually cared about
spaces, when doing op

Use lexme in redfish filter parser

Previously, the parser added space ignore instructions between every
node. This is because there was one place where we actually cared about
spaces, when doing operator comparisons (x eq y). If spaces are
ignored, it's impossible to determine the end of x and the beginning of
eq.

Spirit x3 has a lexeme, which allows us to ignore the parser skips
temporarily, which allows us to parse the operations in a much simpler
way. This also requires that we change to phrase_parse instead of
parse.

Tested: Unit tests pass. Good coverage.

Change-Id: Ifc6f1681e8524ba5032ee118cc3b3a18b30c639e
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# f88b2170 15-Apr-2022 Ed Tanous <edtanous@google.com>

Filter Expression parser

This commit implements a parser for $filter expressions, per the redfish
specification and odata specification. This is intended to be used to
support $filter query for col

Filter Expression parser

This commit implements a parser for $filter expressions, per the redfish
specification and odata specification. This is intended to be used to
support $filter query for collections.

For parsing libraries, this commit chooses boost spirit x3. It's chosen
because it doesn't require a new external dependency, and is done
entirely in the compiler, using C++ syntax. While the syntax is still
somewhat difficult to read, there's a slew of unit tests included to
make sure that at least the common things we expect to work will parse
correctly.

Tested: Unit tests pass (good coverage). Code not yet used.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I1b0ab615bc49064acab4dad47f0a8aa499557bfc

show more ...