some minor bug fixes
This commit is contained in:
@@ -16,16 +16,39 @@
|
||||
|
||||
extern char *symbol2str();
|
||||
extern struct idf *gen_anon_idf();
|
||||
extern int err_occurred;
|
||||
|
||||
LLmessage(tk)
|
||||
int tk;
|
||||
register int tk;
|
||||
{
|
||||
if (tk > 0) {
|
||||
/* if (tk > 0), it represents the token to be inserted.
|
||||
*/
|
||||
register struct token *dotp = ˙
|
||||
|
||||
error("%s missing", symbol2str(tk));
|
||||
insert_token(tk);
|
||||
|
||||
aside = *dotp;
|
||||
|
||||
dotp->tk_symb = tk;
|
||||
|
||||
switch (tk) {
|
||||
/* The operands need some body */
|
||||
case IDENT:
|
||||
dotp->TOK_IDF = gen_anon_idf();
|
||||
break;
|
||||
case STRING:
|
||||
dotp->tk_data.tk_str = (struct string *)
|
||||
Malloc(sizeof (struct string));
|
||||
dotp->TOK_SLE = 1;
|
||||
dotp->TOK_STR = Salloc("", 1);
|
||||
break;
|
||||
case INTEGER:
|
||||
dotp->TOK_INT = 1;
|
||||
break;
|
||||
case REAL:
|
||||
dotp->TOK_REL = Salloc("0.0", 4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (tk < 0) {
|
||||
error("garbage at end of program");
|
||||
@@ -33,31 +56,3 @@ LLmessage(tk)
|
||||
else error("%s deleted", symbol2str(dot.tk_symb));
|
||||
}
|
||||
|
||||
insert_token(tk)
|
||||
int tk;
|
||||
{
|
||||
register struct token *dotp = ˙
|
||||
|
||||
aside = *dotp;
|
||||
|
||||
dotp->tk_symb = tk;
|
||||
|
||||
switch (tk) {
|
||||
/* The operands need some body */
|
||||
case IDENT:
|
||||
dotp->TOK_IDF = gen_anon_idf();
|
||||
break;
|
||||
case STRING:
|
||||
dotp->tk_data.tk_str = (struct string *)
|
||||
Malloc(sizeof (struct string));
|
||||
dotp->TOK_SLE = 1;
|
||||
dotp->TOK_STR = Salloc("", 1);
|
||||
break;
|
||||
case INTEGER:
|
||||
dotp->TOK_INT = 1;
|
||||
break;
|
||||
case REAL:
|
||||
dotp->TOK_REL = Salloc("0.0", 4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user