Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The unrecognized minister of propaganda, E -- seen in an email from Ean Schuessler


devel / comp.compilers / Parser LL(*)

SubjectAuthor
* Parser LL(*)Andy
`* Re: Parser LL(*)George Neuner
 `* LL(*)Christopher F Clark
  `- Re: LL(*)George Neuner

1
Parser LL(*)

<22-03-039@comp.compilers>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=324&group=comp.compilers#324

  copy link   Newsgroups: comp.compilers
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From: borucki....@gmail.com (Andy)
Newsgroups: comp.compilers
Subject: Parser LL(*)
Date: Fri, 18 Mar 2022 11:38:48 -0700 (PDT)
Organization: Compilers Central
Lines: 6
Sender: news@iecc.com
Approved: comp.compilers@iecc.com
Message-ID: <22-03-039@comp.compilers>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="61594"; mail-complaints-to="abuse@iecc.com"
Keywords: LL(1), question
Posted-Date: 18 Mar 2022 14:46:18 EDT
X-submission-address: compilers@iecc.com
X-moderator-address: compilers-request@iecc.com
X-FAQ-and-archives: http://compilers.iecc.com
 by: Andy - Fri, 18 Mar 2022 18:38 UTC

Many language construction needs lookahead depth known in runtime, for example difference between function declarations and definitions.
LL(*) is described in https://www.antlr.org/papers/allstar-techreport.pdf.
This is only one place about LL(*) info?
If is the simplest idea make LL(1) with several conflicts and first speculative trying all paths, and backtrack?
How do speedup it with cache?
How make speculative trying in function calls?

Re: Parser LL(*)

<22-03-043@comp.compilers>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=328&group=comp.compilers#328

  copy link   Newsgroups: comp.compilers
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From: gneun...@comcast.net (George Neuner)
Newsgroups: comp.compilers
Subject: Re: Parser LL(*)
Date: Sat, 19 Mar 2022 21:14:59 -0400
Organization: A noiseless patient Spider
Lines: 38
Sender: news@iecc.com
Approved: comp.compilers@iecc.com
Message-ID: <22-03-043@comp.compilers>
References: <22-03-039@comp.compilers>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="56475"; mail-complaints-to="abuse@iecc.com"
Keywords: parse, LL(1)
Posted-Date: 19 Mar 2022 22:30:19 EDT
X-submission-address: compilers@iecc.com
X-moderator-address: compilers-request@iecc.com
X-FAQ-and-archives: http://compilers.iecc.com
 by: George Neuner - Sun, 20 Mar 2022 01:14 UTC

On Fri, 18 Mar 2022 11:38:48 -0700 (PDT), Andy
<borucki.andrzej@gmail.com> wrote:

>Many language construction needs lookahead depth known in runtime, for
>example difference between function declarations and definitions.
>LL(*) is described in
> https://www.antlr.org/papers/allstar-techreport.pdf.
>This is only one place about LL(*) info?

Terence Parr both invented LL(*) and is the author of the ANTLR tool.
AFAIK, Parr's own papers and books are the only sources of information
about the method.

>If is the simplest idea make LL(1) with several conflicts and first
>speculative trying all paths, and backtrack?

No, the simplest idea was LL(k) with a fixed value of 'k'. I don't
believe Parr developed the method, but he was one of the pioneers of
using it. Parr authored PCCTS which used LL(k), and early versions of
ANTLR [prior to LL(*)] also used it.

LL(*) eliminates the need for the developer to figure out what 'k' is
optimal for the grammar: too low results in conflicts, too high may
waste processing effort.

>How do speedup it with cache?

??? Lookahead tokens already are cached.

>How make speculative trying in function calls?

Sorry, I'm not sure what you are asking.

George

LL(*)

<22-03-045@comp.compilers>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=330&group=comp.compilers#330

  copy link   Newsgroups: comp.compilers
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From: christop...@compiler-resources.com (Christopher F Clark)
Newsgroups: comp.compilers
Subject: LL(*)
Date: Sun, 20 Mar 2022 20:05:41 +0200
Organization: Compilers Central
Lines: 42
Sender: news@iecc.com
Approved: comp.compilers@iecc.com
Message-ID: <22-03-045@comp.compilers>
References: <22-03-039@comp.compilers> <22-03-043@comp.compilers>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="71474"; mail-complaints-to="abuse@iecc.com"
Keywords: parse, LL(1)
Posted-Date: 20 Mar 2022 15:12:12 EDT
X-submission-address: compilers@iecc.com
X-moderator-address: compilers-request@iecc.com
X-FAQ-and-archives: http://compilers.iecc.com
 by: Christopher F Clark - Sun, 20 Mar 2022 18:05 UTC

George Neuner gets this right:

> Terence Parr both invented LL(*) and is the author of the ANTLR tool.
> AFAIK, Parr's own papers and books are the only sources of information
> about the method.

> >If is the simplest idea make LL(1) with several conflicts and first
> >speculative trying all paths, and backtrack?

> No, the simplest idea was LL(k) with a fixed value of 'k'. I don't
> believe Parr developed the method, but he was one of the pioneers of
> using it. Parr authored PCCTS which used LL(k), and early versions of
> ANTLR [prior to LL(*)] also used it.

> LL(*) eliminates the need for the developer to figure out what 'k' is
> optimal for the grammar: too low results in conflicts, too high may
> waste processing effort.

Terence's original paper, "Breaking the atomic k-tuple" made LL(k)
feasible, basically by doing each extra amount of lookahead 1 at a time.
Thus,LL(1) if no conflicts done, For those rules with LL(1) conflicts,
try LL(2), etc. No backtracking ever. No speculative execution either(*).
Just figure out how many tokens you need to read before you can
disambiguate which rule applies It is nearly always a fixed number.
If it isn't, the grammar is not LL(k) for any k. And, the if-then-else hack
takes care of one of the main problem cases where it isn't.

The latest version ANTLR4 does a slightly different variation on that,
by building a RTN that solves the problem. That's almost the same as
building an LR parser, but not quite. The only place one notices the
difference is when one has indirect (nested) left recursion. ANTLR4
doesn't allow that.

*) syntactic predicates are essentiaily speculative execution, but they
aren't strictly a part of LL(k)
--
******************************************************************************
Chris Clark email: christopher.f.clark@compiler-resources.com
Compiler Resources, Inc. Web Site: http://world.std.com/~compres
23 Bailey Rd voice: (508) 435-5016
Berlin, MA 01503 USA twitter: @intel_chris
------------------------------------------------------------------------------

Re: LL(*)

<22-03-046@comp.compilers>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=331&group=comp.compilers#331

  copy link   Newsgroups: comp.compilers
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From: gneun...@comcast.net (George Neuner)
Newsgroups: comp.compilers
Subject: Re: LL(*)
Date: Mon, 21 Mar 2022 15:47:54 -0400
Organization: A noiseless patient Spider
Lines: 48
Sender: news@iecc.com
Approved: comp.compilers@iecc.com
Message-ID: <22-03-046@comp.compilers>
References: <22-03-039@comp.compilers> <22-03-043@comp.compilers> <22-03-045@comp.compilers>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="7768"; mail-complaints-to="abuse@iecc.com"
Keywords: LL(1)
Posted-Date: 21 Mar 2022 15:52:50 EDT
X-submission-address: compilers@iecc.com
X-moderator-address: compilers-request@iecc.com
X-FAQ-and-archives: http://compilers.iecc.com
 by: George Neuner - Mon, 21 Mar 2022 19:47 UTC

On Sun, 20 Mar 2022 20:05:41 +0200, Christopher F Clark
<christopher.f.clark@compiler-resources.com> wrote:

>George Neuner gets this right:
>
>> Terence Parr both invented LL(*) and is the author of the ANTLR tool.
>> AFAIK, Parr's own papers and books are the only sources of information
>> about the method.
>
>> >If is the simplest idea make LL(1) with several conflicts and first
>> >speculative trying all paths, and backtrack?
>
>> No, the simplest idea was LL(k) with a fixed value of 'k'. I don't
>> believe Parr developed the method, but he was one of the pioneers of
>> using it. Parr authored PCCTS which used LL(k), and early versions of
>> ANTLR [prior to LL(*)] also used it.
>
>> LL(*) eliminates the need for the developer to figure out what 'k' is
>> optimal for the grammar: too low results in conflicts, too high may
>> waste processing effort.
>
>Terence's original paper, "Breaking the atomic k-tuple" made LL(k)
>feasible, basically by doing each extra amount of lookahead 1 at a time.
>Thus,LL(1) if no conflicts done, For those rules with LL(1) conflicts,
>try LL(2), etc. No backtracking ever. No speculative execution either(*).
>Just figure out how many tokens you need to read before you can
>disambiguate which rule applies It is nearly always a fixed number.
>If it isn't, the grammar is not LL(k) for any k. And, the if-then-else hack
>takes care of one of the main problem cases where it isn't.

So Parr did invent a way to make fixed 'k' more practical to use. I
was not aware of that - thank you.

>The latest version ANTLR4 does a slightly different variation on that,
>by building a RTN that solves the problem. That's almost the same as
>building an LR parser, but not quite. The only place one notices the
>difference is when one has indirect (nested) left recursion. ANTLR4
>doesn't allow that.
>
>*) syntactic predicates are essentiaily speculative execution, but they
>aren't strictly a part of LL(k)

ANTLR also has so-called "semantic" predicates which can invoke user
supplied functions and continue with or fail the current rule based on
the results.

George

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor