|
关于Basic程序解释器及编译原理的简单化(1)---Basic器的语法分析及主要代码(4) /* compute number of move to next tab */ spaces = 8-(len%8); len += spaces; /* add in the tabbing position */ while (spaces) { printf (" "); spaces--; } } else if (*token==';') { printf (" "); } else if (tok != EOL && tok != FINISHED) serror (0); } while (*token==';'*token==','); if (tok==EOLtok==FINISHED) { if (last_delim != ';' && last_delim != ',') printf ("\n"); } else serror(0); /* error is not, or ; */ } /* find all labels */ void scan_labels() { int addr; char *temp;
label_init(); /* zero all labels */ temp = prog; /* save poiter to top of program */ /* if the first token in the fike is a label */ get_token(); if (token_type==NUMBER) { strcpy (label_table[0].name,token); label_table[0].p=prog; }
|