I am storing the arguments passed to main in yacc in a file. Now I want the lex to read its input from this file rather than the terminal. I know I can point yyin to a file
like yyin = fopen("fn","r");
but this works only when main is in lex. When I use this yyin declaration in main in yacc, it shows an error so please suggest something to overcome this problem.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…