help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to change default outcome of shift/reduce conflict?


From: Anthony DeRobertis
Subject: Re: How to change default outcome of shift/reduce conflict?
Date: Wed, 16 Jan 2002 09:02:12 -0500

On Tuesday, January 15, 2002, at 07:38 PM, Hans Aberg wrote:

Here, the action $1 | $3 would check the types of $1 and $3, and if they
are combinable into a Boolean value it would do so; otherwise, it would
combine them into a list object. (Think on for example C++ operator
function name overloading based on argument type.)

This language is very weakly typed. So I don't know at parse time the type of a variable, or for that matter that it is a variable... could just be an unquoted string.

also:

        answer "hello" with true or false

has two buttons. So I couldn't do that even if I had type information.

From the theoretical point of view, we merely give up trying to capture the
language (specifically, the distinction between the two different "or"'s) using a context free grammar alone: If we would want the grammar to capture
this construction, it would lead to an attribute grammar or something.

I believe HyperCard --- the reference implementation --- uses a hand-written recursive descent parser. Or at least I've heard rumors to the effect. So I get to hold out some hope.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]