rem: else
add: } else
context: parse_rs274x(gerb_file_t *fd, gerb_image_t *image, gerb_state_t *state){    int op[2];    char str[3];    gerb_aperture_t *a = NULL;    amacro_t *tmp_amacro;    int ano;        op[0] = gerb_fgetc(fd);    op[1] = gerb_fgetc(fd);        if ((op[0] == EOF) || (op[1] == EOF))	GERB_COMPILE_ERROR("Unexpected EOF found.\n");    switch (A2I(op[0], op[1])){      /* Directive parameters */    case A2I('A','S'): /* Axis Select */	op[0] = gerb_fgetc(fd);	op[1] = gerb_fgetc(fd);		if ((op[0] == EOF) || (op[1] == EOF))	    GERB_COMPILE_ERROR("Unexpected EOF found.\n");		if (((op[0] == 'A') && (op[1] == 'Y')) ||	    ((op[0] == 'B') && (op[1] == 'X'))) {	    NOT_IMPL(fd, "%MI with reversed axis not supported%");	    break;	}	op[0] = gerb_fgetc(fd);	op[1] = gerb_fgetc(fd);	if ((op[0] == EOF) || (op[1] == EOF))	    GERB_COMPILE_ERROR("Unexpected EOF found.\n");	if (((op[0] == 'A') && (op[1] == 'Y')) ||	    ((op[0] == 'B') && (op[1] == 'X'))) {	    NOT_IMPL(fd, "%MI with reversed axis not supported%");	    break;	}	break;    case A2I('F','S'): /* Format Statement */	image->format = (gerb_format_t *)malloc(sizeof(gerb_format_t));	if (image->format == NULL) 	    GERB_FATAL_ERROR("Failed malloc for format\n");	memset((void *)image->format, 0, sizeof(gerb_format_t));		switch (gerb_fgetc(fd)) {	case 'L':	    image->format->omit_zeros = LEADING;	    break;	case 'T':	    image->format->omit_zeros = TRAILING;	    break;	case 'D':	    image->format->omit_zeros = EXPLICIT;	    break;	default:	    GERB_MESSAGE("EagleCad bug detected: Defaults to omit leading zeroes\n");	    gerb_ungetc(fd);	    image->format->omit_zeros = LEADING;	}		switch (gerb_fgetc(fd)) {	case 'A':	    image->format->coordinate = ABSOLUTE;	    break;	case 'T':	    image->format->coordinate = INCREMENTAL;	    break;	default:	    GERB_COMPILE_ERROR("Format error: coordinate = %c\n", op[0]);	}	while((op[0] = gerb_fgetc(fd)) != '*') {	    switch (op[0]) {	    case 'N':		op[0] = (char)gerb_fgetc(fd);		image->format->lim_seqno = op[0] - '0';		break;	    case 'G':		op[0] = (char)gerb_fgetc(fd);		image->format->lim_gf = op[0] - '0';		break;	    case 'D':		op[0] = (char)gerb_fgetc(fd);		image->format->lim_pf = op[0] - '0';		break;	    case 'M':		op[0] = (char)gerb_fgetc(fd);		image->format->lim_mf = op[0] - '0';		break;	    case 'X' :		op[0] = gerb_fgetc(fd);		if ((op[0] < '0') || (op[0] > '6'))		    GERB_COMPILE_ERROR("Illegal format size : %c\n", (char)op[0]);		image->format->x_int = op[0] - '0';		op[0] = gerb_fgetc(fd);		if ((op[0] < '0') || (op[0] > '6'))		    GERB_COMPILE_ERROR("Illegal format size : %c\n", (char)op[0]);		image->format->x_dec = op[0] - '0';		break;	    case 'Y':		op[0] = gerb_fgetc(fd);		if ((op[0] < '0') || (op[0] > '6'))		    GERB_COMPILE_ERROR("Illegal format size : %c\n", (char)op[0]);		image->format->y_int = op[0] - '0';		op[0] = gerb_fgetc(fd);		if ((op[0] < '0') || (op[0] > '6'))		    GERB_COMPILE_ERROR("Illegal format size : %c\n", (char)op[0]);		image->format->y_dec = op[0] - '0';		break;	    default :		GERB_COMPILE_ERROR("Not handled  type of format statement [%c]\n", op[0]);	    }	}	break;    case A2I('M','I'): /* Mirror Image */	NOT_IMPL(fd, "%MI%");	break;    case A2I('M','O'): /* Mode of Units */	op[0] = gerb_fgetc(fd);	op[1] = gerb_fgetc(fd);		if ((op[0] == EOF) || (op[1] == EOF))	    GERB_COMPILE_ERROR("Unexpected EOF found.\n");	switch (A2I(op[0],op[1])) {	case A2I('I','N'):	    image->info->unit = INCH;	    break;	case A2I('M','M'):	    image->info->unit = MM;	    GERB_COMPILE_WARNING("This file uses millimeter. gerbv doesn't support millimeter fully, especially in apertures.\n");	    break;	default:	    GERB_COMPILE_ERROR("Illegal unit:%c%c\n", op[0], op[1]);	}	break;    case A2I('O','F'): /* Offset */	op[0] = gerb_fgetc(fd);	while (op[0] != '*') {	    switch (op[0]) {	    case 'A' :		image->info->offset_a = gerb_fgetdouble(fd);		break;	    case 'B' :		image->info->offset_b = gerb_fgetdouble(fd);		break;	    default :		GERB_COMPILE_ERROR("Wrong character in offset:%c\n", op[0]);	    }	    op[0] = gerb_fgetc(fd);	}	return;    case A2I('S','F'): /* Scale Factor */	if (gerb_fgetc(fd) == 'A')	    image->info->scale_factor_A = gerb_fgetdouble(fd);	else 	    gerb_ungetc(fd);	if (gerb_fgetc(fd) == 'B')	    image->info->scale_factor_B = gerb_fgetdouble(fd);	else 	    gerb_ungetc(fd);	if ((fabs(image->info->scale_factor_A - 1.0) > 0.00001) ||	    (fabs(image->info->scale_factor_B - 1.0) > 0.00001))	    NOT_IMPL(fd, "%SF% != 1.0");	break;    case A2I('I','C'): /* Input Code */	/* Thanks to Stephen Adam for providing this information. As he writes:	 *      btw, here's a logic puzzle for you.  If you need to	 * read the gerber file to see how it's encoded, then	 * how can you read it?	 */	op[0] = gerb_fgetc(fd);	op[1] = gerb_fgetc(fd);		if ((op[0] == EOF) || (op[1] == EOF))	    GERB_COMPILE_ERROR("Unexpected EOF found.\n");	switch (A2I(op[0],op[1])) {	case A2I('A','S'):	    image->info->encoding = ASCII;	    break;	case A2I('E','B'):	    image->info->encoding = EBCDIC;	    break;	case A2I('B','C'):	    image->info->encoding = BCD;	    break;	case A2I('I','S'):	    image->info->encoding = ISO_ASCII;	    break;	case A2I('E','I'):	    image->info->encoding = EIA;	    break;	default:	    GERB_COMPILE_ERROR("Strange inputcode : %c%c\n", op[0], op[1]);	}	break;	/* Image parameters */    case A2I('I','J'): /* Image Justify */	NOT_IMPL(fd, "%IJ%");	break;    case A2I('I','N'): /* Image Name */	image->info->name = gerb_fgetstring(fd, '*');	break;    case A2I('I','O'): /* Image Offset */	NOT_IMPL(fd, "%IO%");	break;    case A2I('I','P'): /* Image Polarity */		for (ano = 0; ano < 3; ano++) {	    op[0] = gerb_fgetc(fd);	    if (op[0] == EOF)		GERB_COMPILE_ERROR("Unexpected EOF found.\n");	    str[ano] = (char)op[0];	}		if (strncmp(str, "POS", 3) == 0) 	    image->info->polarity = POSITIVE;	else if (strncmp(str, "NEG", 3) == 0)	    image->info->polarity = NEGATIVE;	else 	    GERB_COMPILE_ERROR("Strange polarity : %c%c%c\n", str[0], str[1], str[2]);		break;    case A2I('I','R'): /* Image Rotation */	NOT_IMPL(fd, "%IR%");	break;    case A2I('P','F'): /* Plotter Film */	NOT_IMPL(fd, "%PF%");	break;		/* Aperture parameters */    case A2I('A','D'): /* Aperture Description */	a = (gerb_aperture_t *)malloc(sizeof(gerb_aperture_t));	memset((void *)a, 0, sizeof(gerb_aperture_t));	ano = parse_aperture_definition(fd, a, image->amacro);	if ((ano >= APERTURE_MIN) && (ano <= APERTURE_MAX)) 	    image->aperture[ano] = a;	else	    GERB_COMPILE_ERROR("Aperture number out of bounds : %d\n", ano);	break;    case A2I('A','M'): /* Aperture Macro */	tmp_amacro = image->amacro;	image->amacro = parse_aperture_macro(fd);	image->amacro->next = tmp_amacro;#ifdef AMACRO_DEBUG	print_program(image->amacro);#endif	break;	/* Layer */    case A2I('L','N'): /* Layer Name */	state->curr_layername = gerb_fgetstring(fd, '*');	break;    case A2I('L','P'): /* Layer Polarity */	switch (gerb_fgetc(fd)) {	case 'D': /* Dark Polarity (default) */	    state->layer_polarity = DARK;	    break;	case 'C': /* Clear Polarity */	    state->layer_polarity = CLEAR;	    break;	default:	    GERB_COMPILE_WARNING("Strange Layer Polarity: %c\n", op[0]);	}	break;    case A2I('K','O'): /* Knock Out */	NOT_IMPL(fd, "%KO%");	break;    case A2I('S','R'): /* Step and Repeat */	op[0] = gerb_fgetc(fd);	if (op[0] != 'X')	    GERB_COMPILE_ERROR("Step-and-repeat parameter error\n");	image->info->step_and_repeat_X = gerb_fgetint(fd);	op[0] = gerb_fgetc(fd);	if (op[0] != 'Y')	    GERB_COMPILE_ERROR("Step-and-repeat parameter error\n");	image->info->step_and_repeat_Y = gerb_fgetint(fd);	op[0] = gerb_fgetc(fd);	if (op[0] != 'I')	    GERB_COMPILE_ERROR("Step-and-repeat parameter error\n");	image->info->step_and_repeat_dist_X = gerb_fgetdouble(fd);	op[0] = gerb_fgetc(fd);	if (op[0] != 'J')	    GERB_COMPILE_ERROR("Step-and-repeat parameter error\n");	image->info->step_and_repeat_dist_Y = gerb_fgetdouble(fd);	if ((image->info->step_and_repeat_X != 1) || 	    (image->info->step_and_repeat_Y != 1) ||	    (fabs(image->info->step_and_repeat_dist_X) > 0.000001) ||	    (fabs(image->info->step_and_repeat_dist_Y) > 0.000001))	    NOT_IMPL(fd, "%SR%");	break;    case A2I('R','O'): /* Rotate */	NOT_IMPL(fd, "%RO%");	break;    default:	GERB_COMPILE_ERROR("Unknown extension found %%%c%c%%\n", op[0], op[1]);    }        return;} /* parse_rs274x */