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
> 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
> 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
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
"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
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
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
> 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
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.
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
10 matches
Mail list logo