如何从 yacc 中的命令行参数解析?
当然,我在 lex 和 yacc 中都未定义输入,然后写了
int input(void)
{
printf("in input\n:");
char c;
if(target > limit)
return 0;
if((c = target[0][offset++]) != '\0')
return (c);
target++;
offset =0;
return (' ');
}
其中 target 包含命令行参数。但是只有标准输入正在执行如何使 dis 输入函数得到执行。