Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: Re (2): Can...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 7 Topic 2193 of 2236
Post > Topic >>

Re: Re (2): Can awk easily simulate an AFSM

by =?ISO-8859-1?Q?J=FCrgen_Kahrs?= <Juergen.KahrsDELETETHIS@[EMAIL PROTECTED] Mar 18, 2008 at 07:35 PM

problems@[EMAIL PROTECTED]
 wrote:

> OK, apparently "Encode" is the code generation.
> Since I haven't worked with my stuff for many years,
> I only now realise that awk would give me a program
> driven implementation, rather than a data-driven AFSM,
> which is what I want.

AWK can do both. The example I gave was
an implementation similar to C style.
If you really want it data-driven, you
can have it in AWK (few users prefer this
style).

> Apparently I need first to get familiar with *nix regex to
> clean-up my fetched texts ?

It helps, but you can also get along without
too much regexp if you want.

> Apparently my ideas of an AFSM compiler is closer to the 
> table-driven compilers ?

I wouldnt say it this way. I was only surprised
that you would prefer the data-driven style.
A data-driven implementation in canonic AWK may
look like this:

BEGIN { state = "" }

state == ""   && /IF/     { state = "IF"   ; Encode(...) }
state == "IF" && /ELSE/   { state = "ELSE" ; Encode(...) }




 7 Posts in Topic:
Can awk easily simulate an AFSM
problems@[EMAIL PROTECTED  2008-03-16 11:51:49 
Re: Can awk easily simulate an AFSM
=?ISO-8859-1?Q?J=FCrgen_K  2008-03-16 20:24:41 
Re: Can awk easily simulate an AFSM
Janis Papanagnou <Jani  2008-03-18 04:00:05 
Re (2): Can awk easily simulate an AFSM
problems@[EMAIL PROTECTED  2008-03-18 05:46:17 
Re: Re (2): Can awk easily simulate an AFSM
=?ISO-8859-1?Q?J=FCrgen_K  2008-03-18 19:35:53 
Re (3): Can awk easily simulate an AFSM
problems@[EMAIL PROTECTED  2008-03-20 06:02:39 
Re: Re (3): Can awk easily simulate an AFSM
=?ISO-8859-1?Q?J=FCrgen_K  2008-03-20 20:28:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 1:05:31 CDT 2008.