LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-08-2006, 01:27 AM   #1
sam_cit
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Rep: Reputation: 0
regarding a lex sample program...


Hi,
I have the following program,

%%
[^ab]+ { printf("string is %s\n",yytext); }
. { ECHO ; printf("\n");}
%%
int main()
{
yylex();
return(0);
}

when i run it, and give the following input

111a222a333a444

i get the following output,

string is 111
a
string is 222
a
string is 333
a

and thats it... i don't understand why the last string of 444 is not prited, can anyone help me on this...

Thanks And Regards,
Vaairavan.S
 
Old 05-08-2006, 07:46 PM   #2
narc
Member
 
Registered: Aug 2004
Location: Montréal
Distribution: Linux from scratch
Posts: 68

Rep: Reputation: 15
Quote:
i get the following output,

string is 111
a
string is 222
a
string is 333
a
Which version / platform do you use ? I use flex 2.5.31, and I just ran your program without a hitch.

Code:
[me@lfs6 ~/lex_test]$ echo 111a222a333a444 | ./flex_test
1
1
1
string is a
2
2
2
string is a
3
3
3
string is a
4
4
4
Have you tried adding a white space after 444 and see what happens ? Maybe you can bring the issue to the maintainers of this particular program with such comparative results.

Cheers.
---
narc

Last edited by narc; 05-08-2006 at 07:49 PM.
 
Old 05-09-2006, 01:16 AM   #3
sam_cit
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Original Poster
Rep: Reputation: 0
no actually, ctrl+d is missing at the end of the string... thats why dude...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LEX and YACC with C gr33ndata Programming 4 11-18-2007 06:12 PM
customize the input for lex sam_cit Linux - Software 0 03-08-2006 05:36 AM
problem while compiling a lex program sam_cit Linux - Software 1 02-21-2006 04:59 AM
Sample "Hello World" Xwindows C++ program dogpatch Programming 1 12-02-2005 09:55 AM
flex your lex chens_83 Linux - General 2 06-02-2002 04:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration