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


Groups > comp.lang.postscript > #3115

Re: Parser combinators

From Carlos <carlos@cvkm.cz>
Newsgroups comp.lang.postscript
Subject Re: Parser combinators
Date 2017-06-13 07:40 +0200
Organization A noiseless patient Spider
Message-ID <20170613074059.02058fe1@samara.DOMA> (permalink)
References (5 earlier) <bf96c8d8-fba3-4598-8ff4-c77b33aa4a51@googlegroups.com> <3e0df99a-2bbe-4f32-9f7c-61492432b623@googlegroups.com> <8c08b559-58ab-4546-b480-f3a44ff914fa@googlegroups.com> <87cb3ae9-2580-45af-b6a2-38f7cecd533c@googlegroups.com> <f27c0490-4a15-4a50-9d2b-40ab28664e5e@googlegroups.com>

Show all headers | View raw


[luser droog <luser.droog@gmail.com>, 2017-06-12 21:19]
> On Sunday, June 11, 2017 at 1:36:15 AM UTC-5, luser droog wrote:
> > I've got a better one now. The idea is it's a sequence. In my
> > builder notation,
> > 
> >   [ x ]
> > 
> > where x is whatever, the input parser to this combinator. 
> > This is the zero-or-more quantifier, so there may be matching
> > input but if not, the matcher still succeeds.
> > 
> >   << [ x ] true >>
> > 
> > Then we stitch this into a loop by inserting the whole matcher
> > into the inner sequence.
> > 
> >   y = <<[ x y ] true>>
> > 
> > And it works!
> >   
> 
> It came up in the comp.lang.c thread that this is not the usual
> behavior of BNF quantifiers. There's no backtracking so a greedy
> quantifier with this program is also "possessive". So with 
> something like
> 
>     (x) term some
>     (xy) term alt
> 
> which corresponds to the regex
> 
>     x+xy
> 
> the 'x+' consumes all 'x's that may be present, and the 'xy' part
> will never match.
> 
> I may not be able to fix this quickly or easily. Need to rethink
> the whole deal.

According to https://qntm.org/combinators shouldn't "x+" return a set of
all matches?

-- 

Back to comp.lang.postscript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Parser combinators luser droog <luser.droog@gmail.com> - 2017-05-28 21:22 -0700
  Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-03 15:15 -0700
    Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-04 11:13 -0700
      Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-04 18:57 -0700
        Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-04 19:39 -0700
          Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-06 23:38 -0700
            Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-08 22:18 -0700
              Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-09 14:54 -0700
                Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-10 23:36 -0700
                Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-12 21:19 -0700
                Re: Parser combinators Carlos <carlos@cvkm.cz> - 2017-06-13 07:40 +0200
                Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-13 01:53 -0700
                Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-13 03:48 -0700
                Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-13 04:22 -0700
                Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-13 23:28 -0700
                Re: Parser combinators Carlos <carlos@cvkm.cz> - 2017-06-14 21:52 +0200
                Re: Parser combinators luser droog <luser.droog@gmail.com> - 2017-06-15 13:36 -0700

csiph-web