Solved

LEX- How to handle EOF

Posted on 1997-11-10
2
556 Views
Last Modified: 2013-12-26
i want to pipe files to stdin of my lex-programm. Lex should give back a special token for the eof-charakter to the main-programm.
Is it possible, and how?
0
Comment
Question by:bodirsky
2 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 1295537
. if(yytext[0] == EOF) { .. }

BTW,
flex has a  <<EOF>> pattern  ;-)
0
 

Author Comment

by:bodirsky
ID: 1295538
When you pipe the output of 'tar' or 'more' etc. to the compiled lex-file, the programm will not detect the End of the Input this way.

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question