[Versa] equality
Jeremy Kloth
jeremy.kloth at fourthought.com
Mon Sep 26 13:01:53 MDT 2005
On Monday 26 September 2005 12:46 pm, Michael Olson wrote:
> On Sep 26, 2005, at 12:39 PM, Jeremy Kloth wrote:
> > On Monday 26 September 2005 12:29 pm, Michael Olson wrote:
> >>>> 1) now we could use this binding language for other queries such as
> >>>> XPath
> >>>> 2) by separating the grammars we are free to reuse symbols. In
> >>>> this
> >>>> case the '@' is fair game again, and we could go back to "=" for
> >>>> equality (I think)
> >>
> >> Just an FYI, not so lucky here with the "=", as the reduce/reduce
> >> conflict comes from keyword arguments not the declarations
> >
> > You do need precedence, you bastard :)
>
> I don't think it will help in this case as precedence is not an issue
>
> the production
>
> qname '=' expression
>
> is really ambiguous in our grammar. In one case, we say (roughly)
>
> expression :== qname '=' expression
>
> and in another we say
>
> keyword-argument :== qname '=' expression
>
> so the query
>
> function_call ( foo = bar)
>
> can always be interpreted as either
>
> "call the function "function_call" with the keyword argument "foo" set
> to "bar"
>
> or
>
> "call the function "function_call" with a single boolean parameter"
>
Maybe look to the Python grammar for some help. Although it really depends on
how the grammar is interpreted. If there are two levels, a "line" and a
series of "lines" then it would be easy enough. In Python speak, a statement
maps to a "line" and a "suite" maps to a sequence of "lines".
--
Jeremy Kloth
Fourthought, Inc.
http://fourthought.com/
http://4suite.org/
More information about the Versa
mailing list