flex default rule
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > flex default rule




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    flex default rule  
Daniel Haude


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-04 11:34 AM

Hello,
I've written a simple lexer in flex that is supposed to pick only certain
parts of the input file and to ignore the (unmatched) rest. It works fine
except that it copies the unmatched stuff to stdout, as it's supposed
to. I got rid of that behavior by reassigning yyout appropriately, but I
was wondering if the "default rule" was somehow user accessible (meaning
that I'd like to write my own "action" for unmatched stuff instead of
automatically ECHOing to yyout).

Is this possible? Couldn't find anything in the docs.

Thanks,
--Daniel

--
"With me is nothing wrong! And with you?" (from r.a.m.p)





[ Post a follow-up to this message ]



    Re: flex default rule  
Nils O. Selåsdal


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-04 11:34 AM

On Mon, 26 Apr 2004 09:56:29 +0000, Daniel Haude wrote:

> Hello,
> I've written a simple lexer in flex that is supposed to pick only certain
> parts of the input file and to ignore the (unmatched) rest. It works fine
> except that it copies the unmatched stuff to stdout, as it's supposed
> to. I got rid of that behavior by reassigning yyout appropriately, but I
> was wondering if the "default rule" was somehow user accessible (meaning
> that I'd like to write my own "action" for unmatched stuff instead of
> automatically ECHOing to yyout).
>
> Is this possible? Couldn't find anything in the docs.
Isnt this usually done by adding a "catch-all"  rule that does nothing ?!
%%
your
rules
.       /* ignore anything else */

--
Nils Olav Selåsdal
System Engineer
w w w . u t e l s y s t e m s . c o m







[ Post a follow-up to this message ]



    Re: flex default rule  
Daniel Haude


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-27-04 10:33 AM

On Mon, 26 Apr 2004 12:22:52 +0200,
Nils O Selåsdal <NOS@Utel.no> wrote
in Msg. <pan.2004.04.26.10.22.51.911874@Utel.no>

> Isnt this usually done by adding a "catch-all"  rule that does nothing ?!
> %%
> your
> rules
> .       /* ignore anything else */

Of course. Stupid me. I knew this was a classic case along the lines of
not seeing the forest because of all the trees.

--Daniel

--
"With me is nothing wrong! And with you?" (from r.a.m.p)





[ Post a follow-up to this message ]



    Re: flex default rule  
Daniel Haude


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-27-04 10:33 AM

On 27 Apr 2004 09:34:11 GMT,
Daniel Haude <haude@physnet.uni-hamburg.de> wrote
in Msg. <slrnc8sa8j.cdk.haude@kir.physnet.uni-hamburg.de>

...but it's actually:

.|\n

"With me is nothing wrong! And with you?" (from r.a.m.p)





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:35 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register