class Scim2::Filter::Parser
Implements a SCIM2 compliant event-based parser for query filters. The parser will emit four different events to a handler implemention as it encounters various components within the filter. For reference, see:
-
{SimpleHandler#on_not_filter}
-
{SimpleHandler#on_attribute_filter}
-
{SimpleHandler#on_logical_filter}
-
{SimpleHandler#on_nested_filter}
Constants
- Racc_arg
- Racc_debug_parser
- Racc_token_to_s_table
Attributes
handler[R]
Public Class Methods
new(handler = SimpleHandler.new)
click to toggle source
@param handler <Handler> a handler object that responds to all four events
Calls superclass method
# File lib/scim2/filter/parser.rb, line 20 def initialize(handler = SimpleHandler.new) super() @handler = handler end
Public Instance Methods
_reduce_none(val, _values, result)
click to toggle source
reduce 30 omitted
# File lib/scim2/filter/parser.tab.rb, line 321 def _reduce_none(val, _values, result) val[0] end
next_token()
click to toggle source
Required by {::Racc::Parser} to emit the next token to the parser. This method should generally not be called directly. @return <String> the next token
# File lib/scim2/filter/parser.rb, line 28 def next_token @lexer.next_token end
parse(string)
click to toggle source
Parses a given string input @param string <String> the filter to parse @return <Object> returns the last object emitted by the handler
# File lib/scim2/filter/parser.rb, line 35 def parse(string) @lexer = Lexer.new @lexer.scan_setup(string) do_parse end