diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-10-08 23:58:50 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-10-08 23:59:33 -0400 |
commit | dcf9840baea42559d1754fde498a8537e86c20a3 (patch) | |
tree | 21883a147c1eb749932f399a06d0467b706648a4 /minic | |
parent | 5d2609b1674bc1d55872392693bf7281f6a83acc (diff) | |
download | roux-dcf9840baea42559d1754fde498a8537e86c20a3.tar.gz |
uniformize naming in minic
Diffstat (limited to 'minic')
-rw-r--r-- | minic/minic.y | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/minic/minic.y b/minic/minic.y index 5222869..1e4ba8a 100644 --- a/minic/minic.y +++ b/minic/minic.y @@ -63,8 +63,8 @@ int yylex(void), yyerror(char *); Symb expr(Node *), lval(Node *); FILE *of; -int lbl, tmp, str; -char *slit[NStr]; +int lbl, tmp, nstr; +char *str[NStr]; struct { char v[NString]; unsigned ctyp; @@ -519,8 +519,8 @@ prog: prot '{' dcls stmts '}' stmt($4); fprintf(of, "\tret\n"); fprintf(of, "}\n\n"); - for (i = 0; i < str; i++) - fprintf(of, "data $str%d = \"%s\"\n", i, slit[i]); + for (i=0; i<nstr; i++) + fprintf(of, "data $str%d = \"%s\"\n", i, str[i]); }; prot: IDENT '(' ')' @@ -648,7 +648,7 @@ yylex() } if (c == '"') { - if (str == NStr) + if (nstr == NStr) die("too many string literals"); i = 0; n = 32; @@ -665,9 +665,9 @@ yylex() } p[i] = c; } - slit[str] = p; + str[nstr] = p; yylval.n = mknode('S', 0, 0); - yylval.n->u.n = str++; + yylval.n->u.n = nstr++; return STR; } |