Method: Treetop::Compiler::Metagrammar#_nt_parsing_expression

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

#_nt_parsing_expressionObject



873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/vendor/treetop/lib/treetop/compiler/metagrammar.rb', line 873

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

  i0 = index
  r1 = _nt_choice
  if r1
    r0 = r1
  else
    r2 = _nt_sequence
    if r2
      r0 = r2
    else
      r3 = _nt_primary
      if r3
        r0 = r3
      else
        self.index = i0
        r0 = nil
      end
    end
  end

  node_cache[:parsing_expression][start_index] = r0

  return r0
end