[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



-- CHS


-----Forwarded Message-----

> From: Charles Shapiro <charles.shapiro at nubridges.com>
> To: jeffrey.b.layton at lmco.com, ale at ale.org
> Subject: Re: [ale] OT: Lex pattern expression struggles
> Date: 26 Oct 2004 15:41:51 -0400
> 
> Um, I thought (f)lex used regex.
> 
> So it'd be something like
> 
> [:alnum:]{1,8} * (PARAM)|(TABLE)|(UPDATE)  { return TOKEN_BLAH; }
> 
> Or you could just use make your token returner into a subroutine and
> call it from three separate flex triggers, as:
> 
> FIRSTPART [:alnum:]{1,8} *
> 
> {FIRSTPART}PARAM { return_mytok() }
> {FIRSTPART}TABLE { return_mytok() }
> {FIRSTPART}UPDATE { return_mytok() }
> %%
> int return_mytok()
> {
> 	return TOKEN_BLAH;
> }
> 
> Flex and bison are Way Cool. I did a project in 'em oncet just to play
&gt; with them. See <a  rel="nofollow" href="http://tomshiro.org/coldread/";>http://tomshiro.org/coldread/</a>
&gt; 
&gt; --CHS
&gt; 
&gt; 
&gt; On Tue, 2004-10-26 at 14:53, Jeff Layton wrote:
&gt; &gt; Howdy!
&gt; &gt; 
&gt; &gt;    I'm struggling with a pattern expression for lex. I'm looking
&gt; &gt; for an expression that handle an alphanumeric string of 1 to
&gt; &gt; 8 characters (only letters and numbers) followed by at least
&gt; &gt; one space and one of three keywords: &quot;PARAM&quot; &quot;TABLE&quot;
&gt; &gt; or &quot;UPDATE&quot;. I've tried several things with no success (I
&gt; &gt; won't post them due to embarassment). Anyone have any
&gt; &gt; suggestions?
&gt; &gt; 
&gt; &gt; Thanks!
&gt; &gt; 
&gt; &gt; Jeff


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00915.html">[ale] RPM command line help</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00917.html">[ale] Groupware (new)</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00951.html">[ale] RPM command line help</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00926.html">[Fwd: Re: [ale] OT: Lex pattern expression struggles]</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00916"><strong>Date</strong></a></li>
<li><a href="threads.html#00916"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>