Method: Treetop::Compiler::Metagrammar#_nt_node_class_declarations

Defined in:
lib/vendor/treetop/lib/treetop/compiler/metagrammar.rb

#_nt_node_class_declarationsObject



1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
# File 'lib/vendor/treetop/lib/treetop/compiler/metagrammar.rb', line 1665

def _nt_node_class_declarations
  start_index = index
  if node_cache[:node_class_declarations].has_key?(index)
    cached = node_cache[:node_class_declarations][index]
    @index = cached.interval.end if cached
    return cached
  end

  i0, s0 = index, []
  r1 = _nt_node_class_expression
  s0 << r1
  if r1
    r2 = _nt_trailing_inline_module
    s0 << r2
  end
  if s0.last
    r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
    r0.extend(NodeClassDeclarations0)
    r0.extend(NodeClassDeclarations1)
  else
    self.index = i0
    r0 = nil
  end

  node_cache[:node_class_declarations][start_index] = r0

  return r0
end