Class: ActiveFacts::CQL::Parser
- Inherits:
-
CQLParser
- Object
- CQLParser
- ActiveFacts::CQL::Parser
show all
- Includes:
- ActiveFacts
- Defined in:
- lib/activefacts/cql/parser.rb
Overview
Extend the generated parser:
Defined Under Namespace
Classes: Context, InputProxy
Constant Summary
Constants included
from ActiveFacts
VERSION
Instance Method Summary
collapse
extract_hash_args
Instance Method Details
#context ⇒ Object
185
186
187
|
# File 'lib/activefacts/cql/parser.rb', line 185
def context
@context ||= Context.new(self)
end
|
#parse(input, options = {}) ⇒ Object
194
195
196
197
|
# File 'lib/activefacts/cql/parser.rb', line 194
def parse(input, options = {})
input = InputProxy.new(input, context) unless input.respond_to?(:context)
super(input, options)
end
|
#parse_all(input, rule_name = nil, &block) ⇒ Object
199
200
201
202
203
204
205
206
207
208
209
210
|
# File 'lib/activefacts/cql/parser.rb', line 199
def parse_all(input, rule_name = nil, &block)
self.root = rule_name if rule_name
@index = 0 self.consume_all_input = false
begin
node = parse(InputProxy.new(input, context), :index => @index)
return nil unless node
block.call(node) if block
end until self.index == @input_length
true
end
|
#unit?(s) ⇒ Boolean
189
190
191
192
|
# File 'lib/activefacts/cql/parser.rb', line 189
def unit?(s)
true
end
|