No description, website, or topics provided.
Ruby
Latest commit d3889c4 Sep 23, 2013 @ingydotnet Merge pull request #2 from aocole/patch-1
lex() should not destroy argument
Permalink
Failed to load latest commit information.
lib/scim/query/filter lex() should not destroy argument Sep 20, 2013
test Some reafactoring and better doc. Sep 18, 2013
.gemspec v0.0.2 Sep 18, 2013
.travis.yml one mo time Sep 18, 2013
CHANGELOG.yaml first commit. lexer passing all tests. Sep 17, 2013
Gemfile first commit. lexer passing all tests. Sep 17, 2013
LICENSE first commit. lexer passing all tests. Sep 17, 2013
README.rdoc ... Sep 18, 2013
Rakefile

README.rdoc

Gem
Version

Name

scim-query-filter-parser - Parser for SCIM Filter Query Strings

Synopsis

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

Description

The SCIM spec describes a simple filter query language here: www.simplecloud.info/specs/draft-scim-api-01.html#query-resources

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"]]]

Methods

`parser = SCIM::Query::Filter::Parser.new()`

Creae a new parser object.

`parser.parse(input)`

Parse a SCIM filter query. Return the parser object (self) if successful.

`array = parser.rpn`

Get the RPN array created by the most recent parse.

`tree = parser.tree`

Get the parse result converted to a tree form.

Copyright

Copyright © 2013 Ingy döt Net. See LICENSE for further details.