#ifndef SPROUT_BRAINFUCK_MISA_HPP #define SPROUT_BRAINFUCK_MISA_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace sprout { namespace brainfuck { namespace misa { // // to_brainfuck // template inline SPROUT_CONSTEXPR sprout::pair::type, bool> to_brainfuck(InputIterator first, InputIterator last, Result const& result) { return sprout::brainfuck::detail::parsed_to_brainfuck( sprout::weed::parse( first, last, *sprout::weed::lim::static_size>( sprout::weed::replace('>') [sprout::weed::lit('>') | "→" | "〜" | "ー"] | sprout::weed::replace('<') [sprout::weed::lit('<') | "←" | "★" | "☆"] | sprout::weed::replace('+') [sprout::weed::lit('+') | "あ" | "ぁ" | "お" | "ぉ"] | sprout::weed::replace('-') [sprout::weed::lit('-') | "っ" | "ッ"] | sprout::weed::replace('.') [sprout::weed::lit('.') | "!"] | sprout::weed::replace(',') [sprout::weed::lit(',') | "?"] | sprout::weed::replace('[') [sprout::weed::lit('[') | "「" | "『"] | sprout::weed::replace(']') [sprout::weed::lit(']') | "」" | "』"] | sprout::weed::replace(' ') [sprout::weed::char_] ) ), result ); } // // exec_range // template inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm::type exec_range(Source const& source, Output const& output, Input const& input) { typedef typename sprout::container_construct_traits::copied_type copied_type; return sprout::brainfuck::exec_range( sprout::brainfuck::misa::to_brainfuck(sprout::begin(source), sprout::end(source), sprout::pit()).first, output, input ); } template inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm::type exec_range(Source const& source, Output const& output) { typedef typename sprout::container_construct_traits::copied_type copied_type; return sprout::brainfuck::exec_range( sprout::brainfuck::misa::to_brainfuck(sprout::begin(source), sprout::end(source), sprout::pit()).first, output ); } template inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm< sprout::array::value_type, BufferSize> >::type exec_range(Source const& source) { typedef typename sprout::container_construct_traits::copied_type copied_type; return sprout::brainfuck::exec_range( sprout::brainfuck::misa::to_brainfuck(sprout::begin(source), sprout::end(source), sprout::pit()).first ); } } // namespace misa } // namespace brainfuck } // namespace sprout #endif // #ifndef SPROUT_BRAINFUCK_MISA_HPP