Re: Newbie requestion on operator precedence and how to resolve an s/r conflict correctly.

2008-02-20 Thread Hans Aberg
On 20 Feb 2008, at 09:00, Arlen Cuss wrote: I'm writing a parser for Ruby (http://www.ruby-lang.org/). So far, it can parse a sizeable subset of the language. The problem I'm encountering is as follows: `obj.method' is a method call on `obj'. This is parsed correctly. `obj.method(args)' is

Re: interesting push parser use case

2008-02-20 Thread Joel E. Denny
On Wed, 20 Feb 2008, Bob Rossi wrote: > Sorry for the extremely long delay. I'm trying out your suggestion now. > Whenver I put a struct in the parse param like so, > %parse-param { struct gdbmi_pdata *gdbmi_pdata } > I get a compiler warning, > ../../../../cgdb/lib/gdbmi/src/gdbmi_grammar.h:12

Re: building from CVS

2008-02-20 Thread Joel E. Denny
On Wed, 20 Feb 2008, Bob Rossi wrote: > My next error was this, I only added, > %define api.push_pull "push" > to my bison input file. That caused this compiler error, > if gcc -DHAVE_CONFIG_H -I. -I../../../../cgdb/lib/gdbmi/src -I.. > -I../../../../cgdb/lib/gdbmi/src/mi_oc_parser -g -O2

Re: interesting push parser use case

2008-02-20 Thread Bob Rossi
On Sun, Sep 09, 2007 at 11:03:13AM +0200, [EMAIL PROTECTED] wrote: > > On Sat, 8 Sep 2007, Bob Rossi wrote: > >> The second issue is slightly more fuzzy. Essentially, after each token I > >> give to the parser, it would probably be useful to know if it just > >> finished a particular rule, and if s

Re: Newbie requestion on operator precedence and how to resolve an s/r conflict correctly.

2008-02-20 Thread lfinsto1
> I'm not really fussed if we call them methods or functions, so no worries > there. :) I'm not sure if it's so important that we need to distinguish > the > two things (talking also on the topic of Bison only), but perhaps it would > help. If I may be allowed to drift slightly into the realm of p

Re: Newbie requestion on operator precedence and how to resolve an s/r conflict correctly.

2008-02-20 Thread lfinsto1
> YYTYPE is a massive union. funccall is declared %type [...] If you've got lots of types in your union, you might want to consider using `void*' for some of them instead and casting to the correct type where needed in the rules. If you're just setting the `$$' from another symbol and both have

Newbie requestion on operator precedence and how to resolve an s/r conflict correctly.

2008-02-20 Thread Arlen Cuss
I did it again. I should check my mail preferences for replying. -- Hey, On Feb 21, 2008 12:00 AM, <[EMAIL PROTECTED]> wrote: > I see. It seems to me that you may need a way to distinguish > syntactically between a plain object and an object returned by a call to a > function (sorry, I won't ca

Re: Fwd: Newbie requestion on operator precedence and how to resolve an s/r conflict correctly.

2008-02-20 Thread lfinsto1
"Arlen Cuss" <[EMAIL PROTECTED]> wrote: > On Feb 20, 2008 10:19 PM, <[EMAIL PROTECTED]> wrote: > In Ruby, everything is an object, and all functions return objects (even > if > it's `nil'). This makes it easy for us, since we assume (or rather, we > know) > that all functions return objects and h

Re: Newbie requestion on operator precedence and how to resolve an s/r conflict correctly.

2008-02-20 Thread Arlen Cuss
Well, I solved my problem. Quickly enough, I know, but it was a week or so before this of thinking. I'll explain it if anyone's interested. In Ruby, since an identifier could be a local variable or method at runtime, and we don't know which, we can't differentiate the two in the parser. Hence, fun

Re: building from CVS

2008-02-20 Thread Bob Rossi
On Tue, Feb 19, 2008 at 09:22:38PM -0500, Bob Rossi wrote: > On Tue, Feb 19, 2008 at 07:54:16PM -0500, Joel E. Denny wrote: > > On Tue, 19 Feb 2008, Claudio Saavedra wrote: > > > > > El mar, 19-02-2008 a las 19:21 -0500, Joel E. Denny escribió: > > > > > > > > Obviously this is caused by my recen

Fwd: Newbie requestion on operator precedence and how to resolve an s/r conflict correctly.

2008-02-20 Thread Arlen Cuss
I didn't send this to list. Trying again, sorry! On Feb 20, 2008 10:19 PM, <[EMAIL PROTECTED]> wrote: > > A shift/reduce conflict occurs where `obj.method(args)' is seen by my > > parser. Instead of reducing when it sees the upcoming `.', it shifts, > and > > it > > ends up with the whole `obj.me

Re: Newbie requestion on operator precedence and how to resolve an s/r conflict correctly.

2008-02-20 Thread lfinsto1
> I've been trying to nut out a problem for a week or so in a bison parser > I've been writing, and I'm failing. Please excuse me if this isn't the > correct place to ask - I haven't convened with anyone about bison parsers > before. It is one correct place to ask. If it's more about compilers in

Re: Newbie requestion on operator precedence and how to resolve an s/r conflict correctly.

2008-02-20 Thread Arlen Cuss
I'll add a bit of information. After using parser tracing, I've found in fact this is happening: a(b).c is being parsed as `a(b.c)', however the reasoning is different; after reading `a(b)' it reduces just `(b)' by the rule for parenthesised expressions, '(' *expr* ')'. The rest falls into place.

Newbie requestion on operator precedence and how to resolve an s/r conflict correctly.

2008-02-20 Thread Arlen Cuss
Hi all, I've been trying to nut out a problem for a week or so in a bison parser I've been writing, and I'm failing. Please excuse me if this isn't the correct place to ask - I haven't convened with anyone about bison parsers before. I'm writing a parser for Ruby (http://www.ruby-lang.org/). So f