class Treetop::Compiler::DeclarationSequence

def compile(builder)

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

def rules
  declarations.select { |declaration| declaration.instance_of?(ParsingRule) }
end