customize the input for lex
Hi,
I cam across a piece of code to customize the input from where the characters are read by lex, the input() in many commonly used lex is a macro which is defined as
# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
in order to override this and customize, the following code has been used...
#undef input
#define input() buffer[index++];
Now my doubt is, does #undef input same as #undef input(), as we have already defined the macro input()...Hope you understood my question.
Thanks And Regards,
Vairavan.S
|