Method: WOoo::Electronics::IntelHex#_nt_address

Defined in:
lib/wo_oo/electronics/intel_hex_grammar.rb

#_nt_addressObject



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/wo_oo/electronics/intel_hex_grammar.rb', line 240

def _nt_address
  start_index = index
  if node_cache[:address].has_key?(index)
    cached = node_cache[:address][index]
    if cached
      cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
      @index = cached.interval.end
    end
    return cached
  end

  i0, s0 = index, []
  r1 = _nt_hex_value
  s0 << r1
  if r1
    r2 = _nt_hex_value
    s0 << r2
    if r2
      r3 = _nt_hex_value
      s0 << r3
      if r3
        r4 = _nt_hex_value
        s0 << r4
      end
    end
  end
  if s0.last
    r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
    r0.extend(Address0)
  else
    @index = i0
    r0 = nil
  end

  node_cache[:address][start_index] = r0

  r0
end