Re: Compiling expressions

James Harris <james.harris.1@gmail.com>
Sun, 6 Jan 2013 00:57:52 -0800 (PST)

          From comp.compilers

Related articles
[4 earlier articles]
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: Sun, 6 Jan 2013 00:57:52 -0800 (PST)
Organization: Compilers Central
References: 12-12-035 13-01-013
Keywords: parse
Posted-Date: 06 Jan 2013 13:19:51 EST

On Jan 3, 9:33 pm, James Harris <james.harri...@gmail.com> wrote:


A small correction was needed, as follows, as I had omitted the loop-
out condition.


> function value_parse(op1)
> v1 = value() //identifier or literal
> while true
> op2 = current token or dummy end of expression
> if lparen //parens of a function call or similar
> v1 = args_parse(op2)
> consume rparen
> else if prec(op2) > prec(op1)
> if incompatible(op1, op2)
> raise "incompatible - grouping parens needed"
> v1 = node(POSTFIX_OP, v1)
        else
            break
> return v1


James


Post a followup to this message

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