;
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");
}
]?
{ while (count++ < maxoperand) {
- fputs(",{\"\",-1,\"\"}",genc);
+ fprintf(genc,"%c{\"\",-1,\"\"}",count == 1 ? ' ' : ',');
}
putc('}',genc);
+ putc('}',genc);
}
;
}
;
-operand
+operand(int c;)
{ register struct symtab *p = 0;} :
- { fputs(",{\"",genc);}
+ { fprintf(genc, "%c{\"", c);}
[
identifier
{ if (!p) {