Parser for SCIM Filter Query Strings
require 'scim/query/filter/parser'
parser = SCIM::Query::Filter::Parser.new
rpn_array = parser.parse(filter_query_string)
rpn_stack = parser.rpn
rpn_tree = parser.tree
# or (in a single statement):
rpn_array = SCIM::Query::Filter::Parser.new.parse(filter_query_string).rpn
The SCIM spec describes a simple filter query language.
This gem can parse one of these filter queries and produce a Reverse Polish Notation (RPN) stack representation.
For example, parse this filter query string:
userType eq "Employee" and (emails co "example.com" or emails co "example.org")
Into this RPN stack (array):
[
'userType',
'"Employee"',
'eq',
'emails',
'"example.com"',
'co',
'emails',
'"example.org"',
'co',
'or',
'and'
]
Or, optionally into this expression tree:
[
'and',
[
'eq',
'userType',
'"Employee"'
],
[
'or',
[
'co',
'emails',
'"example.com"'
],
[
'co',
'emails',
'"example.org"'
]
]
]
Creae a new parser object.
Parse a SCIM filter query. Return the parser object (self) if successful.
Get the RPN array created by the most recent parse.
Get the parse result converted to a tree form.
Copyright (c) 2013-2018 Ingy döt Net. See LICENSE for further details.