From: ceriel Date: Wed, 25 Mar 1987 07:53:57 +0000 (+0000) Subject: Generated illegal initialization constants. X-Git-Tag: release-5-5~4349 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a0897e2ed36898ab4c643fb8f6c20db696d88b93;p=ack.git Generated illegal initialization constants. --- diff --git a/util/topgen/topgen.g b/util/topgen/topgen.g index 3f02ad12e..ae72d3bb1 100644 --- a/util/topgen/topgen.g +++ b/util/topgen/topgen.g @@ -200,22 +200,22 @@ instruction_list(int *n;) : ; instruction(int opt;) - { int count;} : + { int count = 0;} : opcode(opt) { if (strcmp(buf,"ANY") != 0) { - fprintf(genc,"\t{\"%s\"",buf); + fprintf(genc,"\t{\"%s\", {",buf); } - else fputs("\t{(char *) 0",genc); + else fputs("\t{(char *) 0, {",genc); count = 0; } [ - operand + operand(' ') { count = 1;} [ OPERAND_SEPARATOR { count++;} SPACE* - operand + operand(',') ]* { if (count > maxoperand) { error("Too many operands"); @@ -223,9 +223,10 @@ instruction(int opt;) } ]? { while (count++ < maxoperand) { - fputs(",{\"\",-1,\"\"}",genc); + fprintf(genc,"%c{\"\",-1,\"\"}",count == 1 ? ' ' : ','); } putc('}',genc); + putc('}',genc); } ; @@ -244,9 +245,9 @@ opcode(int opt;) } ; -operand +operand(int c;) { register struct symtab *p = 0;} : - { fputs(",{\"",genc);} + { fprintf(genc, "%c{\"", c);} [ identifier { if (!p) {