Class: Scim2::Filter::Parser
- Inherits:
-
Racc::Parser
- Object
- Racc::Parser
- Scim2::Filter::Parser
- Defined in:
- lib/scim2/filter/parser.rb
Overview
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:
Instance Attribute Summary collapse
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
Instance Method Summary collapse
-
#initialize(handler = SimpleHandler.new) ⇒ Parser
constructor
A new instance of Parser.
-
#next_token ⇒ String
Required by Racc::Parser to emit the next token to the parser.
-
#parse(string) ⇒ Object
Parses a given string input.
Constructor Details
#initialize(handler = SimpleHandler.new) ⇒ Parser
Returns a new instance of Parser.
20 21 22 23 |
# File 'lib/scim2/filter/parser.rb', line 20 def initialize(handler = SimpleHandler.new) super() @handler = handler end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
17 18 19 |
# File 'lib/scim2/filter/parser.rb', line 17 def handler @handler end |
Instance Method Details
#next_token ⇒ String
Required by Racc::Parser to emit the next token to the parser. This method should generally not be called directly.
28 29 30 |
# File 'lib/scim2/filter/parser.rb', line 28 def next_token @lexer.next_token end |
#parse(string) ⇒ Object
Parses a given string input
35 36 37 38 39 |
# File 'lib/scim2/filter/parser.rb', line 35 def parse(string) @lexer = Lexer.new @lexer.scan_setup(string) do_parse end |