http://www.perlmonks.org?node_id=413226


in reply to Re: Are state machines just for parsing?
in thread Are state machines just for parsing?

Don't think so. See my reply below.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

  • Comment on Re^2: Are state machines just for parsing?

Replies are listed 'Best First'.
Re^3: Are state machines just for parsing?
by osunderdog (Deacon) on Dec 08, 2004 at 15:57 UTC

    To mis-quote a former US President:

    It depends on how you parse "Parse".

    In some sense receiving an event is very much like looking at the next character in a file. You either expect it or you don't. It all depends on what your language is.

    Someone pointed out FOLDOC eariler so here's a reference to Parser.


    "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.


    OSUnderdog

      Well, m-w defines parse as follows:

        1. : to resolve (as a sentence) into component parts of speech and describe them grammatically
        2. : to describe grammatically by stating the part of speech and explaining the inflection and syntactical relationships
      1. : to examine in a minute way : analyze critically [parses appellate court opinions]
      So to use 'parse' as the verb that means 'look at what actions are happening and respond in a certain manner' is being generous.

      I think this is a case where we'll have to agree to disagree.

      Alex / talexb / Toronto

      "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

        It's worth noting that your source doesn't even have an entry for the programming sense of "parse", and so seems an odd way to back up your argument. AHD's entry for "parse" (4 ed., via dictionary.com) contains:

        parse v. tr. ... 4. Computer Science: To analyze or separate (input, for example) into more easily processed components.

        That seems to encompass what Anonymonk described as "parsing" -- analyzing (TCP/IP) input into more easily processed components. It's still not in my lexicon with that broad a sense, though; my take is probably closer to M-W sense 1.1, without restricting the domain to { things that have "component parts of speech" } (i.e. the first M-W sense without limiting it to "natural" languages).

Re^3: Are state machines just for parsing?
by Anonymous Monk on Dec 09, 2004 at 15:05 UTC
    And your example differs from the TCP/IP state machine example in which way? Your example is doing what every other state machine does: it uses the current state and the current input to determine what the next state will be (that is, it's performing a "calculation"). Your example only strengthens my point.