# class Treetop::Compiler::DeclarationSequence

### Public Instance Methods

compile(builder) click to toggle source

    # File lib/treetop/compiler/node_classes/declaration_sequence.rb, line 5
    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

rules() click to toggle source

    # File lib/treetop/compiler/node_classes/declaration_sequence.rb, line 19
    def rules
      declarations.select { |declaration| declaration.instance_of?(ParsingRule) }
    end