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 (2): Can awk...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 2211 of 2236
Post > Topic >>

Re (2): Can awk easily simulate an AFSM

by problems@[EMAIL PROTECTED] Mar 29, 2008 at 04:18 AM

> > Apparently my ideas of an AFSM compiler is closer to the 
> > table-driven compilers ?
> 
Jürgen Kahrs wrote:
> I wouldnt say it this way. I was only surprised
> that you would prefer the data-driven style.

If you've got a framework that can implement an AFSM, 
almost as simply as a spreadsheeet then you can experiment with
all kinds of utilities, like non-perfect translation from C-source to
pascal-family-source.  

Perhaps such an AFSM *can* more easily be implemented in
an existing spreadsheet ?!

> A data-driven implementation in canonic AWK may
> look like this:
> 
> BEGIN { state = "" }
> 
> state == ""   && /IF/     { state = "IF"   ; Encode(...) }
> state == "IF" && /ELSE/   { state = "ELSE" ; Encode(...) }

OK, does this mean:
IF (Presentstate=nil) & (NextToken="if") 
    THEN "IF" -> Presentstate; Encode(...) END
??

You see it's almost as verbose as my pseudo-code.
I prefer a data-driven approach, because it hides irrelevant information
better.  If you're stepping through a FSM-diagram you don't need to 
ask "what is the PresentState" because this info. is known, contained
in the like-program-counter.

IMO the whole idea of using a FSM approach is to hide the confusing
and irrelevant implementation details so that you can concentrate 
on the 'data'.

Thanks for feeedback,

== Chris Glur.




 1 Posts in Topic:
Re (2): Can awk easily simulate an AFSM
problems@[EMAIL PROTECTED  2008-03-29 04:18:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Wed May 14 13:05:03 CDT 2008.