_nt_character_class (Treetop::Compiler::Metagrammar)

    # File lib/treetop/compiler/metagrammar.rb, line 2295
          def _nt_character_class
            start_index = index
            if node_cache[:character_class].has_key?(index)
              cached = node_cache[:character_class][index]
              @index = cached.interval.end if cached
              return cached
            end

            i0, s0 = index, []
            if input.index('[', index) == index
              r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
              @index += 1
            else
              terminal_parse_failure('[')
              r1 = nil
            end
            s0 << r1
            if r1
              s2, i2 = [], index
              loop do
                i3, s3 = index, []
                i4 = index
                if input.index(']', index) == index
                  r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
                  @index += 1
                else
                  terminal_parse_failure(']')
                  r5 = nil
                end
                if r5
                  r4 = nil
                else
                  self.index = i4
                  r4 = instantiate_node(SyntaxNode,input, index...index)
                end
                s3 << r4
                if r4
                  i6 = index
                  i7, s7 = index, []
                  if input.index('\\', index) == index
                    r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
                    @index += 1
                  else
                    terminal_parse_failure('\\')
                    r8 = nil
                  end
                  s7 << r8
                  if r8
                    if index < input_length
                      r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
                      @index += 1
                    else
                      terminal_parse_failure("any character")
                      r9 = nil
                    end
                    s7 << r9
                  end
                  if s7.last
                    r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
                    r7.extend(CharacterClass0)
                  else
                    self.index = i7
                    r7 = nil
                  end
                  if r7
                    r6 = r7
                  else
                    i10, s10 = index, []
                    i11 = index
                    if input.index('\\', index) == index
                      r12 = instantiate_node(SyntaxNode,input, index...(index + 1))
                      @index += 1
                    else
                      terminal_parse_failure('\\')
                      r12 = nil
                    end
                    if r12
                      r11 = nil
                    else
                      self.index = i11
                      r11 = instantiate_node(SyntaxNode,input, index...index)
                    end
                    s10 << r11
                    if r11
                      if index < input_length
                        r13 = instantiate_node(SyntaxNode,input, index...(index + 1))
                        @index += 1
                      else
                        terminal_parse_failure("any character")
                        r13 = nil
                      end
                      s10 << r13
                    end
                    if s10.last
                      r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
                      r10.extend(CharacterClass1)
                    else
                      self.index = i10
                      r10 = nil
                    end
                    if r10
                      r6 = r10
                    else
                      self.index = i6
                      r6 = nil
                    end
                  end
                  s3 << r6
                end
                if s3.last
                  r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
                  r3.extend(CharacterClass2)
                else
                  self.index = i3
                  r3 = nil
                end
                if r3
                  s2 << r3
                else
                  break
                end
              end
              if s2.empty?
                self.index = i2
                r2 = nil
              else
                r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
              end
              s0 << r2
              if r2
                if input.index(']', index) == index
                  r14 = instantiate_node(SyntaxNode,input, index...(index + 1))
                  @index += 1
                else
                  terminal_parse_failure(']')
                  r14 = nil
                end
                s0 << r14
              end
            end
            if s0.last
              r0 = instantiate_node(CharacterClass,input, i0...index, s0)
              r0.extend(CharacterClass3)
              r0.extend(CharacterClass4)
            else
              self.index = i0
              r0 = nil
            end

            node_cache[:character_class][start_index] = r0

            return r0
          end