Re: Compiling expressions

James Harris <james.harris.1@gmail.com>
Thu, 3 Jan 2013 12:01:33 -0800 (PST)

          From comp.compilers

Related articles
Compiling expressions james.harris.1@gmail.com (James Harris) (2012-12-29)
Re: Compiling expressions gah@ugcs.caltech.edu (glen herrmannsfeldt) (2012-12-29)
Re: Compiling expressions mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2012-12-30)
Re: Compiling expressions james.harris.1@gmail.com (James Harris) (2013-01-02)
Re: Compiling expressions james.harris.1@gmail.com (James Harris) (2013-01-02)
Re: Compiling expressions matzebraun@googlemail.com (matzebraun@googlemail.com) (2013-01-03)
Re: Compiling expressions torbenm@diku.dk (2013-01-03)
Re: Compiling expressions james.harris.1@gmail.com (James Harris) (2013-01-03)
Re: Compiling expressions james.harris.1@gmail.com (James Harris) (2013-01-03)
Re: Compiling expressions mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2013-01-04)
Re: Compiling expressions james.harris.1@gmail.com (James Harris) (2013-01-06)
Re: Compiling expressions vonbrand@inf.utfsm.cl (Horst von Brand) (2013-01-14)
Re: Compiling expressions james.harris.1@gmail.com (James Harris \(es\)) (2013-03-07)
| List of all articles for this month |

From: James Harris <james.harris.1@gmail.com>
Newsgroups: comp.compilers
Date: Thu, 3 Jan 2013 12:01:33 -0800 (PST)
Organization: Compilers Central
References: 12-12-035 12-12-038
Keywords: parse
Posted-Date: 03 Jan 2013 15:17:38 EST

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


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.