[13779] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1189 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 27 22:32:39 1999

Date: Wed, 27 Oct 1999 19:32:22 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941077941-v9-i1189@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 27 Oct 1999     Volume: 9 Number: 1189

Today's topics:
        offtopic: DFA backreferences? <johnston.p@worldnet.att.net>
    Re: offtopic: DFA backreferences? (M.J.T. Guy)
    Re: offtopic: DFA backreferences? (Tad McClellan)
    Re: offtopic: DFA backreferences? (Abigail)
    Re: offtopic: DFA backreferences? (Abigail)
    Re: offtopic: DFA backreferences? <johnston.p@worldnet.att.net>
    Re: offtopic: DFA backreferences? <cassell@mail.cor.epa.gov>
    Re: offtopic: DFA backreferences? (Bart Lateur)
    Re: offtopic: DFA backreferences? <kbandes@home.com>
    Re: offtopic: DFA backreferences? (Tad McClellan)
    Re: offtopic: DFA backreferences? <lr@hpl.hp.com>
    Re: offtopic: DFA backreferences? <kbandes@home.com>
    Re: offtopic: DFA backreferences? (Bart Lateur)
    Re: offtopic: DFA backreferences? (Abigail)
    Re: offtopic: DFA backreferences? <kbandes@home.com>
    Re: offtopic: DFA backreferences? (Tad McClellan)
    Re: offtopic: DFA backreferences? <kbandes@home.com>
    Re: offtopic: DFA backreferences? <kbandes@home.com>
    Re: offtopic: DFA backreferences? <cassell@mail.cor.epa.gov>
    Re: Oh god! Not another Net::ftp question! <ralawrence@my-deja.com>
        Pallel Port with Perl on Win98 (Olaf Kaul)
    Re: Pallel Port with Perl on Win98 (Brett W. McCoy)
    Re: Pallel Port with Perl on Win98 (Brett W. McCoy)
        Passing object reference? <groberts@itc.com.au>
    Re: Passing object reference? <rootbeer@redcat.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 25 Oct 1999 17:27:38 -0700
From: "Paul Johnston" <johnston.p@worldnet.att.net>
Subject: offtopic: DFA backreferences?
Message-Id: <7v2s66$no3$1@bgtnsc01.worldnet.att.net>

Howdy.  I've just finished reading "Mastering Regular Expressions" (Friedl),
and I'm struggling with a certain concept, which is:

what _is it_ about the theory and or implementation of a DFA that excludes
the notion of backreferences?

This is not really a Perl question, but I figured the Perl community is
probably the best resource for tapping those regex aficionados that
understand this kind of thing (which I do not!).  If there is a better
forum, please let me know...

I fear it will affect my sleep patterns if I cannot figure this out.  Your
knowledge is greatly appreciated,

--Paul




------------------------------

Date: 27 Oct 1999 17:07:21 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: offtopic: DFA backreferences?
Message-Id: <7v7bg9$guj$1@pegasus.csx.cam.ac.uk>

Tad McClellan <tadmc@metronet.com> wrote:
>
>   From:  http://www.lysator.liu.se/hackdict/split/dragon_book.html
>
>--------------------------------------
>Dragon Book n. The classic text "Compilers Principles, Techniques and Tools",
>by Alfred V. Aho, Ravi Sethi,
>and Jeffrey D. Ullman (Addison-Wesley 1986; ISBN 0-201-10088-6), so 
>called because of the cover design featuring
>a dragon labeled `complexity of compiler design' and a knight bearing 
>the lance `LALR parser generator' among his
>other trappings. This one is more specifically known as the `Red Dragon Book'
>(1986); an earlier edition, sans Sethi and
>titled "Principles Of Compiler Design" (Alfred V. Aho and Jeffrey D. Ullman;
>Addison-Wesley, 1977; ISBN
>0-201-00022-9), was the `Green Dragon Book' (1977). (Also `New Dragon Book',
>`Old Dragon Book'.) The horsed
>knight and the Green Dragon were warily eying each other at a distance;
>now the knight is typing (wearing gauntlets!)
>at a terminal showing a video-game representation of the Red Dragon's
>head while the rest of the beast extends back in
>normal space. See also {booktitles} . 
>--------------------------------------

That fails to mention an important feature of the cover  -  the front
did indeed show a knight attacking a dragon, but on the back, we
see the same knight ... and windmills.

I wonder why it's never referred to as the Windmill book.   :-)


Mike Guy


------------------------------

Date: Wed, 27 Oct 1999 04:20:15 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: offtopic: DFA backreferences?
Message-Id: <vjc6v7.86d.ln@magna.metronet.com>

Paul Johnston (johnston.p@worldnet.att.net) wrote:
: >Paul Johnston (johnston.p@worldnet.att.net) wrote:
: >: Howdy.  I've just finished reading "Mastering Regular Expressions"
: (Friedl),
: >: and I'm struggling with a certain concept, which is:
: >
: >: what _is it_ about the theory and or implementation of a DFA that
: excludes
: >: the notion of backreferences?

: >Short version:
: >
: >
: >   The _definition_ of Regular Grammars (the class of languages
: >   parseable by a FSA) excludes memory, such as backreferences.
: >


: Hmm, I see.  But why? 


   Classification helps humans cope with complexity.

   Once you know that something falls into a "class", then you
   can apply all of the things that you know about that class
   to the "something".


: It seems strange to me that a grammar classification
: ("Regular Grammars") would be predicated on what appears to me as an
: implementation detail (memory).  


   It is predicated on the assumptions that are integral to the
   mathematical proofs of the properties of Regular Grammars.

   It is not an implementation detail. It is a property of a
   grammar. If it has the "memory" property, then it does
   not fall into the "Regular Grammar class".

   So you cannot assume the properties associated with a Regular
   Grammar. You can only assume the properties associated with
   a Context Free Grammar, which are different properties of course.


: In other words, it seems that the
: classification is not really based on some total mathematical abstraction,
: which is what I guess I would expect it to be.  OR, I could also imagine
: that the definition &| mathematics of regular grammars was influenced by the
: state of hardware and software at the time (ie an "FSA" was built and the
: definition/math grew out of it's behavior).

: The next step I would take in my mind, then, is that a FSA is not an
: abstract concept, but a well-defined "thing".  Is this right?  


   Er, roughly, yes.

   Regular Grammars are well-defined, they have a _formal_
   mathematical definition.


: This may
: sound ridiculous to those that have been thinking about this stuff for
: years...


   You are insightful  :-)


: <snip/>

: >
: >      "Compilers Principles, Techniques and Tools",
: >
: >      by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman
: >
: >      (Addison-Wesley 1986; ISBN 0-201-10088-6)
: >

: Yes I have this book, bought it a month ago or so...  But I'll admit right
: away that it's not easy parsing.  But it feels like the book is written
: under the assumption that you also attended the lectures.  I never took the
: class, so....


   Grammars fall into the area of Set Theory.

   Grokking them can be Very Hard if you do not know set theory.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: 27 Oct 1999 00:08:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: offtopic: DFA backreferences?
Message-Id: <slrn81d25l.bjj.abigail@alexandra.delanet.com>

Larry Rosler (lr@hpl.hp.com) wrote on MMCCXLVII September MCMXCIII in
<URL:news:MPG.127f7ad05953920898a12d@nntp.hpl.hp.com>:
// In article <3818a3aa.1004578@news.skynet.be> on Tue, 26 Oct 1999 
// 12:52:11 GMT, Bart Lateur <bart.lateur@skynet.be> says...
// > Kenneth Bandes wrote:
// > 
// > >>       "Compilers Principles, Techniques and Tools",
// > >> 
// > >>       by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman
// > >
// > >That's the new Dragon Book.  The old Dragon Book was just
// > >Aho and Ullman.
// > 
// > What do you mean, "new"? My copy looks like it's printed in 1986, and
// > Sethi is mentioned as an author.
// 
// Side by side on my bookshelf:
// 
// Aho and Ullman, 'Principles of Compiler Design', 1977 (aka The Green 
// Dragon)
// 
// Aho, Sethi and Ullman, 'Compilers: Principles, Techniques, and Tools', 
// 1986 (aka The Red Dragon)
// 
// Two different books, not two editions of the same book.


And let's not forget:

   Hopcroft and Ullman: "Introduction to Automata Theory, Languages
   and Computation", 1979, aka "The Cindarella Book".


Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 27 Oct 1999 00:14:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: offtopic: DFA backreferences?
Message-Id: <slrn81d2hg.bjj.abigail@alexandra.delanet.com>

Bart Lateur (bart.lateur@skynet.be) wrote on MMCCXLVII September MCMXCIII
in <URL:news:3817f911.1893814@news.skynet.be>:
!! Kenneth Bandes wrote:
!! 
!! >> What do you mean, "new"? My copy looks like it's printed in 1986, and
!! >> Sethi is mentioned as an author.
!! >
!! >Right, that's the new one.
!! 
!! I wouldn't think it's unlikely that some posters in this newsgroup
!! weren't even born in 1986. Calling this a "new book" shows your age. :-)


It just means it was written at the same time I was studying compiler
theory at university.... I'd say it's quite new then. ;-)



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Tue, 26 Oct 1999 19:16:18 -0700
From: "Paul Johnston" <johnston.p@worldnet.att.net>
Subject: Re: offtopic: DFA backreferences?
Message-Id: <7v5mtp$b0g$1@bgtnsc01.worldnet.att.net>

>Paul Johnston (johnston.p@worldnet.att.net) wrote:
>: Howdy.  I've just finished reading "Mastering Regular Expressions"
(Friedl),
>: and I'm struggling with a certain concept, which is:
>
>: what _is it_ about the theory and or implementation of a DFA that
excludes
>: the notion of backreferences?

>Short version:
>
>
>   The _definition_ of Regular Grammars (the class of languages
>   parseable by a FSA) excludes memory, such as backreferences.
>


Hmm, I see.  But why? It seems strange to me that a grammar classification
("Regular Grammars") would be predicated on what appears to me as an
implementation detail (memory).  In other words, it seems that the
classification is not really based on some total mathematical abstraction,
which is what I guess I would expect it to be.  OR, I could also imagine
that the definition &| mathematics of regular grammars was influenced by the
state of hardware and software at the time (ie an "FSA" was built and the
definition/math grew out of it's behavior).

The next step I would take in my mind, then, is that a FSA is not an
abstract concept, but a well-defined "thing".  Is this right?  This may
sound ridiculous to those that have been thinking about this stuff for
years...


>   The next "step up", Context Free Grammars, requires different
>   mathematical shenanigans.
>
>   Perl's regular expressions are not Regular Expressions (that is,
>   they do not recognize a Regular Grammar).
>
>   (well they do, since Regular Grammars are subsumed by Context
>    Free Grammars
>   )
>
>
>Long version:
>


<snip/>

>
>      "Compilers Principles, Techniques and Tools",
>
>      by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman
>
>      (Addison-Wesley 1986; ISBN 0-201-10088-6)
>

Yes I have this book, bought it a month ago or so...  But I'll admit right
away that it's not easy parsing.  But it feels like the book is written
under the assumption that you also attended the lectures.  I never took the
class, so....


I appreciate the replies from everyone (Kenneth, Abigail, Tad, Bart, Larry ,
David, Markus) ...

Paul
>
>--
>    Tad McClellan                          SGML Consulting
>    tadmc@metronet.com                     Perl programming
>    Fort Worth, Texas




------------------------------

Date: Tue, 26 Oct 1999 16:45:21 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: offtopic: DFA backreferences?
Message-Id: <38163D11.2193725B@mail.cor.epa.gov>

Bart Lateur wrote:
> 
> Kenneth Bandes wrote:
> 
> >> What do you mean, "new"? My copy looks like it's printed in 1986, and
> >> Sethi is mentioned as an author.
> >
> >Right, that's the new one.
> 
> I wouldn't think it's unlikely that some posters in this newsgroup
> weren't even born in 1986. Calling this a "new book" shows your age. :-)

Yeah, I imagine that when that book was published, Jeff Pinyan
wasn't in kindergarten yet.  Man, this is making me feel old.

"I recall way back when Atanasoff came to me and said, 'Dave old pal,
do ya really think this pile of hardware can invert a *general*
9-by-9 matrix?'"  :-)

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: Tue, 26 Oct 1999 18:56:08 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: offtopic: DFA backreferences?
Message-Id: <3817f911.1893814@news.skynet.be>

Kenneth Bandes wrote:

>> What do you mean, "new"? My copy looks like it's printed in 1986, and
>> Sethi is mentioned as an author.
>
>Right, that's the new one.

I wouldn't think it's unlikely that some posters in this newsgroup
weren't even born in 1986. Calling this a "new book" shows your age. :-)

-- 
	Bart.


------------------------------

Date: Tue, 26 Oct 1999 13:14:46 -0400
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: offtopic: DFA backreferences?
Message-Id: <3815E186.F4FB89F2@home.com>

Bart Lateur wrote:
> >>       "Compilers Principles, Techniques and Tools",
> >>
> >>       by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman
> >
> >That's the new Dragon Book.  The old Dragon Book was just
> >Aho and Ullman.
> 
> What do you mean, "new"? My copy looks like it's printed in 1986, and
> Sethi is mentioned as an author.

Right, that's the new one.  This is from the Addison-Wesley site:
"This introduction to compilers is the direct descendant of the 
well-known book by Aho and Ullman, Principles of Compiler Design."

Ken Bandes


------------------------------

Date: Tue, 26 Oct 1999 06:54:24 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: offtopic: DFA backreferences?
Message-Id: <0914v7.6ia.ln@magna.metronet.com>

Bart Lateur (bart.lateur@skynet.be) wrote:
: Kenneth Bandes wrote:

: >>       "Compilers Principles, Techniques and Tools",
: >> 
: >>       by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman
: >
: >That's the new Dragon Book.  The old Dragon Book was just
: >Aho and Ullman.

: What do you mean, "new"? My copy looks like it's printed in 1986, and
: Sethi is mentioned as an author.


   From:  http://www.lysator.liu.se/hackdict/split/dragon_book.html


--------------------------------------
Dragon Book n. The classic text "Compilers Principles, Techniques and Tools",
by Alfred V. Aho, Ravi Sethi,
and Jeffrey D. Ullman (Addison-Wesley 1986; ISBN 0-201-10088-6), so 
called because of the cover design featuring
a dragon labeled `complexity of compiler design' and a knight bearing 
the lance `LALR parser generator' among his
other trappings. This one is more specifically known as the `Red Dragon Book'
(1986); an earlier edition, sans Sethi and
titled "Principles Of Compiler Design" (Alfred V. Aho and Jeffrey D. Ullman;
Addison-Wesley, 1977; ISBN
0-201-00022-9), was the `Green Dragon Book' (1977). (Also `New Dragon Book',
`Old Dragon Book'.) The horsed
knight and the Green Dragon were warily eying each other at a distance;
now the knight is typing (wearing gauntlets!)
at a terminal showing a video-game representation of the Red Dragon's
head while the rest of the beast extends back in
normal space. See also {booktitles} . 
--------------------------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 26 Oct 1999 09:46:48 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: offtopic: DFA backreferences?
Message-Id: <MPG.127f7ad05953920898a12d@nntp.hpl.hp.com>

In article <3818a3aa.1004578@news.skynet.be> on Tue, 26 Oct 1999 
12:52:11 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Kenneth Bandes wrote:
> 
> >>       "Compilers Principles, Techniques and Tools",
> >> 
> >>       by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman
> >
> >That's the new Dragon Book.  The old Dragon Book was just
> >Aho and Ullman.
> 
> What do you mean, "new"? My copy looks like it's printed in 1986, and
> Sethi is mentioned as an author.

Side by side on my bookshelf:

Aho and Ullman, 'Principles of Compiler Design', 1977 (aka The Green 
Dragon)

Aho, Sethi and Ullman, 'Compilers: Principles, Techniques, and Tools', 
1986 (aka The Red Dragon)

Two different books, not two editions of the same book.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Tue, 26 Oct 1999 12:11:29 GMT
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: offtopic: DFA backreferences?
Message-Id: <38159ADF.91C97B11@home.com>

Tad McClellan wrote:
>    Way before the "Camel Book" was the "Dragon Book".
> 
>    See if your library has it.
> 
>       "Compilers Principles, Techniques and Tools",
> 
>       by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman

That's the new Dragon Book.  The old Dragon Book was just
Aho and Ullman.

Ken Bandes


------------------------------

Date: Tue, 26 Oct 1999 12:52:11 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: offtopic: DFA backreferences?
Message-Id: <3818a3aa.1004578@news.skynet.be>

Kenneth Bandes wrote:

>>       "Compilers Principles, Techniques and Tools",
>> 
>>       by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman
>
>That's the new Dragon Book.  The old Dragon Book was just
>Aho and Ullman.

What do you mean, "new"? My copy looks like it's printed in 1986, and
Sethi is mentioned as an author.

-- 
	Bart.


------------------------------

Date: 26 Oct 1999 03:55:08 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: offtopic: DFA backreferences?
Message-Id: <slrn81ar2i.fji.abigail@alexandra.delanet.com>

Kenneth Bandes (kbandes@home.com) wrote on MMCCXLVII September MCMXCIII
in <URL:news:3814FD40.5EE0D5A8@home.com>:
 .. Paul Johnston wrote:
 .. > 
 .. > Howdy.  I've just finished reading "Mastering Regular Expressions" (Friedl),
 .. > and I'm struggling with a certain concept, which is:
 .. > 
 .. > what _is it_ about the theory and or implementation of a DFA that excludes
 .. > the notion of backreferences?
 .. 
 .. The only thing a DFA knows at any given moment is its current state
 .. and the next input token (and of course its definition).  That
 .. means the only memory it has is in its state.  A backreference would
 .. require it to save additional information.  That's fine but it's not
 .. a DFA any more.  


True, but the same holds for an NFA. After all, they are equivalent.... ;-)



Abigail
-- 
$_ = "\x3C\x3C\x45\x4F\x54";
print if s/<<EOT/<<EOT/e;
Just another Perl Hacker
EOT


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Tue, 26 Oct 1999 11:35:14 GMT
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: offtopic: DFA backreferences?
Message-Id: <38159260.B80E6933@home.com>

Abigail wrote:
> .. The only thing a DFA knows at any given moment is its current state
> .. and the next input token (and of course its definition).  That
> .. means the only memory it has is in its state.  A backreference would
> .. require it to save additional information.  That's fine but it's not
> .. a DFA any more.
> 
> True, but the same holds for an NFA. After all, they are equivalent.... ;-)

Right, I should have just said it isn't a finite state machine any more.

Ken Bandes


------------------------------

Date: Mon, 25 Oct 1999 21:07:54 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: offtopic: DFA backreferences?
Message-Id: <atu2v7.2u8.ln@magna.metronet.com>

Paul Johnston (johnston.p@worldnet.att.net) wrote:
: Howdy.  I've just finished reading "Mastering Regular Expressions" (Friedl),
: and I'm struggling with a certain concept, which is:

: what _is it_ about the theory and or implementation of a DFA that excludes
: the notion of backreferences?

Short version:

   The _definition_ of Regular Grammars (the class of languages
   parseable by a FSA) excludes memory, such as backreferences.

   The next "step up", Context Free Grammars, requires different
   mathematical shenanigans.

   Perl's regular expressions are not Regular Expressions (that is,
   they do not recognize a Regular Grammar).

   (well they do, since Regular Grammars are subsumed by Context
    Free Grammars
   )


Long version:

   There are 4 "levels" of grammars, called the Chomsky hierarchy.

   Each level is a superset of the lower levels.

   Regular Grammars are the lowest of these levels, the least 
   powerful and the easiest to parse.

   Regular Expressions can be written to match any Regular Grammar.

   Finite State Automata (FSA), both deterministic (DFA) and not (NFA),
   are equivalent to a Regular Expression (you can translate back and
   forth between them).

   Those loosely-stated facts above "fall out" of the mathematical
   proofs that are based on the properties of a Regular Grammar.

   If you don't have those properties, then you can not say
   as much.



: This is not really a Perl question, but I figured the Perl community is
: probably the best resource for tapping those regex aficionados that
: understand this kind of thing (which I do not!).  If there is a better
: forum, please let me know...


   I haven't been there in a few years, but grammars and such
   are probably still being discussed on:  comp.compilers


: I fear it will affect my sleep patterns if I cannot figure this out.  Your
: knowledge is greatly appreciated,



   Way before the "Camel Book" was the "Dragon Book".

   See if your library has it.


      "Compilers Principles, Techniques and Tools", 

      by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman 

      (Addison-Wesley 1986; ISBN 0-201-10088-6)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 26 Oct 1999 02:16:09 GMT
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: offtopic: DFA backreferences?
Message-Id: <38150F53.2D8A2DEA@home.com>

Kenneth Bandes wrote:
> Paul Johnston wrote:
[...]
> > what _is it_ about the theory and or implementation of a DFA that excludes
> > the notion of backreferences?
[...]
> A lot of parsing work (especially of natural
> languages) has been done in terms of various extensions to the
> transition network, such as RTNs (Recursive Transition Networks) and
> ATNs (Augmented Transition Networks, due, I believe, to Terry
> Winograd).

Oops, it was W.A. Woods.

Ken Bandes


------------------------------

Date: Tue, 26 Oct 1999 00:59:03 GMT
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: offtopic: DFA backreferences?
Message-Id: <3814FD40.5EE0D5A8@home.com>

Paul Johnston wrote:
> 
> Howdy.  I've just finished reading "Mastering Regular Expressions" (Friedl),
> and I'm struggling with a certain concept, which is:
> 
> what _is it_ about the theory and or implementation of a DFA that excludes
> the notion of backreferences?

The only thing a DFA knows at any given moment is its current state
and the next input token (and of course its definition).  That
means the only memory it has is in its state.  A backreference would
require it to save additional information.  That's fine but it's not
a DFA any more.  

A finite state machine such as a DFA can be represented as a
transition network.  A lot of parsing work (especially of natural 
languages) has been done in terms of various extensions to the
transition network, such as RTNs (Recursive Transition Networks) and
ATNs (Augmented Transition Networks, due, I believe, to Terry
Winograd).  By adding stacks, "registers", and so forth to the
basic state transition formalism, these can parse complex nested
structures such as sentences.

Ken Bandes


------------------------------

Date: Wed, 27 Oct 1999 15:56:43 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: offtopic: DFA backreferences?
Message-Id: <3817832B.6A1E3D69@mail.cor.epa.gov>

Paul Johnston wrote:
[attribution lost, but not by me!  Was it Tad?]
> >Short version:
> >
> >   The _definition_ of Regular Grammars (the class of languages
> >   parseable by a FSA) excludes memory, such as backreferences.
> 
> Hmm, I see.  But why? It seems strange to me that a grammar classification
> ("Regular Grammars") would be predicated on what appears to me as an
> implementation detail (memory).  In other words, it seems that the
> classification is not really based on some total mathematical abstraction,
> which is what I guess I would expect it to be.

The point is somewhat obscure here, but the 'memory' issue
is actually a mathematical constraint, not the physical
implementation red-herring.  Processes which do not require
the dragging along of memory of previous states have some
very nice ergodic properties which permit mathematicians
and statisticians to make other people's brains hurt.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: Mon, 25 Oct 1999 12:51:34 GMT
From: Richard Lawrence <ralawrence@my-deja.com>
Subject: Re: Oh god! Not another Net::ftp question!
Message-Id: <7v1jol$1a0$1@nnrp1.deja.com>

In article <7uvshq$c2t$0@dosa.alt.net>,
  kherron@sgum.mci.com (Kenneth Herron) wrote:

> It may be that $@ is set for other commands as well, but if the fact
> isn't documented, Net:FTP might as well not bother.  The *documented*
> Net::FTP API doesn't include a way for the programmer to access server
> responses.

I wrote to Graham Barr and got this reply:

"Well if you entered a bad username/password then the login()
method would return a false value. If the server accepted it then
it would return true. This is in the documentation.

But if you want to see the code that was returned or the message
then you need the code() or message() methods. Net::FTP inherits
these from Net::Cmd, this is also in the documentation."

So basically use Net::Cmd and you can check the reponses and code using
the relevant methods.

But I agree, this is not made clear in the Net::FTP documentation.

Rich


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Wed, 27 Oct 1999 15:03:42 GMT
From: olaf.kaul@rz-online.de (Olaf Kaul)
Subject: Pallel Port with Perl on Win98
Message-Id: <381712f6.3145452@news.rhein-zeitung.de>

Hi,

How can I set the parallel port with Perl under win98.
I like to connect a stepper motor to the Port and control the motor.

so long Olaf


------------------------------

Date: Wed, 27 Oct 1999 17:37:51 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Pallel Port with Perl on Win98
Message-Id: <slrn81eech.at0.bmccoy@moebius.foiservices.com>

Also Sprach Olaf Kaul <olaf.kaul@rz-online.de>:

>How can I set the parallel port with Perl under win98.
>I like to connect a stepper motor to the Port and control the motor.

Yikes!  Perl has an implementation of the ioctl function call, but whether
this works under Windows 98 is another story, since ioctl is a Unix system
call with a rather large list of different flags that can be sent to a
rather large number of devices.  It listed as one of the unimplemented
functions in ActiveState, though, so it may just work.

-- 
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


------------------------------

Date: Wed, 27 Oct 1999 17:40:04 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Pallel Port with Perl on Win98
Message-Id: <slrn81eegn.at0.bmccoy@moebius.foiservices.com>

Also Sprach Brett W. McCoy <bmccoy@foiservices.com>:

>Also Sprach Olaf Kaul <olaf.kaul@rz-online.de>:
>
>>How can I set the parallel port with Perl under win98.
>>I like to connect a stepper motor to the Port and control the motor.
>
>Yikes!  Perl has an implementation of the ioctl function call, but whether
>this works under Windows 98 is another story, since ioctl is a Unix system
>call with a rather large list of different flags that can be sent to a
>rather large number of devices.  It listed as one of the unimplemented
>functions in ActiveState, though, so it may just work.

I typed that wrong, dammit!  It is NOT listed as being unimplemented in
ActiveState Perl.

-- 
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


------------------------------

Date: Wed, 27 Oct 1999 11:08:54 +1000
From: Geoff Roberts <groberts@itc.com.au>
Subject: Passing object reference?
Message-Id: <381650A6.1ABBF562@itc.com.au>

Hi,

   I would like to pass an object to a subroutine.   How can I go about
doing this?   I would also like to be able to pass a reference to an
object into another package as well.

   Thanks

   Geoff

Example
=======
   ...
   my $myCGI = new CGI;

   ...
   &CallAFunc($myCGI);

OR
   MyPackage::CallAFunc($myCGI);

-----

   sub CallAFunc
   {
      my $localCGI = ???;

      $localCGI->Tr(.....);

      ...

   }


------------------------------

Date: Tue, 26 Oct 1999 21:02:05 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Passing object reference?
Message-Id: <Pine.GSO.4.10.9910262057510.29843-100000@user2.teleport.com>

On Wed, 27 Oct 1999, Geoff Roberts wrote:

>    I would like to pass an object to a subroutine.  How can I go about
> doing this?

Objects in perl are references; references are scalars. Pass the object's
reference as you would pass the number 7 or the word 'seven'.

> I would also like to be able to pass a reference to an
> object into another package as well.

You can't pass anything into a package. Maybe you're thinking of modules.
If so, you're still wrong. :-)

>    my $myCGI = new CGI;

You shouldn't be using objects here. There's a perfectly good
non-object-oriented interface to the CGI module, and (almost certainly)
there's no reason to write $myCGI->p() when you could be writing p()
instead.

>    &CallAFunc($myCGI);
> 
> OR
>    MyPackage::CallAFunc($myCGI);

But these should do what you're asking. What happened when you tried them?

>    sub CallAFunc
>    {
>       my $localCGI = ???;

You want 'shift' in there.

>       $localCGI->Tr(.....);

If, of course, you need the OO interface at all. Just say NoOO!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 1189
**************************************


home help back first fref pref prev next nref lref last post