# File kwartz.rb, line 600
        def convert
            plcode = ''
            if @toppings[:header_text] then
                @toppings[:header_text].each_line do |line|
                    line.sub!(/\n/, '\n')
                    line.gsub!(/'/, '\\\\\'')
                    plcode << ":print('#{line}')\n"
                end
            end
            if @toppings[:header_plcode] then
                plcode << @toppings[:header_plcode]
            end

            text = ''
            while fv = _fetch() do
                text << fv.head_text
                if fv.directive_name then
                    plcode << _print_text(text)
                    text = ''
                    plcode << _convert_element(fv)
                else
                    text << fv.tag_str()
                end
            end
            plcode << _print_text(text)

            rest = @input
            plcode << _print_text(rest) if ! rest.empty?

            s = ''
            _each_macro do |name, body|
                s << ":macro(#{name})\n"
                s << body.gsub(/^/, '  ')
                s << ":end\n"
                s << "\n"
            end
            plcode = s + plcode

            if @toppings[:footer_text] then
                @toppings[:footer_text].each_line do |line|
                    line.sub!(/\n/, '\n')
                    line.gsub!(/'/, '\\\\\'')
                    plcode << ":print('#{line}')\n"
                end
            end
            if @toppings[:footer_plcode] then
                plcode << @toppings[:footer_plcode]
            end

            return plcode
        end