Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Managing errors in flex
I have a flex scanner that has the following patterns (among others,
obviously):

<INITIAL>foo    BEGIN(state1);
<INITIAL>bar    BEGIN(state2);
<state1>token1  yylval.val = yytext; return TOK_TOKEN1;
<state2>token2  yylval.val = yytext; return TOK_TOKEN2;
<*><<EOF>>      yyterminate();
<*>.|\n         { char s[256];
sprintf(s,"Error at char '%s'\n",yytext);
error(s); }

What I do not understand is why that final rule never executes. I'm
using the "-s" option to flex, and getting "syntax error" instead of
my custom message from above.
[Most likely because <*> isn't a valid start state in any versioon of lex
I'm familiar with. -John]

Report this thread to moderator Post Follow-up to this message
Old Post
Aaron Sherman
09-22-04 08:59 AM


Re: Managing errors in flex
Hello!

Aaron Sherman <AaronJSherman@gmail.com> wrote:
>[...]

>[Most likely because <*> isn't a valid start state in any versioon of lex
>I'm familiar with. -John]

The flex manpage says:

<*>r      An `r' in any start condition, even an exclusive one.

Kind regards,

Hannah.
[Oh, look, you're right.  I've had a lot of trouble with flex start
states.  I think there are lurking bugs. -John]

Report this thread to moderator Post Follow-up to this message
Old Post
Hannah Schroeter
09-24-04 09:00 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Compilers archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:16 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.