#include <stdlib.h>
#include <string.h>
struct cell {
int c, d;
void *label;
};
size_t width(const char *s) {
const char *p;
for (p = s; *p && *p == *s; p++) {}
return p - s;
}
size_t nop_width(const char *s) {
const char *p;
for (p = s; *p; p++) {
if (*p == '>' || *p == '<' || *p == '+' || *p == '-') break;
if (*p == '.' || *p == ',' || *p == '[' || *p == ']') break;
}
return p - s;
}
struct cell *find_square_bracket_right(struct cell *p) {
int depth = 0;
for (; p->c; p++) {
if (p->c == '[') depth++;
else if (p->c == ']') {
if (depth == 0) break;
else depth--;
}
}
return p;
}
struct cell *init_square_brackets(struct cell *b) {
struct cell *p, *q;
for (p = b; p->c; p++) {
if (p->c == '[') {
q = find_square_bracket_right(p + 1);
p->d = q - p + 1;
q->d = - (q - p) + 1;
}
}
return b;
}
struct cell *scan(const char *s) {
struct cell
*cells
= malloc(sizeof (struct cell
) * (strlen(s
) + 1)), *p
; for (p = cells; *s; s += p->d, p++) {
switch (p->c = *s) {
case '>': case '<': case '+': case '-': p->d = width(s); break;
case '.': case ',': case '[': case ']': p->d = 1; break;
default: p->d = nop_width(s); break;
}
}
p->c = '\0';
p->d = 0;
return init_square_brackets(cells);
}
struct cell *f(struct cell *ip0, register char *dp) {
register struct cell *ip;
for (ip = ip0; ip->c; ip++) {
switch (ip->c) {
case '>': ip->label = &&A; break;
case '<': ip->label = &&B; break;
case '+': ip->label = &&C; break;
case '-': ip->label = &&D; break;
case '.': ip->label = &&E; break;
case ',': ip->label = &&F; break;
case '[': ip->label = &&G; break;
case ']': ip->label = &&H; break;
default: ip->label = &&Z; break;
}
}
ip->label = &&RETURN;
ip = ip0;
TOP: goto *ip->label;
A: dp += ip->d; ip++; goto TOP;
B: dp -= ip->d; ip++; goto TOP;
C: *dp += ip->d; ip++; goto TOP;
D: *dp -= ip->d; ip++; goto TOP;
F
: *dp
= getchar(); ip
++; goto TOP
; G: *dp ? ip++ : (ip += ip->d); goto TOP;
H: *dp ? (ip += ip->d) : ip++; goto TOP;
Z: ip++; goto TOP;
RETURN: return ip0;
}
void g(const char *s) {
char data[30000] = {0};
}
int main() {
char *s =
" A mandelbrot set fractal viewer in brainf*** written by Erik Bosman"
"+++++++++++++[->++>>>+++++>++>+<<<<<<]>>>>>++++++>--->>>>>>>>>>+++++++++++++++[["
">>>>>>>>>]+[<<<<<<<<<]>>>>>>>>>-]+[>>>>>>>>[-]>]<<<<<<<<<[<<<<<<<<<]>>>>>>>>[-]+"
"<<<<<<<+++++[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>>>+>>>>>>>>>>>>>>>>>>>>>>>>>>"
">+<<<<<<<<<<<<<<<<<[<<<<<<<<<]>>>[-]+[>>>>>>[>>>>>>>[-]>>]<<<<<<<<<[<<<<<<<<<]>>"
">>>>>[-]+<<<<<<++++[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>>+<<<<<<+++++++[-[->>>"
">>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>>+<<<<<<<<<<<<<<<<[<<<<<<<<<]>>>[[-]>>>>>>[>>>>>"
">>[-<<<<<<+>>>>>>]<<<<<<[->>>>>>+<<+<<<+<]>>>>>>>>]<<<<<<<<<[<<<<<<<<<]>>>>>>>>>"
"[>>>>>>>>[-<<<<<<<+>>>>>>>]<<<<<<<[->>>>>>>+<<+<<<+<<]>>>>>>>>]<<<<<<<<<[<<<<<<<"
"<<]>>>>>>>[-<<<<<<<+>>>>>>>]<<<<<<<[->>>>>>>+<<+<<<<<]>>>>>>>>>+++++++++++++++[["
">>>>>>>>>]+>[-]>[-]>[-]>[-]>[-]>[-]>[-]>[-]>[-]<<<<<<<<<[<<<<<<<<<]>>>>>>>>>-]+["
">+>>>>>>>>]<<<<<<<<<[<<<<<<<<<]>>>>>>>>>[>->>>>[-<<<<+>>>>]<<<<[->>>>+<<<<<[->>["
"-<<+>>]<<[->>+>>+<<<<]+>>>>>>>>>]<<<<<<<<[<<<<<<<<<]]>>>>>>>>>[>>>>>>>>>]<<<<<<<"
"<<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