Convert Brainfuck to a Non-Golfing Language Input:
Any Brainfuck program. This includes brainfuck programs with comments such as +++COMMENT[&gt;+++&lt;-]..
Output:
A program in one of the below languages that produces the same output as the Brainfuck program on all inputs. It should produce the same output exactly as the interepreter on this website There are no code-golf or performance restrictions on the output program; the outputted program doesn't need to be optimized in any way. In other words, the quality of the outputted program does not affect score, only the translation program. To clarify: you may write your answer in any language that is normally valid for answers on PCG. The restriction on output languages is only for the outputted program.
The outputted program only receives the same input that would be received by the Brainfuck program. The outputted program does not receive the Brainfuck program as input.
Valid Output Languages

C#
C++
C
Java 8
Javascript ES6 (it is both okay to receive all of stdin in a single prompt, or multiple prompts per character)
Perl
Python 2.7
Python 3.4.2
Ruby

Fine Print
You may write a program or function which takes the Brainfuck program as a String argument or on STDIN or closest alternative, and which returns the output as a String or printing it to STDOUT (or closest alternative). You may optionally include a single trailing newline in the output.
Additionally, standard loopholes which are no longer funny are banned. You may not use external libraries or external data files, the code must be self contained.
This is code-golf, shortest program wins.
K, 143 129 113 bytes

1!"}int a[99];int*p=a;main(){",,/{("p++;";"p--;";"*p++;";"*p--;";"*p=getchar();if(*p&lt;0)*p=0;";"putchar(*p);";"while(*p){";"}";"")"&gt;&lt;+-,.[]"?x}'


This is an extremely straightforward approach which generates C source code by emitting a preamble, a C snippet for each BF command and then a postscript. Non-BF characters are translated into empty strings in the concatenated output.

The translation into C is as follows:


preamble: int a[99];int*p=a;main(){
&gt;: p++;
&lt;: p--;
+: *p++;
-: *p--;
,: *p=getchar();if(*p&lt;0)*p=0;
.: putchar(*p);
[: while(*p){
]: }
postscript: }


I suspect that there is room for improvement here by using more mangled abuses of C or compressing the C fragments.

The K part of the program by itself would look like the following, where c is the C translations of each BF instruction and p is the preamble/postscript:

1!p,,/{c"&gt;&lt;+-,.[]"?x}'


Using the venerable BF string reverser program &gt;,[&gt;,]&lt;[.&lt;] as my test case I generate code which looks like the following after a bit of whitespace for readability:

int a[99];
int*p=a;

main(){
    p++;
    *p=getchar();if(*p&lt;0)*p=0;
    while(*p){
        p++;
        *p=getchar();if(*p&lt;0)*p=0;
    }
    p--;
    while(*p){
        putchar(*p);
        p--;
    }
}


edit:

A few tweaks. Firstly, more compliant tape declaration as suggested by alexander-brett. The int part can be left off:

int a[99]; -> a[1&lt;&lt;15]; (-1 byte)

Also, it seems that EOF behavior in BF can return 0, -1 or cause no change as a result of ,. EOF=-1 seems to be what other solutions are going with, so for the sake of uniformity I will do the same:

*p=getchar();if(*p&lt;0)*p=0; -> *p=getchar(); (-13 bytes)

Note that this means my string reverser program will choke if you simply cat it a file ending in EOF(!), but as above it seems to be fair.

The new complete 129 byte solution:

1!"}a[1&lt;&lt;15];int*p=a;main(){",,/{("p++;";"p--;";"*p++;";"*p--;";"*p=getchar();";"putchar(*p);";"while(*p){";"}";"")"&gt;&lt;+-,.[]"?x}'


edit 2, much, much later:

I randomly stumbled upon this old answer and, being older and wiser, realized there are several ways to make this shorter:


exploit the fact that it's completely syntactically valid C to include semicolons after every fragment instead of just those who need them, and thus remove them from the lookup table entries.
use the k5/k6 or oK dialects, which have overloads for \ and / which split a string apart on a character or join a list of strings with a character, respectively, to use a more compact representation of the lookup table and accomplish the above.
take advantage of the fact that find (dyadic ?) in the above dialects naturally conforms to a listy right argument, and thus does not need an explicit lambda + each


The one downside is that in these dialects there is no "rotate" primitive, so we have to add the "}" suffix in a less elegant manner. The overall structure of our solution:

1!     p, ,/{c"&gt;&lt;+-,.[]"?x}'   / old
,[;"}"]p,";"/c"&gt;&lt;+-,.[]"?      / new


The complete (and now totally points-free!) solution:

,[;"}"]"a[1&lt;&lt;15];int*p=a;main(){",";"/("|"\"p++|p--|*p++|*p--|*p=getchar()|putchar(*p)|while(*p){|}|")"&gt;&lt;+-,.[]"?


Which shaves us down to 113 bytes.