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


Groups > comp.compilers > #835

Re: Compiling expressions

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!.POSTED!nerds-end
From James Harris <james.harris.1@gmail.com>
Newsgroups comp.compilers
Subject Re: Compiling expressions
Date Thu, 3 Jan 2013 12:01:33 -0800 (PST)
Organization Compilers Central
Lines 32
Sender johnl@iecc.com
Approved comp.compilers@iecc.com
Message-ID <13-01-012@comp.compilers> (permalink)
References <12-12-035@comp.compilers> <12-12-038@comp.compilers>
NNTP-Posting-Host news.iecc.com
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Trace leila.iecc.com 1357244258 2089 64.57.183.58 (3 Jan 2013 20:17:38 GMT)
X-Complaints-To abuse@iecc.com
NNTP-Posting-Date Thu, 3 Jan 2013 20:17:38 +0000 (UTC)
Keywords parse
Posted-Date 03 Jan 2013 15:17:38 EST
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref csiph.com comp.compilers:835

Show key headers only | View raw


On Dec 30 2012, 7:58 am, "Dmitry A. Kazakov" <mail...@dmitry-
kazakov.de> wrote:

...
> Here is an implementation with an explanation of the technique used:
>
> http://www.dmitry-kazakov.de/ada/components.htm#Parsers_etc

Thanks Dmitry. As mentioned I am not looking for a solution at the
moment. Maybe I have spent too long with this to give up and import a
solution now. I may well come back to it though, especially the
comments. It seems to be very clearly explained.

> I extended the method, which fairly old, towards non-associativity (#6),
> advanced parenthesis (#5, keyed parameter associations), and split
> association priorities into left-right pairs. But basically it is still the
> same twin-stack method. Everything is table-driven, of course.

Is it based on a Pratt parser? I see your comment and saw left and
right priorities mentioned. I have never spent the time to understand
Pratt parsers or why they need both. To deal with left- and right-
associativity if I ever need to I was thinking to use the lowest bit
of the precedence - something along the lines of clearing the bit on
one side before a comparison. Then each operator would only need a
single precedence. Or, maybe Pratt parsers use left and right
priorities for cleverer purposes such as an operator in multiple
parts...?

At any rate, have come up with some ideas for a parser. Will post
separately.

James

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Compiling expressions James Harris <james.harris.1@gmail.com> - 2012-12-29 05:11 -0800
  Re: Compiling expressions glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-12-29 23:33 +0000
    Re: Compiling expressions James Harris <james.harris.1@gmail.com> - 2013-01-02 09:04 -0800
      Re: Compiling expressions "matzebraun@googlemail.com" <matzebraun@googlemail.com> - 2013-01-03 07:13 -0800
      Re: Compiling expressions Horst von Brand <vonbrand@inf.utfsm.cl> - 2013-01-14 16:31 -0300
  Re: Compiling expressions "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-12-30 08:58 +0100
    Re: Compiling expressions James Harris <james.harris.1@gmail.com> - 2013-01-02 09:10 -0800
    Re: Compiling expressions James Harris <james.harris.1@gmail.com> - 2013-01-03 12:01 -0800
      Re: Compiling expressions "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-01-04 10:18 +0100
  Re: Compiling expressions torbenm@diku.dk (Torben Ægidius Mogensen) - 2013-01-03 16:49 +0100
  Re: Compiling expressions James Harris <james.harris.1@gmail.com> - 2013-01-03 13:33 -0800
    Re: Compiling expressions James Harris <james.harris.1@gmail.com> - 2013-01-06 00:57 -0800
    Re: Compiling expressions "James Harris \(es\)" <james.harris.1@gmail.com> - 2013-03-07 11:11 +0000

csiph-web