Solved

LEX- How to handle EOF

Posted on 1997-11-10
2
565 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

688 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