Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #22863 > unrolled thread

regexp(ing) Backus-Naurish expressions ...

Started byqwertmonkey@syberianoutpost.ru
First post2013-03-10 02:27 +0000
Last post2013-03-10 11:16 -0700
Articles 5 on this page of 25 — 10 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  regexp(ing) Backus-Naurish expressions ... qwertmonkey@syberianoutpost.ru - 2013-03-10 02:27 +0000
    Re: regexp(ing) Backus-Naurish expressions ... Arne Vajhøj <arne@vajhoej.dk> - 2013-03-09 21:33 -0500
    Re: regexp(ing) Backus-Naurish expressions ... Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-03-09 21:00 -0600
    Re: regexp(ing) Backus-Naurish expressions ... Leif Roar Moldskred <leifm@dimnakorr.com> - 2013-03-09 23:33 -0600
    Re: regexp(ing) Backus-Naurish expressions ... lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-10 10:27 +0000
    Re: regexp(ing) Backus-Naurish expressions ... Martin Gregorie <martin@address-in-sig.invalid> - 2013-03-10 12:55 +0000
    Re: regexp(ing) Backus-Naurish expressions ... Roedy Green <see_website@mindprod.com.invalid> - 2013-03-10 07:57 -0700
      Re: regexp(ing) Backus-Naurish expressions ... Robert Klemme <shortcutter@googlemail.com> - 2013-03-10 22:39 +0100
        Re: regexp(ing) Backus-Naurish expressions ... Roedy Green <see_website@mindprod.com.invalid> - 2013-03-10 15:54 -0700
          Re: regexp(ing) Backus-Naurish expressions ... Robert Klemme <shortcutter@googlemail.com> - 2013-03-11 21:03 +0100
          Re: regexp(ing) Backus-Naurish expressions ... Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-03-11 17:00 -0500
            Re: regexp(ing) Backus-Naurish expressions ... Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-03-11 18:31 -0400
              Re: regexp(ing) Backus-Naurish expressions ... Arne Vajhøj <arne@vajhoej.dk> - 2013-03-11 18:40 -0400
                Re: regexp(ing) Backus-Naurish expressions ... Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-03-11 21:39 -0400
            Re: regexp(ing) Backus-Naurish expressions ... Martin Gregorie <martin@address-in-sig.invalid> - 2013-03-11 23:06 +0000
            Re: regexp(ing) Backus-Naurish expressions ... Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-03-11 20:56 -0500
              Re: regexp(ing) Backus-Naurish expressions ... Arne Vajhøj <arne@vajhoej.dk> - 2013-03-11 22:06 -0400
              Re: regexp(ing) Backus-Naurish expressions ... Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-03-12 09:30 -0400
        Re: regexp(ing) Backus-Naurish expressions ... Roedy Green <see_website@mindprod.com.invalid> - 2013-03-10 16:24 -0700
          Re: regexp(ing) Backus-Naurish expressions ... Robert Klemme <shortcutter@googlemail.com> - 2013-03-11 21:08 +0100
            Re: regexp(ing) Backus-Naurish expressions ... Arne Vajhøj <arne@vajhoej.dk> - 2013-03-11 16:59 -0400
              Re: regexp(ing) Backus-Naurish expressions ... Robert Klemme <shortcutter@googlemail.com> - 2013-03-11 22:24 +0100
        Re: regexp(ing) Backus-Naurish expressions ... Robert Klemme <shortcutter@googlemail.com> - 2013-03-11 21:00 +0100
      Re: regexp(ing) Backus-Naurish expressions ... Robert Klemme <shortcutter@googlemail.com> - 2013-03-13 08:07 +0100
    Re: regexp(ing) Backus-Naurish expressions ... markspace <markspace@nospam.nospam> - 2013-03-10 11:16 -0700

Page 2 of 2 — ← Prev page 1 [2]


#22895

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-03-11 16:59 -0400
Message-ID<513e45ce$0$32107$14726298@news.sunsite.dk>
In reply to#22893
On 3/11/2013 4:08 PM, Robert Klemme wrote:
> On 11.03.2013 00:24, Roedy Green wrote:
>> On Sun, 10 Mar 2013 22:39:22 +0100, Robert Klemme
>> <shortcutter@googlemail.com> wrote, quoted or indirectly quoted
>> someone who said :
>>
>>> What limitations would make me want to write a FSM instead by hand?
>>
>> Compacting out nugatory space in HTML would be another example.
>
> There are tools for processing tag based languages.  Why would I want to
> create a FSM by hand for that?
>
>> Though they are quite complicated, I find FSMs very easy to write, and
>> they almost always work first time. You can narrow your thinking to a
>> tiny case and ignore the big picture quite safely.
>
> Certainly you can write FSMs for a lot of things.  But you were claiming
> that a manual FSM should be used instead of a regexp engine; so the
> question remains unanswered: why would anyone create a FSM by hand for
> parsing?

It sounds cool to claim to do so in a usenet thread!

:-)

>> The other complicating factor is I use three different regex schemes
>> in a day: Java, Funduc and SlickEdit.  I keep borrowing syntax from
>> one of the other schemes than the one I am using.
>
> And how exactly do you implement a FSM in SlickEdit?
>
>> Some day I will
>> have to write replacements that use Java syntax.
>
> Not sure what you mean by that.

I think he is talking about writing a plugin with a 100%
Java compatible regex syntax.

Arne

[toc] | [prev] | [next] | [standalone]


#22898

FromRobert Klemme <shortcutter@googlemail.com>
Date2013-03-11 22:24 +0100
Message-ID<aq70csFg7d2U1@mid.individual.net>
In reply to#22895
On 03/11/2013 09:59 PM, Arne Vajhøj wrote:
> On 3/11/2013 4:08 PM, Robert Klemme wrote:

>> Certainly you can write FSMs for a lot of things.  But you were claiming
>> that a manual FSM should be used instead of a regexp engine; so the
>> question remains unanswered: why would anyone create a FSM by hand for
>> parsing?
>
> It sounds cool to claim to do so in a usenet thread!
>
> :-)

You've got a point there!

Cheers

	robert

[toc] | [prev] | [next] | [standalone]


#22891

FromRobert Klemme <shortcutter@googlemail.com>
Date2013-03-11 21:00 +0100
Message-ID<aq6rerFf1tsU1@mid.individual.net>
In reply to#22875
On 10.03.2013 23:21, Stefan Ram wrote:
> Robert Klemme <shortcutter@googlemail.com> writes:
>> What limitations would make me want to write a FSM instead by hand?
>
>    It is a natural idea that the user may input simple
>    arithmetic expressions with numeric literals, basic
>    arithmetics, parentheses and algebraic signs when the
>    program asks for a numeric value.

I am sorry but you are not answering the question.

Cheers

	robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#22942

FromRobert Klemme <shortcutter@googlemail.com>
Date2013-03-13 08:07 +0100
Message-ID<aqamu2FaidtU2@mid.individual.net>
In reply to#22873
On 10.03.2013 15:57, Roedy Green wrote:
> On Sun, 10 Mar 2013 02:27:32 +0000 (UTC),
> qwertmonkey@syberianoutpost.ru wrote, quoted or indirectly quoted
> someone who said :
>
>> Any ideas you would share?
>
> Regexes are quite limited. When you bang into their limits you can
> write a finite state machine or use a parser.

Roedy, I'm still curious what would make me want to write a FSM by hand 
over using a Regex engine.  What limitations and reasons did you have in 
mind when you wrote the above?

Cheers

	robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#22874

Frommarkspace <markspace@nospam.nospam>
Date2013-03-10 11:16 -0700
Message-ID<khiiia$p8s$1@dont-email.me>
In reply to#22863
On 3/9/2013 6:27 PM, qwertmonkey@syberianoutpost.ru wrote:

>   One of the problems I am having is that if you enter as options say [true|t],
> the matcher would match just the "t" of "true" and I want for "true" to be
> actually matched another one is that, say, " true ", should be matched, as well
> as "false [ nix |mac| windows ] line.separator" ...
> ~
>   Any ideas you would share?
> ~


Based on your syntax example and you title, why bother with 
"Backus-Naurish?"  Java has full parser generators.

http://www.antlr.org/

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.java.programmer


csiph-web