Solved

LEX- How to handle EOF

Posted on 1997-11-10
2
548 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now