Sha256: 1760825336e060ad4eed1d29717d1eb5649511a533ab146d3a7cbcc6834ef12e

Contents?: true

Size: 570 Bytes

Versions: 282

Compression:

Stored size: 570 Bytes

Contents

module Treetop
  module Compiler
    class DeclarationSequence < Runtime::SyntaxNode

      def compile(builder)
        unless rules.empty?
          builder.method_declaration("root") do
            builder << "@root ||= :#{rules.first.name}"
          end
          builder.newline
        end
        
        declarations.each do |declaration|
          declaration.compile(builder)
          builder.newline
        end
      end
      
      def rules
        declarations.select { |declaration| declaration.instance_of?(ParsingRule) }
      end
    end
  end
end

Version data entries

282 entries across 237 versions & 32 rubygems

Version Path
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-csharp-0.1.0 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-htmlentities-0.1.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-output-icinga-1.0.0 vendor/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-input-fifo-0.9.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/declaration_sequence.rb