2
votes

Flex provides a mechanism for creating and switching between multiple input buffers. An input buffer is created by using: yy_creat_buffer and gives the possibility to switch input stream by using yy_switch_buffer.

The problem is lex does not implement a solution like that.

you can find more in the Flex manual

1

1 Answers

1
votes

Unfortunately, there no similar solution in lex, and if any one knows one please please give it to us.

The only possibility is that you redefineyywrap(),which is called whenever Lex reaches an end-of-file.

In this case, you should provide a yywrap() which arranges for new input and returns 0. This instructs Lex to continue processing. The default yywrap always returns 1(no added input).